結果

問題 No.305 鍵(2)
ユーザー kurenai3110kurenai3110
提出日時 2016-05-31 21:36:49
言語 C++11
(gcc 11.4.0)
結果
AC  
実行時間 29 ms / 2,000 ms
コード長 648 bytes
コンパイル時間 544 ms
コンパイル使用メモリ 67,128 KB
実行使用メモリ 24,384 KB
平均クエリ数 44.46
最終ジャッジ日時 2023-09-24 00:02:12
合計ジャッジ時間 1,852 ms
ジャッジサーバーID
(参考情報)
judge13 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 29 ms
23,820 KB
testcase_01 AC 25 ms
24,312 KB
testcase_02 AC 25 ms
23,508 KB
testcase_03 AC 25 ms
24,024 KB
testcase_04 AC 24 ms
23,388 KB
testcase_05 AC 27 ms
23,820 KB
testcase_06 AC 24 ms
23,988 KB
testcase_07 AC 25 ms
23,796 KB
testcase_08 AC 26 ms
23,808 KB
testcase_09 AC 26 ms
23,508 KB
testcase_10 AC 26 ms
24,384 KB
testcase_11 AC 25 ms
23,352 KB
testcase_12 AC 26 ms
24,372 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>
#include <string>
#include <iomanip>
#include <math.h>
using namespace std;

int main()
{
	string s;
	long int n=0;
	long int atari=0;
	int t,prevt;

	cout << "0000000000" << endl;
	cin >> prevt >> s;
	if(s == "unlocked") return 0;
	n++;

	for(int i=0;i<10;i++){
		n = pow(10,(double)i);
		for(int j=1;j<10;j++){
			cout << setw(10) << setfill('0') << n << endl;

			cin >> t >> s;
			if(s == "unlocked") return 0;

			if(t > prevt){
				atari += j*pow(10,(double)i);
				break;
			}else if(t<prevt) break;
			
			n += pow(10,(double)i);
		}
	}

	cout << setw(10) << setfill('0') << atari << endl;
	cin >> t >> s;

	return 0;
}
0