結果

問題 No.819 Enjapma game
ユーザー to10to10to10toto10to10to10to
提出日時 2019-04-19 22:46:50
言語 C++14
(gcc 13.2.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 1,076 bytes
コンパイル時間 3,214 ms
コンパイル使用メモリ 167,508 KB
実行使用メモリ 4,372 KB
最終ジャッジ日時 2023-10-24 06:18:21
合計ジャッジ時間 4,792 ms
ジャッジサーバーID
(参考情報)
judge12 / judge11
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
4,348 KB
testcase_01 AC 2 ms
4,348 KB
testcase_02 AC 2 ms
4,348 KB
testcase_03 AC 2 ms
4,348 KB
testcase_04 WA -
testcase_05 AC 2 ms
4,348 KB
testcase_06 WA -
testcase_07 AC 2 ms
4,348 KB
testcase_08 WA -
testcase_09 WA -
testcase_10 AC 2 ms
4,348 KB
testcase_11 WA -
testcase_12 WA -
testcase_13 AC 27 ms
4,348 KB
testcase_14 WA -
testcase_15 AC 29 ms
4,348 KB
testcase_16 AC 33 ms
4,348 KB
testcase_17 WA -
testcase_18 AC 26 ms
4,348 KB
testcase_19 AC 27 ms
4,348 KB
testcase_20 WA -
testcase_21 AC 34 ms
4,348 KB
testcase_22 WA -
testcase_23 WA -
testcase_24 AC 31 ms
4,348 KB
testcase_25 AC 25 ms
4,348 KB
testcase_26 WA -
testcase_27 AC 23 ms
4,348 KB
testcase_28 AC 29 ms
4,348 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#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;
  }
}
0