結果
| 問題 | No.305 鍵(2) |
| コンテスト | |
| ユーザー |
cormoran
|
| 提出日時 | 2016-05-31 18:17:34 |
| 言語 | C++11 (gcc 15.2.0 + boost 1.89.0) |
| 結果 |
AC
|
| 実行時間 | 18 ms / 2,000 ms |
| コード長 | 597 bytes |
| 記録 | |
| コンパイル時間 | 370 ms |
| コンパイル使用メモリ | 87,212 KB |
| 実行使用メモリ | 28,720 KB |
| 平均クエリ数 | 86.69 |
| 最終ジャッジ日時 | 2026-03-31 14:13:20 |
| 合計ジャッジ時間 | 1,449 ms |
|
ジャッジサーバーID (参考情報) |
judge3_1 / judge1_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 13 |
コンパイルメッセージ
main.cpp: In function 'int main()':
main.cpp:28:14: warning: 'ok' may be used uninitialized [-Wmaybe-uninitialized]
28 | n[i] = ok;
main.cpp:21:21: note: 'ok' was declared here
21 | int mx = 0, ok;
| ^~
ソースコード
#include <iostream>
#include <vector>
#include <string>
#include <iomanip>
using namespace std;
int push(vector<int> &n) {
for(int i : n) cout << i;
cout << endl;
cout.flush();
int x;
string s;
cin >> x >> s;
return x;
}
int main() {
vector<int> n(10);
for(int i = 0; i < 10; i++) {
int mx = 0, ok;
for(int j = 0; j < 10; j++) {
n[i] = j;
int ret = push(n);
if(ret == 10) return 0;
if(ret >= mx) mx = ret, ok = j;
}
n[i] = ok;
}
push(n);
return 0;
}
cormoran