結果
| 問題 |
No.24 数当てゲーム
|
| コンテスト | |
| ユーザー |
ongakucas
|
| 提出日時 | 2020-01-08 16:17:37 |
| 言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 609 bytes |
| コンパイル時間 | 1,655 ms |
| コンパイル使用メモリ | 166,216 KB |
| 実行使用メモリ | 5,248 KB |
| 最終ジャッジ日時 | 2024-11-23 02:50:44 |
| 合計ジャッジ時間 | 2,097 ms |
|
ジャッジサーバーID (参考情報) |
judge1 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 2 WA * 8 |
コンパイルメッセージ
main.cpp: In function 'int main()':
main.cpp:12:16: warning: 'd' is used uninitialized [-Wuninitialized]
12 | cout << d << endl;
| ^~~~
main.cpp:9:15: note: 'd' declared here
9 | int n,a,b,c,d;
| ^
ソースコード
#include <bits/stdc++.h>
using namespace std;
#define rep(i,n) for(int i=0;i<n;i++)
#define rep1(i,n) for(int i=1;i<=n;i++)
typedef long long ll;
int main(){
int n,a,b,c,d;
string r;
int s[] = {0,1,2,3,4,5,6,7,8,9};
cout << d << endl;
cin >> n;
rep(i,n){
cin >> a >> b >> c >> d >> r;
if(r=="YES"){
rep(j,10){
if(j!=a&&j!=b&&j!=c&&j!=d){
s[j] = -1;
}else{
s[a] = -1;
s[b] = -1;
s[c] = -1;
s[d] = -1;
}
}
}
}
rep(i,10){
if(s[i]!=-1){
cout << s[i] << endl;
return 0;
}
}
}
ongakucas