結果

問題 No.305 鍵(2)
ユーザー ぴろずぴろず
提出日時 2015-11-27 22:38:26
言語 Java21
(openjdk 21)
結果
AC  
実行時間 188 ms / 2,000 ms
コード長 574 bytes
コンパイル時間 2,329 ms
コンパイル使用メモリ 72,480 KB
実行使用メモリ 72,372 KB
平均クエリ数 86.69
最終ジャッジ日時 2023-09-23 20:55:40
合計ジャッジ時間 5,414 ms
ジャッジサーバーID
(参考情報)
judge12 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 188 ms
71,788 KB
testcase_01 AC 178 ms
72,372 KB
testcase_02 AC 187 ms
69,648 KB
testcase_03 AC 184 ms
71,884 KB
testcase_04 AC 179 ms
71,892 KB
testcase_05 AC 186 ms
72,204 KB
testcase_06 AC 146 ms
70,088 KB
testcase_07 AC 182 ms
72,000 KB
testcase_08 AC 178 ms
71,696 KB
testcase_09 AC 177 ms
72,240 KB
testcase_10 AC 179 ms
71,944 KB
testcase_11 AC 186 ms
72,304 KB
testcase_12 AC 179 ms
71,524 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

package no304;

import java.util.Arrays;
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		char[] s = new char[10];
		Arrays.fill(s, '0');
		for(int i=0;i<10;i++) {
			int max = -1;
			int maxj = 0;
			for(int j=0;j<10;j++) {
				s[i] = (char) ('0' + j);
				System.out.println(String.valueOf(s));
				int match = sc.nextInt();
				sc.next();
				if (match > max) {
					max = match;
					maxj = j;
				}
				if (match == 10) {
					return;
				}
			}
			s[i] = (char) ('0' + maxj);
		}
	}

}
0