結果
問題 |
No.333 門松列を数え上げ
|
ユーザー |
|
提出日時 | 2016-05-04 13:58:18 |
言語 | Java (openjdk 23) |
結果 |
AC
|
実行時間 | 125 ms / 2,000 ms |
コード長 | 561 bytes |
コンパイル時間 | 2,129 ms |
コンパイル使用メモリ | 74,852 KB |
実行使用メモリ | 41,452 KB |
最終ジャッジ日時 | 2024-10-05 06:26:15 |
合計ジャッジ時間 | 3,862 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 2 |
other | AC * 7 |
ソースコード
import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); String[] input = new String[1]; int i = 0; while (sc.hasNext()) { input[i] = sc.nextLine(); i++; } System.out.println(solve(input)); sc.close(); } public static long solve(String[] in) { long a = Long.valueOf(in[0].split(" ")[0]); long b = Long.valueOf(in[0].split(" ")[1]); if (b > a) { // b > a > c || b > c > a; return b - 2L; } else { // a > c > b return 2000000000L - b - 1L; } } }