結果

問題 No.305 鍵(2)
ユーザー zaichuzaichu
提出日時 2015-12-31 01:18:06
言語 C++11
(gcc 11.4.0)
結果
AC  
実行時間 29 ms / 2,000 ms
コード長 437 bytes
コンパイル時間 1,151 ms
コンパイル使用メモリ 143,400 KB
実行使用メモリ 24,348 KB
平均クエリ数 43.54
最終ジャッジ日時 2023-09-23 23:03:37
合計ジャッジ時間 2,635 ms
ジャッジサーバーID
(参考情報)
judge11 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 29 ms
23,268 KB
testcase_01 AC 27 ms
24,012 KB
testcase_02 AC 27 ms
24,024 KB
testcase_03 AC 27 ms
23,472 KB
testcase_04 AC 28 ms
24,348 KB
testcase_05 AC 28 ms
23,664 KB
testcase_06 AC 26 ms
23,220 KB
testcase_07 AC 28 ms
23,496 KB
testcase_08 AC 28 ms
23,820 KB
testcase_09 AC 28 ms
23,856 KB
testcase_10 AC 28 ms
23,508 KB
testcase_11 AC 27 ms
23,844 KB
testcase_12 AC 28 ms
23,880 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;

int main(){
	string str;
	int count = 0;
	int tmp = 0;
	long long int check = 0;
	long long int plus = 1;
	bool flag = true;
	while(count != 10){
		printf("%010lld\n",check);
		cin >> tmp >> str;
		if(flag){
			count = tmp;
			flag = false;
		}
		if(count > tmp){
			check -= plus;
			plus *= 10;
		}else if(count < tmp){
			count = tmp;
			plus *= 10;
		}
		check += plus;
	}
	return 0;
}
0