結果
問題 | No.333 門松列を数え上げ |
ユーザー | ルッツファン |
提出日時 | 2016-01-15 23:41:10 |
言語 | Java21 (openjdk 21) |
結果 |
WA
|
実行時間 | - |
コード長 | 1,615 bytes |
コンパイル時間 | 3,626 ms |
コンパイル使用メモリ | 78,128 KB |
実行使用メモリ | 57,436 KB |
最終ジャッジ日時 | 2023-10-19 23:41:04 |
合計ジャッジ時間 | 5,397 ms |
ジャッジサーバーID (参考情報) |
judge11 / judge15 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 126 ms
57,188 KB |
testcase_01 | AC | 113 ms
56,152 KB |
testcase_02 | WA | - |
testcase_03 | AC | 128 ms
57,372 KB |
testcase_04 | WA | - |
testcase_05 | WA | - |
testcase_06 | WA | - |
testcase_07 | AC | 127 ms
57,104 KB |
testcase_08 | AC | 129 ms
57,168 KB |
ソースコード
package yukicoder; import java.util.Scanner; public class yukicoder333 { public static void main(String[] args){ Scanner sc = new Scanner(System.in); long[] a = readLineLongArray(sc); long count = 0; if(a[1] - a[0] == 1){ count = a[0] - 1L; }else if(a[0] < a[1]){ count = a[1] - 1L -a[0]; }else{ count = 2000000000L-a[0]; } System.out.println(count); } protected static long readLineLong(Scanner sc) { return Long.parseLong(sc.nextLine()); } protected static long[] readLineLongArray(Scanner sc) { String split[] = sc.nextLine().split(" "); long ret[] = new long[split.length]; for (int i = 0; i < ret.length; i++) { ret[i] = Long.parseLong(split[i]); } return ret; } protected static int readLineInt(Scanner sc) { return Integer.parseInt(sc.nextLine()); } protected static int[] readLineIntArray(Scanner sc) { String split[] = sc.nextLine().split(" "); int ret[] = new int[split.length]; for (int i = 0; i < ret.length; i++) { ret[i] = Integer.parseInt(split[i]); } return ret; } protected static double readLineDouble(Scanner sc) { return Double.parseDouble(sc.nextLine()); } protected static double[] readLineDoubleArray(Scanner sc) { String split[] = sc.nextLine().split(" "); double ret[] = new double[split.length]; for (int i = 0; i < ret.length; i++) { ret[i] = Double.parseDouble(split[i]); } return ret; } protected static String readLineString(Scanner sc) { return sc.nextLine(); } protected static String[] readLineStringArray(Scanner sc) { return sc.nextLine().split(" "); } }