結果

問題 No.305 鍵(2)
ユーザー kongarishisyamokongarishisyamo
提出日時 2016-02-24 01:26:01
言語 C++11
(gcc 11.4.0)
結果
AC  
実行時間 74 ms / 2,000 ms
コード長 496 bytes
コンパイル時間 296 ms
コンパイル使用メモリ 52,464 KB
実行使用メモリ 24,276 KB
平均クエリ数 466.08
最終ジャッジ日時 2023-09-23 23:12:02
合計ジャッジ時間 1,783 ms
ジャッジサーバーID
(参考情報)
judge14 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 32 ms
23,544 KB
testcase_01 AC 32 ms
24,276 KB
testcase_02 AC 27 ms
23,400 KB
testcase_03 AC 35 ms
23,544 KB
testcase_04 AC 37 ms
23,988 KB
testcase_05 AC 42 ms
23,436 KB
testcase_06 AC 24 ms
23,388 KB
testcase_07 AC 32 ms
23,364 KB
testcase_08 AC 24 ms
23,844 KB
testcase_09 AC 36 ms
23,412 KB
testcase_10 AC 40 ms
23,976 KB
testcase_11 AC 74 ms
23,364 KB
testcase_12 AC 38 ms
23,376 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include<iostream>
#include<string>
#include<cstdlib>

using namespace std;

int main(){

	srand(1);

	bool no[10][10];
	string ins;
	int ini;

	for(int i=0;i<10;i++){
		for(int j=0;j<10;j++){
			no[i][j]=false;
		}
	}

	while(1){
		int r[10];
		for(int i=0;i<10;i++){
			while(1){
				r[i]=rand()%10;
				if(no[i][r[i]]==false) break;
			}
			cout<<r[i];
		}
		cout<<endl<<flush;

		cin>>ini>>ins;
		if(ini==10) break;
		if(ini==0){
			for(int i=0;i<10;i++){
				no[i][r[i]]=true;
			}
		}
	}

}
0