結果

問題 No.819 Enjapma game
ユーザー a
提出日時 2019-04-19 23:20:19
言語 C++14
(gcc 13.3.0 + boost 1.87.0)
結果
WA  
実行時間 -
コード長 490 bytes
コンパイル時間 1,540 ms
コンパイル使用メモリ 170,412 KB
実行使用メモリ 6,948 KB
最終ジャッジ日時 2024-09-23 05:05:57
合計ジャッジ時間 2,431 ms
ジャッジサーバーID
(参考情報)
judge1 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 15 WA * 11
権限があれば一括ダウンロードができます

ソースコード

diff #

#include "bits/stdc++.h"

using namespace std;

void solve()
{
	int h, w;
	cin >> h >> w;
	vector<string> g(h);
	for (auto &l : g) cin >> l;
	reverse(g.begin(), g.end());
	int oc = 0, ec = 0;
	for (int i = 0; i < h; i++)
	{
		for (int j = 0; j < w; j++)
		{
			if (g[i][j] == 'o')
			{
				((i + j + 1) % 2 ? oc : ec) += 1;
			}
		}
	}
	cout << (((oc + ec) % 2 == 0 && (oc - ec) % 2 == 0) ? "YES" : "NO") << endl;
}

int main()
{
	solve();
	//cout << "yui(*-v・)yui" << endl;
	return 0;
}
0