結果
| 問題 |
No.305 鍵(2)
|
| コンテスト | |
| ユーザー |
ldsyb
|
| 提出日時 | 2016-05-05 17:12:37 |
| 言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 483 bytes |
| コンパイル時間 | 679 ms |
| コンパイル使用メモリ | 66,204 KB |
| 実行使用メモリ | 25,604 KB |
| 平均クエリ数 | 53.46 |
| 最終ジャッジ日時 | 2024-07-16 10:05:38 |
| 合計ジャッジ時間 | 3,593 ms |
|
ジャッジサーバーID (参考情報) |
judge1 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 2 WA * 11 |
コンパイルメッセージ
main.cpp: In function 'int main()':
main.cpp:18:31: warning: 'keep' may be used uninitialized [-Wmaybe-uninitialized]
18 | }else if(x < keep){
| ^~
main.cpp:7:33: note: 'keep' was declared here
7 | for(int i = 0,x,keep;i < 10;i++){
| ^~~~
ソースコード
#include <iostream>
using namespace std;
int main(){
string ans = "",gomi;
for(int digit = 0;digit < 10;digit++){
for(int i = 0,x,keep;i < 10;i++){
for(int j = 0;j < digit;j++) cout << '0';
cout << i;
for(int j = digit + 1;j < 10;j++) cout << '0';
cout << endl;
cin >> x >> gomi;
if(x == 10) return 0;
if(i == 0) keep = x;
else if(x > keep){
ans += i;
break;
}else if(x < keep){
ans += i - 1;
break;
}
}
}
cout << ans << endl;
}
ldsyb