結果

問題 No.305 鍵(2)
ユーザー uafr_csuafr_cs
提出日時 2015-11-27 22:52:44
言語 Java21
(openjdk 21)
結果
AC  
実行時間 178 ms / 2,000 ms
コード長 800 bytes
コンパイル時間 2,298 ms
コンパイル使用メモリ 71,848 KB
実行使用メモリ 72,120 KB
平均クエリ数 67.38
最終ジャッジ日時 2023-09-23 22:01:47
合計ジャッジ時間 5,590 ms
ジャッジサーバーID
(参考情報)
judge14 / judge15
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 171 ms
69,524 KB
testcase_01 AC 163 ms
72,028 KB
testcase_02 AC 166 ms
71,448 KB
testcase_03 AC 158 ms
71,600 KB
testcase_04 AC 161 ms
71,108 KB
testcase_05 AC 177 ms
71,768 KB
testcase_06 AC 138 ms
71,772 KB
testcase_07 AC 178 ms
71,708 KB
testcase_08 AC 163 ms
71,964 KB
testcase_09 AC 161 ms
72,040 KB
testcase_10 AC 161 ms
71,708 KB
testcase_11 AC 175 ms
72,120 KB
testcase_12 AC 167 ms
71,908 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Arrays;
import java.util.HashSet;
import java.util.LinkedList;
import java.util.Scanner;
import java.util.Set;

public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		final int size = 10;
		
		int[] numbers = new int[size];
		
		boolean inited = false;
		int prev = 0;
		for(int i = 0; i < size; i++){
			
			StringBuilder sb = new StringBuilder();
			for(int j = 0; j < size; j++){
				sb.append(numbers[j]);
			}
			System.out.println(sb.toString());
			
			final int ret_value  = sc.nextInt();
			final String ret_str = sc.next();
			
			if(ret_str.equals("unlocked")){
				return;
			}
			
			if(!inited || ret_value <= prev){
				numbers[i]++;
				numbers[i] %= 10;
				i--;
				inited = true;
			}
			prev = ret_value;
		}
	}

}
0