結果
| 問題 |
No.305 鍵(2)
|
| コンテスト | |
| ユーザー |
tetsuzuki1115
|
| 提出日時 | 2018-02-23 20:31:59 |
| 言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 799 bytes |
| コンパイル時間 | 931 ms |
| コンパイル使用メモリ | 84,040 KB |
| 実行使用メモリ | 25,604 KB |
| 平均クエリ数 | 92.38 |
| 最終ジャッジ日時 | 2024-07-16 15:35:03 |
| 合計ジャッジ時間 | 4,342 ms |
|
ジャッジサーバーID (参考情報) |
judge1 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 1 WA * 12 |
コンパイルメッセージ
main.cpp: In function 'int main()':
main.cpp:37:22: warning: 'a' may be used uninitialized [-Wmaybe-uninitialized]
37 | ans[i] = '0' + a;
| ~~~~^~~
main.cpp:23:13: note: 'a' was declared here
23 | int a;
| ^
ソースコード
#include <iostream>
#include <vector>
#include <string>
#include <cstring>
#include <math.h>
#include <cmath>
#include <limits.h>
#include <map>
#include <set>
#include <queue>
#include <algorithm>
#include <functional>
#include <stdio.h>
using namespace std;
long long MOD = 1000000007;
int main() {
string ans = "0000000000";
for ( int i = 0; i < 10; i++) {
int xm = INT_MAX;
int a;
for ( int j = 0; j < 10; j++) {
ans[i] = '0' + j;
cout << ans << endl;
int x;
cin >> x;
string s;
cin >> s;
if ( s == "unlocked" ) { return 0; }
if ( xm > x ) {
xm = x;
a = j;
}
}
ans[i] = '0' + a;
}
return 0;
}
tetsuzuki1115