結果

問題 No.257 N言っちゃダメゲーム (3)
ユーザー ぴろずぴろず
提出日時 2015-07-31 22:41:59
言語 Java21
(openjdk 21)
結果
RE  
実行時間 -
コード長 433 bytes
コンパイル時間 2,155 ms
コンパイル使用メモリ 71,632 KB
実行使用メモリ 73,836 KB
平均クエリ数 3.77
最終ジャッジ日時 2023-09-23 05:17:17
合計ジャッジ時間 9,395 ms
ジャッジサーバーID
(参考情報)
judge12 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 172 ms
72,352 KB
testcase_01 AC 168 ms
73,836 KB
testcase_02 AC 166 ms
71,884 KB
testcase_03 AC 167 ms
72,076 KB
testcase_04 AC 168 ms
71,592 KB
testcase_05 RE -
testcase_06 RE -
testcase_07 AC 167 ms
71,736 KB
testcase_08 AC 166 ms
71,556 KB
testcase_09 AC 168 ms
72,072 KB
testcase_10 AC 167 ms
71,372 KB
testcase_11 AC 167 ms
71,708 KB
testcase_12 AC 168 ms
72,392 KB
testcase_13 AC 168 ms
71,820 KB
testcase_14 AC 170 ms
70,496 KB
testcase_15 AC 167 ms
71,516 KB
testcase_16 AC 168 ms
72,256 KB
testcase_17 AC 168 ms
72,148 KB
testcase_18 AC 168 ms
72,264 KB
testcase_19 AC 168 ms
71,500 KB
testcase_20 AC 171 ms
72,268 KB
testcase_21 AC 167 ms
72,012 KB
testcase_22 AC 168 ms
71,504 KB
testcase_23 AC 170 ms
72,476 KB
testcase_24 AC 169 ms
71,544 KB
testcase_25 AC 170 ms
71,668 KB
testcase_26 AC 170 ms
72,060 KB
testcase_27 AC 168 ms
71,736 KB
testcase_28 AC 168 ms
71,844 KB
testcase_29 AC 168 ms
71,924 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

package no257;

import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		int x = 0;
		int k = sc.nextInt();
		if ((n - 1) % (k + 1) == 0) {
			System.out.println(0);
			x = sc.nextInt();
		}
		while(true) {
			System.out.println(n - 1 - (n - 1 - x) / (k + 1) * (k + 1));
			x = sc.nextInt();
			if (x >= n) {
				break;
			}
		}
	}

}
0