結果
| 問題 |
No.305 鍵(2)
|
| コンテスト | |
| ユーザー |
Konton7
|
| 提出日時 | 2020-01-14 23:15:27 |
| 言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 757 bytes |
| コンパイル時間 | 1,959 ms |
| コンパイル使用メモリ | 193,692 KB |
| 最終ジャッジ日時 | 2025-01-08 18:04:58 |
|
ジャッジサーバーID (参考情報) |
judge5 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 2 WA * 11 |
コンパイルメッセージ
main.cpp: In function ‘int main()’:
main.cpp:28:28: warning: ‘collect_max’ may be used uninitialized [-Wmaybe-uninitialized]
28 | ans += collect_max + '0';
| ~~~~~~~~~~~~^~~~~
main.cpp:9:18: note: ‘collect_max’ was declared here
9 | int collect, collect_max, ret_collect;
| ^~~~~~~~~~~
ソースコード
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
int main(){
int collect, collect_max, ret_collect;
int const digit = 10;
string s, ans, ret_string;
string const s0 = "0000000000";
for (int i = 0; i < digit; i++){
s = s0;
collect = -1;
for (int j = 0; j < digit; j++){
cout << s << endl;
cin >> ret_collect >> ret_string;
if (ret_string == "unlocked")
return 0;
else{
if (ret_collect > collect)
collect_max = ret_collect;
collect = ret_collect;
}
s[i]++;
}
ans += collect_max + '0';
}
cout << ans << endl;
return 0;
}
Konton7