結果
| 問題 |
No.333 門松列を数え上げ
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2016-04-03 23:05:50 |
| 言語 | Java (openjdk 23) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 598 bytes |
| コンパイル時間 | 2,345 ms |
| コンパイル使用メモリ | 74,480 KB |
| 実行使用メモリ | 54,104 KB |
| 最終ジャッジ日時 | 2024-10-02 13:04:48 |
| 合計ジャッジ時間 | 3,957 ms |
|
ジャッジサーバーID (参考情報) |
judge2 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 |
| other | AC * 4 WA * 3 |
ソースコード
import java.util.Scanner;
public class Main {
public static void main(String[] args) {
// 標準入力から読み込む際に、Scannerオブジェクトを使う。
Scanner sc = new Scanner(System.in);
// int 1つ分を読み込む
int a = sc.nextInt();
// int 1つ分を読み込む
int b = sc.nextInt();
int c=0;
if(a<b){
if(a==1 && b==2) c=0;
else if(a+1==b) c=a-1;
else c=(b-a-1)+(a-1);
}else if(a>b){
c=2000000000-a;
}
// 標準出力に書き出す。
System.out.println(c);
}
}