結果

問題 No.304 鍵(1)
ユーザー mitsuomitsuo
提出日時 2016-05-04 22:07:37
言語 Java21
(openjdk 21)
結果
AC  
実行時間 365 ms / 2,000 ms
コード長 665 bytes
コンパイル時間 2,225 ms
コンパイル使用メモリ 72,172 KB
実行使用メモリ 83,180 KB
平均クエリ数 309.17
最終ジャッジ日時 2023-09-23 23:50:03
合計ジャッジ時間 4,524 ms
ジャッジサーバーID
(参考情報)
judge12 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 187 ms
71,484 KB
testcase_01 AC 226 ms
76,040 KB
testcase_02 AC 365 ms
82,496 KB
testcase_03 AC 219 ms
76,412 KB
testcase_04 AC 296 ms
83,180 KB
testcase_05 AC 224 ms
76,472 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.ArrayList;
import java.util.List;
import java.util.Scanner;

public class Main {

	public static Scanner sc = new Scanner(System.in);

	public static void main(String[] args) {
		new Main().solve();
	}

	public void solve() {
		List<String> candidate = new ArrayList<String>();
		for (int j = 0; j < 1000; j++) {
			candidate.add(String.format("%3d", j).replace(" ", "0"));
		}
		for (String c : candidate) {
			send(c);
			String input = get();
			if (input.equals("unlocked")) {
				break;
			}
		}

	}

	protected void send(String s) {
		System.out.println(s);
		System.out.flush();

	}

	protected String get() {
		return sc.nextLine();
	}

}
0