結果

問題 No.305 鍵(2)
ユーザー kurenai3110
提出日時 2016-05-31 21:36:49
言語 C++11(廃止可能性あり)
(gcc 13.3.0)
結果
AC  
実行時間 23 ms / 2,000 ms
コード長 648 bytes
コンパイル時間 728 ms
コンパイル使用メモリ 69,168 KB
実行使用メモリ 25,220 KB
平均クエリ数 44.46
最終ジャッジ日時 2024-07-16 23:52:40
合計ジャッジ時間 1,927 ms
ジャッジサーバーID
(参考情報)
judge5 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 13
権限があれば一括ダウンロードができます

ソースコード

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