結果

問題 No.305 鍵(2)
ユーザー LatteIceLatteIce
提出日時 2015-11-27 23:12:19
言語 C++11
(gcc 11.4.0)
結果
TLE  
(最新)
AC  
(最初)
実行時間 -
コード長 718 bytes
コンパイル時間 455 ms
コンパイル使用メモリ 63,804 KB
実行使用メモリ 76,084 KB
平均クエリ数 9.38
最終ジャッジ日時 2023-09-23 22:03:48
合計ジャッジ時間 4,309 ms
ジャッジサーバーID
(参考情報)
judge15 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 25 ms
23,844 KB
testcase_01 AC 24 ms
23,832 KB
testcase_02 AC 21 ms
24,012 KB
testcase_03 AC 24 ms
24,024 KB
testcase_04 TLE -
testcase_05 -- -
testcase_06 -- -
testcase_07 -- -
testcase_08 -- -
testcase_09 -- -
testcase_10 -- -
testcase_11 -- -
testcase_12 -- -
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <math.h>
using namespace std;
typedef unsigned int uint;
typedef unsigned long ulong;

int main() {
	int count = 0;
	int number[10] = { 0 };
	int answer = 0;
	int targetmask = 1;
	int responce1 = 0;
	string responce2;
	int lastnumber = 0;

	while(true) {
		printf("%010d\n", answer);
		cin >> responce1 >> responce2;
		if (responce2 == "unlocked") {
			return 0;
		}
		else {
			if (responce1 < lastnumber) {
				answer -= targetmask;
				targetmask *= 10;
				lastnumber = responce1 + 1;
			} else if (responce1 > lastnumber) {
				lastnumber = responce1;
			}
			else {
				// :(
			}
			answer += targetmask;
		}
	}

	return 0;
}
0