結果

問題 No.305 鍵(2)
ユーザー mdj982mdj982
提出日時 2015-12-31 16:15:00
言語 C++11
(gcc 11.4.0)
結果
AC  
実行時間 34 ms / 2,000 ms
コード長 834 bytes
コンパイル時間 1,113 ms
コンパイル使用メモリ 88,948 KB
実行使用メモリ 24,096 KB
平均クエリ数 86.69
最終ジャッジ日時 2023-09-23 23:03:40
合計ジャッジ時間 2,061 ms
ジャッジサーバーID
(参考情報)
judge15 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 34 ms
23,868 KB
testcase_01 AC 29 ms
24,096 KB
testcase_02 AC 29 ms
23,316 KB
testcase_03 AC 29 ms
23,364 KB
testcase_04 AC 29 ms
23,664 KB
testcase_05 AC 29 ms
23,652 KB
testcase_06 AC 25 ms
23,268 KB
testcase_07 AC 29 ms
23,268 KB
testcase_08 AC 29 ms
23,316 KB
testcase_09 AC 29 ms
24,012 KB
testcase_10 AC 29 ms
23,388 KB
testcase_11 AC 30 ms
23,472 KB
testcase_12 AC 31 ms
24,024 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
main.cpp: In function ‘int main()’:
main.cpp:45:9: warning: ‘c’ may be used uninitialized in this function [-Wmaybe-uninitialized]
    s[a] = c;

ソースコード

diff #

#include <iostream>
#include <algorithm>
#include <vector>
#include <deque>
#include <string>
#include <tuple>
#include <functional>
#include <numeric>
#include <cmath>
#include <iomanip>
#include <map>
#include <random>
//#include "toollib.h"
#define INT_MAX 2147483647
#define Loop(i, n) for(int i = 0; i < (int)n; i++)
#pragma warning (disable:4018)

using namespace std;
typedef long long int lint;

typedef struct {
	int x;
	int y;
}coordinate;

//***** Main Program *****

int main() {
	string s = "0000000000";
	int x;
	string judge;
	int a, b, c;
	a = 0;
	b = -1;
	do {
		cout << s << endl;
		cin >> x >> judge;
		if (judge == "unlocked") break;
		if (x > b) {
			b = x;
			c = s[a];
		}
		if (s[a] < '9') s[a]++;
		else {
			s[a] = c;
			if (a < 9) {
				a++;
				b = -1;
			}
			else break;
		}
	} while (true);
	return 0;
}
0