結果

問題 No.305 鍵(2)
ユーザー uafr_csuafr_cs
提出日時 2015-11-27 22:50:07
言語 Java21
(openjdk 21)
結果
WA  
実行時間 -
コード長 744 bytes
コンパイル時間 2,319 ms
コンパイル使用メモリ 72,436 KB
実行使用メモリ 72,324 KB
平均クエリ数 67.69
最終ジャッジ日時 2023-09-23 06:44:36
合計ジャッジ時間 6,583 ms
ジャッジサーバーID
(参考情報)
judge12 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 188 ms
72,268 KB
testcase_01 WA -
testcase_02 WA -
testcase_03 AC 164 ms
72,060 KB
testcase_04 WA -
testcase_05 AC 188 ms
71,404 KB
testcase_06 AC 147 ms
71,352 KB
testcase_07 AC 176 ms
72,048 KB
testcase_08 AC 169 ms
71,976 KB
testcase_09 WA -
testcase_10 AC 165 ms
72,324 KB
testcase_11 AC 168 ms
72,256 KB
testcase_12 AC 179 ms
72,064 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];
		
		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(ret_value <= prev){
				numbers[i]++;
				numbers[i] %= 10;
				i--;
			}
			prev = ret_value;
		}
	}

}
0