結果
| 問題 | No.486 3 Straight Win(3連勝) |
| コンテスト | |
| ユーザー |
Eclair1015
|
| 提出日時 | 2018-05-25 20:55:01 |
| 言語 | C++14 (gcc 13.3.0 + boost 1.89.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 337 bytes |
| 記録 | |
| コンパイル時間 | 558 ms |
| コンパイル使用メモリ | 65,648 KB |
| 実行使用メモリ | 6,948 KB |
| 最終ジャッジ日時 | 2024-06-28 18:05:23 |
| 合計ジャッジ時間 | 1,298 ms |
|
ジャッジサーバーID (参考情報) |
judge5 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 8 WA * 20 |
コンパイルメッセージ
main.cpp: In function 'int main()':
main.cpp:12:29: warning: 'east' may be used uninitialized [-Wmaybe-uninitialized]
12 | east++;
| ~~~~^~
main.cpp:6:18: note: 'east' was declared here
6 | int west,east;
| ^~~~
main.cpp:14:29: warning: 'west' may be used uninitialized [-Wmaybe-uninitialized]
14 | west++;
| ~~~~^~
main.cpp:6:13: note: 'west' was declared here
6 | int west,east;
| ^~~~
ソースコード
#include<iostream>
#include<string.h>
using namespace std;
int main(){
char c[101];
int west,east;
cin>>c;
for(int i=0;i<strlen(c);i++){
if(c[i]=='O'){
east++;
}else if(c[i]=='X'){
west++;
}
if(east==3){
cout<<"East"<<endl;
break;
}else if(west==3){
cout<<"West"<<endl;
break;
}
}
return 0;
}
Eclair1015