結果
問題 | No.333 門松列を数え上げ |
ユーザー | OGNM |
提出日時 | 2016-12-26 15:16:02 |
言語 | Java21 (openjdk 21) |
結果 |
AC
|
実行時間 | 126 ms / 2,000 ms |
コード長 | 577 bytes |
コンパイル時間 | 4,466 ms |
コンパイル使用メモリ | 72,200 KB |
実行使用メモリ | 55,960 KB |
最終ジャッジ日時 | 2023-08-21 12:43:41 |
合計ジャッジ時間 | 6,359 ms |
ジャッジサーバーID (参考情報) |
judge11 / judge15 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 124 ms
55,680 KB |
testcase_01 | AC | 124 ms
55,960 KB |
testcase_02 | AC | 123 ms
55,796 KB |
testcase_03 | AC | 124 ms
55,684 KB |
testcase_04 | AC | 124 ms
55,716 KB |
testcase_05 | AC | 126 ms
55,604 KB |
testcase_06 | AC | 125 ms
55,660 KB |
testcase_07 | AC | 123 ms
55,584 KB |
testcase_08 | AC | 125 ms
55,480 KB |
ソースコード
package yukicoder; import java.util.Scanner; public class Study { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int a = sc.nextInt(); int b = sc.nextInt(); int c = 0; int d = 0; if(a>b){ c = 2000000000-a - 1; d = 2000000000-b - 1; if(c > d){ System.out.println(c); }else if(c < d){ System.out.println(d); } }else if(a < b){ c = b - a - 1; d = a-1; System.out.println(c + d); } } }