結果

問題 No.333 門松列を数え上げ
ユーザー takeya_okino
提出日時 2017-06-21 16:26:40
言語 Java
(openjdk 23)
結果
AC  
実行時間 128 ms / 2,000 ms
コード長 309 bytes
コンパイル時間 2,256 ms
コンパイル使用メモリ 73,848 KB
実行使用メモリ 41,500 KB
最終ジャッジ日時 2024-10-02 10:51:59
合計ジャッジ時間 3,958 ms
ジャッジサーバーID
(参考情報)
judge1 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 7
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.*;

public class Main {
  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    int a = sc.nextInt();
    int b = sc.nextInt();
    int ans = 0;
    if(a > b) ans = (int)Math.pow(10, 9) * 2 - b - 1;
    if(a < b) ans = b - 2;
    System.out.println(ans);
  }
}
0