結果
問題 | No.305 鍵(2) |
ユーザー |
![]() |
提出日時 | 2018-02-23 20:33:49 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 31 ms / 2,000 ms |
コード長 | 794 bytes |
コンパイル時間 | 836 ms |
コンパイル使用メモリ | 84,040 KB |
実行使用メモリ | 25,220 KB |
平均クエリ数 | 86.69 |
最終ジャッジ日時 | 2024-07-16 15:35:06 |
合計ジャッジ時間 | 2,306 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 13 |
コンパイルメッセージ
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 = -1;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;}