結果

問題 No.333 門松列を数え上げ
ユーザー ルッツファンルッツファン
提出日時 2016-01-15 23:55:06
言語 Java21
(openjdk 21)
結果
AC  
実行時間 133 ms / 2,000 ms
コード長 1,584 bytes
コンパイル時間 4,050 ms
コンパイル使用メモリ 78,708 KB
実行使用メモリ 57,520 KB
最終ジャッジ日時 2023-10-19 23:41:46
合計ジャッジ時間 5,473 ms
ジャッジサーバーID
(参考情報)
judge15 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 129 ms
57,172 KB
testcase_01 AC 129 ms
57,140 KB
testcase_02 AC 129 ms
57,520 KB
testcase_03 AC 129 ms
57,156 KB
testcase_04 AC 133 ms
57,412 KB
testcase_05 AC 133 ms
57,228 KB
testcase_06 AC 133 ms
57,112 KB
testcase_07 AC 131 ms
57,416 KB
testcase_08 AC 132 ms
57,096 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

package yukicoder;

import java.util.Scanner;

public class yukicoder333 {
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		long[] a = readLineLongArray(sc);
		
		long count = 0;
		
		if(a[0] < a[1]){
			count = a[0] - 2L -a[0] +a[1];
		}else{
			count = 2000000000L-a[0] -1L+a[0] -a[1];
		}
		
		System.out.println(count);
		
		
		
	}
	protected static long readLineLong(Scanner sc) {
		return Long.parseLong(sc.nextLine());
	}
	
	protected static long[] readLineLongArray(Scanner sc) {
		String split[] = sc.nextLine().split(" ");
		long ret[] = new long[split.length];
		for (int i = 0; i < ret.length; i++) {
			ret[i] = Long.parseLong(split[i]);
		}
		return ret;
	}
	protected static int readLineInt(Scanner sc) {
		return Integer.parseInt(sc.nextLine());
	}
	
	protected static int[] readLineIntArray(Scanner sc) {
		String split[] = sc.nextLine().split(" ");
		int ret[] = new int[split.length];
		for (int i = 0; i < ret.length; i++) {
			ret[i] = Integer.parseInt(split[i]);
		}
		return ret;
	}
	
	protected static double readLineDouble(Scanner sc) {
		return Double.parseDouble(sc.nextLine());
	}
	
	protected static double[] readLineDoubleArray(Scanner sc) {
		String split[] = sc.nextLine().split(" ");
		double ret[] = new double[split.length];
		for (int i = 0; i < ret.length; i++) {
			ret[i] = Double.parseDouble(split[i]);
		}
		return ret;
	}
	
	protected static String readLineString(Scanner sc) {
		return sc.nextLine();
	}
	
	protected static String[] readLineStringArray(Scanner sc) {
		return sc.nextLine().split(" ");
	}

}
0