結果

問題 No.305 鍵(2)
ユーザー ルッツファンルッツファン
提出日時 2015-11-27 23:23:15
言語 Java21
(openjdk 21)
結果
AC  
実行時間 88 ms / 2,000 ms
コード長 1,620 bytes
コンパイル時間 3,427 ms
コンパイル使用メモリ 74,228 KB
実行使用メモリ 65,900 KB
平均クエリ数 44.08
最終ジャッジ日時 2023-09-23 22:04:29
合計ジャッジ時間 5,384 ms
ジャッジサーバーID
(参考情報)
judge12 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 71 ms
65,276 KB
testcase_01 AC 76 ms
65,552 KB
testcase_02 AC 69 ms
65,156 KB
testcase_03 AC 75 ms
65,420 KB
testcase_04 AC 74 ms
65,164 KB
testcase_05 AC 83 ms
65,612 KB
testcase_06 AC 66 ms
64,904 KB
testcase_07 AC 76 ms
65,192 KB
testcase_08 AC 80 ms
65,900 KB
testcase_09 AC 74 ms
65,340 KB
testcase_10 AC 88 ms
65,248 KB
testcase_11 AC 77 ms
65,648 KB
testcase_12 AC 77 ms
63,420 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

package yukicoder;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

public class yukicoder02 {
	public static void main(String[] args){
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		String tes = null;
		char[] peso = {48,48,48,48,48,48,48,48,48,48};
		//sysgoer(peso);
		System.out.println(peso);
		
		try {
			tes = br.readLine();
		} catch (IOException e) {
			// TODO 自動生成された catch ブロック
			e.printStackTrace();
		}
		
		if(tes.equals("10 unlocked")){
			try {
				br.close();
			} catch (IOException e) {
				// TODO 自動生成された catch ブロック
				e.printStackTrace();
			}
			System.exit(0);
		}
		
		String[] tew = tes.split(" ");
		
		int i = 0;
		String tmp = null;
		int hai = 0;
		int kazu =Integer.parseInt(tew[0]);
		int kazu2 = kazu;
		
		while(true){
			peso[hai]++;
			
			
			System.out.println(peso);
			
			try {
				tes = br.readLine();
			} catch (IOException e) {
				// TODO 自動生成された catch ブロック
				e.printStackTrace();
			}
			if(tes.equals("10 unlocked")){
				try {
					br.close();
				} catch (IOException e) {
					// TODO 自動生成された catch ブロック
					e.printStackTrace();
				}
				System.exit(0);
			}
			
			tew = tes.split(" ");
			kazu =Integer.parseInt(tew[0]);
			if(kazu < kazu2){
				peso[hai]--;
				hai++;
			}else if(kazu > kazu2){
				hai++;
				kazu2 = kazu;
			}
			
		}
		
	}
//	public static void sysgoer(char[] peso){
//		for(int i=0;i < 10;i++){
//			System.out.print(peso[i]);
//		}
//		System.out.println();
//		
//	}

}
0