結果

問題 No.304 鍵(1)
ユーザー Tsukasa_Type
提出日時 2018-02-11 23:22:51
言語 Java
(openjdk 23)
結果
AC  
実行時間 342 ms / 2,000 ms
コード長 485 bytes
コンパイル時間 2,021 ms
コンパイル使用メモリ 76,808 KB
実行使用メモリ 72,544 KB
平均クエリ数 309.17
最終ジャッジ日時 2024-07-17 01:36:01
合計ジャッジ時間 4,107 ms
ジャッジサーバーID
(参考情報)
judge3 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 6
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.*;

public class Main {
	static Scanner sc = new Scanner(System.in);
	public static void main(String[] args) {
		int num = 0;
		String key = "";
		while (true) {
			String s = "";
			if (num <= 9) {
				s += "00";
				s += num;
			}
			else if (10<=num && num<=99) {
				s += "0";
				s += num;
			}
			else {
				s += num;
			}
			System.out.println(s);
			String result = sc.next();
			if (result.equals("unlocked")) {
				key = s;
				break;
			}
			num++;
		}
	}
}
0