結果
| 問題 |
No.819 Enjapma game
|
| コンテスト | |
| ユーザー |
to10to10to10to
|
| 提出日時 | 2019-04-19 22:46:50 |
| 言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 1,076 bytes |
| コンパイル時間 | 1,727 ms |
| コンパイル使用メモリ | 168,960 KB |
| 実行使用メモリ | 6,948 KB |
| 最終ジャッジ日時 | 2024-09-22 23:07:36 |
| 合計ジャッジ時間 | 2,985 ms |
|
ジャッジサーバーID (参考情報) |
judge4 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 14 WA * 12 |
ソースコード
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define reps(i,a,b) for(int i=(a);i<(b);++i)
#define rep(i,n) reps(i,0,n)
#define all(x) (x).begin(),(x).end()
#define INF (1000000000)
#define MOD (1000000007)
#define PI (acos(-1))
int main(){
int H,W;
cin >> H >> W;
char c[H][W];
int num=0;
rep(i,H){
rep(j,W){
cin >> c[i][j];
if(c[i][j] == 'o')num++;
}
}
int cnt=0;
rep(k,400){
rep(i,H){
rep(j,W){
if(c[i][j]=='o'){
if(i != H-1){
if(c[i+1][j] == '-'){
c[i][j] = '-';
c[i+1][j] = 'o';
cnt++;
continue;
}
}
if(j!=0){
if(c[i][j-1] == '-'){
c[i][j] = '-';
c[i][j-1] = 'o';
cnt++;
continue;
}
}
}
}
}
}
/*rep(i,H){
rep(j,W){
cout << c[i][j];
}
cout << endl;
}*/
if((num+cnt)%2==0){
cout << "YES" << endl;
}else{
cout << "NO" << endl;
}
}
to10to10to10to