結果
問題 | No.333 門松列を数え上げ |
ユーザー | fkwnw3_1243 |
提出日時 | 2017-05-03 08:54:48 |
言語 | Java21 (openjdk 21) |
結果 |
AC
|
実行時間 | 42 ms / 2,000 ms |
コード長 | 599 bytes |
コンパイル時間 | 1,858 ms |
コンパイル使用メモリ | 71,824 KB |
実行使用メモリ | 49,552 KB |
最終ジャッジ日時 | 2023-10-12 07:51:55 |
合計ジャッジ時間 | 2,852 ms |
ジャッジサーバーID (参考情報) |
judge11 / judge14 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 41 ms
49,388 KB |
testcase_01 | AC | 42 ms
49,136 KB |
testcase_02 | AC | 41 ms
49,512 KB |
testcase_03 | AC | 42 ms
49,408 KB |
testcase_04 | AC | 41 ms
49,324 KB |
testcase_05 | AC | 41 ms
49,228 KB |
testcase_06 | AC | 42 ms
49,428 KB |
testcase_07 | AC | 42 ms
49,552 KB |
testcase_08 | AC | 41 ms
49,284 KB |
ソースコード
import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import static java.lang.System.in; public class Main { public static void main(String[] args) throws IOException { BufferedReader reader = new BufferedReader(new InputStreamReader(in)); String[] inputs = reader.readLine().split(" "); int A = Integer.parseInt(inputs[0]); int B = Integer.parseInt(inputs[1]); if(A<B) { System.out.println((A-1) + (B-A-1)); } else { System.out.println( (2000000000-A) + (A-B-1)); } } }