Submission #00251
ソースコード
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 | import java.io.BufferedInputStream; import java.io.IOException; import java.io.InputStream; import java.util.stream.IntStream; public class Main{ public static void main(String[]$) throws IOException{ new Main().solve(); } static FastScanner s= new FastScanner(System.in); static IntStream REPS( int v){ return IntStream.range(0,v);} static IntStream REPS( int l, int r){ return IntStream.rangeClosed(l,r);} static int gInt() throws IOException{ return s.nextInt();} static long gLong() throws IOException{ return s.nextLong();} static long gDouble() throws IOException{ return s.nextLong();} private void solve() throws IOException{ int a=gInt(),b=gInt(); System.out.println(gInt()>0?a+b:a-b); } static void yesno(boolean f) { yesno(f, "YES" , "NO" ); } static void yesno(boolean f,String yes,String no) { System.out.println(f?yes:no); } } class FastScanner{ private final BufferedInputStream in; private static final int bufSize =1<<16; private final byte buf[] = new byte[bufSize]; private int i =bufSize; private int k =bufSize; private final StringBuilder str = new StringBuilder(); FastScanner(InputStream in){ this .in= new BufferedInputStream(in,bufSize); } int nextInt() throws IOException{ return ( int )nextLong(); } long nextLong() throws IOException{ int c; long x=0; boolean sign= true ; while ((c=nextChar())<=32) ; if (c== '-' ){ sign= false ; c=nextChar(); } if (c== '+' ){ c=nextChar(); } while (c>= '0' ){ x=x*10+(c- '0' ); c=nextChar(); } return sign?x:-x; } int nextChar() throws IOException{ if (i==k){ k=in.read(buf,0,bufSize); i=0; } return i>=k?-1:buf[i++]; } String next() throws IOException{ int c; str.setLength(0); while ((c=nextChar())<=32&&c!=-1) ; if (c==-1){ return null; } while (c>32){ str.append(( char )c); c=nextChar(); } return str.toString(); } String nextLine() throws IOException{ int c; str.setLength(0); while ((c=nextChar())<=32&&c!=-1) ; if (c==-1){ return null; } while (c!= '\n' ){ str.append(( char )c); c=nextChar(); } return str.toString(); } } |
ステータス
項目 | データ |
---|---|
問題 | 0014 - 眠れる獅子の油断 |
ユーザー名 | fal_rnd |
投稿日時 | 2017-11-06 18:25:58 |
言語 | Java |
状態 | Accepted |
得点 | 14 |
ソースコード長 | 2224 Byte |
最大実行時間 | 61 ms |
最大メモリ使用量 | 14252 KB |
セット
セット | 得点 | Cases | |
---|---|---|---|
1 | ALL | 14 / 14 | * |
テストケース
ファイル名 | 状態 | 実行時間 | メモリ使用量 | # |
---|---|---|---|---|
01.txt | AC | 50 ms | 14252 KB |
1
|
02.txt | AC | 56 ms | 12048 KB |
1
|
03.txt | AC | 55 ms | 12636 KB |
1
|
04.txt | AC | 61 ms | 13144 KB |
1
|
05.txt | AC | 60 ms | 13300 KB |
1
|