結果
問題 |
No.305 鍵(2)
|
ユーザー |
![]() |
提出日時 | 2016-08-12 00:17:23 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 586 bytes |
コンパイル時間 | 600 ms |
コンパイル使用メモリ | 78,420 KB |
実行使用メモリ | 25,604 KB |
平均クエリ数 | 102.00 |
最終ジャッジ日時 | 2024-07-16 10:51:25 |
合計ジャッジ時間 | 3,909 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | WA * 13 |
コンパイルメッセージ
main.cpp: In function 'int main()': main.cpp:34:30: warning: 'maxj' may be used uninitialized [-Wmaybe-uninitialized] 34 | ans[i] = '0' + maxj; | ~~~~^~~~~~ main.cpp:22:22: note: 'maxj' was declared here 22 | int maxj, maxn = -1; | ^~~~
ソースコード
#include <iostream> #include <fstream> #include <vector> #include <cstring> #include <string> #include <algorithm> #include <iomanip> using namespace std; int main() { cin.tie(0); ios::sync_with_stdio(false); string ans = "0000000000", res; int n; cout << ans << endl; cout.flush(); cin >> n >> res; for(int i = 0; i < 10; i++) { int maxj, maxn = -1; for(int j = 0; j < 10; j++) { ans[i] = '0' + j; cout << ans << endl; cout.flush(); cin >> n >> res; if(maxn < n) { maxj = j; maxn = n; } } ans[i] = '0' + maxj; } cout << ans << endl; }