結果

問題 No.333 門松列を数え上げ
ユーザー kou6839kou6839
提出日時 2016-01-15 23:39:03
言語 Java21
(openjdk 21)
結果
AC  
実行時間 137 ms / 2,000 ms
コード長 772 bytes
コンパイル時間 2,320 ms
コンパイル使用メモリ 75,616 KB
実行使用メモリ 57,668 KB
最終ジャッジ日時 2023-10-19 23:40:17
合計ジャッジ時間 4,126 ms
ジャッジサーバーID
(参考情報)
judge12 / judge13
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 135 ms
57,444 KB
testcase_01 AC 133 ms
57,664 KB
testcase_02 AC 137 ms
57,668 KB
testcase_03 AC 131 ms
57,520 KB
testcase_04 AC 132 ms
57,488 KB
testcase_05 AC 134 ms
57,576 KB
testcase_06 AC 134 ms
57,576 KB
testcase_07 AC 133 ms
55,632 KB
testcase_08 AC 134 ms
57,532 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.awt.Frame;
import java.net.NetworkInterface;
import java.util.*;

public class Main {
	static long gcd(long a,long b){
		return b == 0 ? a : gcd(b, a%b);
	}
	static long lcm(long a, long b){
		return a*b/gcd(a, b);
	}
	static int[] dx = {0,1,0,-1};//→↓←↑
	static int[] dy = {1,0,-1,0};
	static class Pair{
		long weight,value;
		public Pair(long weight,long value) {
			// TODO Auto-generated constructor stub
			this.weight = weight;
			this.value = value;
		}
	}
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		
		int a = sc.nextInt();
		int b = sc.nextInt();
		if(a==b){
			System.out.println(0);
			return;
		}
		
		if(a<b){
			System.out.println(b-1-1);
		}else{
			System.out.println(2000000000-b-1);
		}
	}
}
0