結果

問題 No.304 鍵(1)
ユーザー GrenacheGrenache
提出日時 2015-11-27 22:33:25
言語 Java19
(openjdk 21)
結果
AC  
実行時間 336 ms / 2,000 ms
コード長 1,657 bytes
コンパイル時間 4,677 ms
コンパイル使用メモリ 75,928 KB
実行使用メモリ 74,440 KB
平均クエリ数 309.17
最終ジャッジ日時 2023-09-23 20:51:07
合計ジャッジ時間 6,820 ms
ジャッジサーバーID
(参考情報)
judge14 / judge12
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 150 ms
71,488 KB
testcase_01 AC 174 ms
72,016 KB
testcase_02 AC 336 ms
74,440 KB
testcase_03 AC 169 ms
72,216 KB
testcase_04 AC 261 ms
72,608 KB
testcase_05 AC 172 ms
71,680 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.PrintStream;
import java.io.PrintWriter;
import java.util.Arrays;
import java.util.Iterator;


public class Main_yukicoder304 {

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        Printer pr = new Printer(System.out);

        for (int i = 0; i < 1000; i++) {
        	pr.printf("%03d\n", i);
        	pr.flush();

        	if (sc.next().equals("unlocked")) {
        		break;
        	}
        }

        pr.close();
        sc.close();
    }

	@SuppressWarnings("unused")
	private static class Scanner {
		BufferedReader br;
		Iterator<String> it;

		Scanner (InputStream in) {
			br = new BufferedReader(new InputStreamReader(in));
		}

		String next() throws RuntimeException  {
			try {
				if (it == null || !it.hasNext()) {
					it = Arrays.asList(br.readLine().split(" ")).iterator();
				}
				return it.next();
			} catch (IOException e) {
				throw new IllegalStateException();
			}
		}

		int nextInt() throws RuntimeException {
			return Integer.parseInt(next());
		}

		long nextLong() throws RuntimeException {
			return Long.parseLong(next());
		}

		float nextFloat() throws RuntimeException {
			return Float.parseFloat(next());
		}

		double nextDouble() throws RuntimeException {
			return Double.parseDouble(next());
		}

		void close() {
			try {
				br.close();
			} catch (IOException e) {
//				throw new IllegalStateException();
			}
		}
	}

	private static class Printer extends PrintWriter {
		Printer(PrintStream out) {
			super(out);
		}
	}
}
0