結果

問題 No.304 鍵(1)
ユーザー kuuso1kuuso1
提出日時 2015-11-27 23:00:33
言語 C#(csc)
(csc 3.9.0)
結果
AC  
実行時間 126 ms / 2,000 ms
コード長 1,635 bytes
コンパイル時間 4,865 ms
コンパイル使用メモリ 108,816 KB
実行使用メモリ 40,216 KB
平均クエリ数 447.50
最終ジャッジ日時 2023-09-23 22:02:51
合計ジャッジ時間 5,683 ms
ジャッジサーバーID
(参考情報)
judge12 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 126 ms
38,660 KB
testcase_01 AC 93 ms
38,412 KB
testcase_02 AC 112 ms
38,060 KB
testcase_03 AC 114 ms
38,424 KB
testcase_04 AC 102 ms
40,216 KB
testcase_05 AC 90 ms
38,104 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Microsoft (R) Visual C# Compiler version 3.9.0-6.21124.20 (db94f4cc)
Copyright (C) Microsoft Corporation. All rights reserved.

ソースコード

diff #

using System;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
using System.Text;

class TEST{
	static void Main(){
		Sol mySol =new Sol();
		mySol.Solve();
	}
}

class Sol{
	public void Solve(){
		var rnd=new Xor128();
		HashSet<int> H=new HashSet<int>();
		while(H.Count<1000){
			
			int a=0;
			while(true){
				a=rnd.Next(1000);
				if(H.Contains(a))continue;
				break;
			}
			Console.WriteLine("{0:D3}",a);
			H.Add(a);
			var s=rs();
			if(s=="unlocked")return;
		}
	}

	public Sol(){
	}




	static String rs(){return Console.ReadLine();}
	static int ri(){return int.Parse(Console.ReadLine());}
	static long rl(){return long.Parse(Console.ReadLine());}
	static double rd(){return double.Parse(Console.ReadLine());}
	static String[] rsa(){return Console.ReadLine().Split(' ');}
	static int[] ria(){return Array.ConvertAll(Console.ReadLine().Split(' '),e=>int.Parse(e));}
	static long[] rla(){return Array.ConvertAll(Console.ReadLine().Split(' '),e=>long.Parse(e));}
	static double[] rda(){return Array.ConvertAll(Console.ReadLine().Split(' '),e=>double.Parse(e));}
}

class Xor128{
	static uint x = 123456789;
	static uint y = 362436069;
	static uint z = 521288629;
	static uint w = 88675123; 
	uint t;
	
	public Xor128(){
	}
	
	public Xor128(uint seed){
		z ^= seed;
		z ^= z >> 21; z ^= z << 35; z ^= z >> 4;
	}
	
	
	public uint Next(){
		t = x ^ (x << 11);
		x = y; y = z; z = w;
		return w = (w ^ (w >> 19)) ^ (t ^ (t >> 8));
	}
	public int Next(int ul){
		return NextI(0,ul-1);
	}
	public int NextI(int from,int to){
		int mod=to-from+1;
		int ret=(int)(Next()%mod);
		return ret+from;
	}
}
0