結果

問題 No.333 門松列を数え上げ
ユーザー OGNM
提出日時 2016-12-26 15:16:02
言語 Java
(openjdk 23)
結果
AC  
実行時間 135 ms / 2,000 ms
コード長 577 bytes
コンパイル時間 3,496 ms
コンパイル使用メモリ 74,620 KB
実行使用メモリ 41,628 KB
最終ジャッジ日時 2024-12-15 00:05:18
合計ジャッジ時間 5,458 ms
ジャッジサーバーID
(参考情報)
judge2 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 7
権限があれば一括ダウンロードができます

ソースコード

diff #

package yukicoder;
import java.util.Scanner;
public class Study {
	public static void main(String[] args) {
         Scanner sc = new Scanner(System.in);
         int a = sc.nextInt();
         int b = sc.nextInt();
         int c = 0;
         int d = 0;
         if(a>b){
        	c = 2000000000-a - 1;
        	d = 2000000000-b - 1;
        	if(c > d){
        		System.out.println(c);
        	}else if(c < d){
        		System.out.println(d);
        	}
        }else if(a < b){
        	c = b - a - 1;
        	d = a-1;
        	System.out.println(c + d);
        }
	}
}
0