結果

問題 No.333 門松列を数え上げ
コンテスト
ユーザー kou6839
提出日時 2016-01-15 23:39:03
言語 Java
(openjdk 26.0.2.1 + ACL)
コンパイル:
javac -J-Duser.language=en -encoding UTF8 -cp /opt/aclib/ac_library.jar _filename_
実行:
java -ea -Xmx700m -Xss256M -DONLINE_JUDGE=true -cp .:/opt/aclib/ac_library.jar _class_
結果
AC  
実行時間 56 ms / 2,000 ms
+ 760µs
コード長 772 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 1,245 ms
コンパイル使用メモリ 85,328 KB
実行使用メモリ 45,584 KB
最終ジャッジ日時 2026-08-31 07:36:09
合計ジャッジ時間 2,793 ms
ジャッジサーバーID
(参考情報)
judge1_0 / judge3_0
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 7
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

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