結果

問題 No.819 Enjapma game
ユーザー tomatoma
提出日時 2019-04-19 22:41:35
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 929 bytes
コンパイル時間 1,758 ms
コンパイル使用メモリ 167,748 KB
実行使用メモリ 4,372 KB
最終ジャッジ日時 2023-10-24 05:55:43
合計ジャッジ時間 2,757 ms
ジャッジサーバーID
(参考情報)
judge15 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

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

ソースコード

diff #

#include"bits/stdc++.h"

using namespace std;
using ll = long long;
using ld = long double;
using pii = pair<int, int>;
using pll = pair<ll, ll>;

#define FOR(k,m,n) for(ll (k)=(m);(k)<(n);(k)++)
#define REP(i,n) FOR((i),0,(n))
#define WAITING(str) int str;std::cin>>str;
#define DEBUGING(str) cout<< #str << " " str<<endl

constexpr int INF = (1 << 30);
constexpr ll INFL = (1ll << 60);
constexpr ll MOD = 1000000007;// 10^9+7



int main()
{
	int H, W;
	cin >> H >> W;

	int cnt = 0;
	int all = 0;
	int even = 0;
	REP(i, H) {
		string s;
		cin >> s;
		REP(j, W) if (s[j] == 'o') {
			cnt++;
			int num = (H - 1 - i) + j + 1;
			all += num;
			if (num % 2 == 0)even++;
		}
	}
	//cout << all << " " << even << endl;
	bool res1 = all % 2 == 0
		? even > 0
		: cnt - even > 0;
	bool res2 = (even - (all % 2 == 0 ? 1 : 0)) % 2 == 0;
	cout << res1 << " , " << res2 << endl;
	cout << (res1==res2 ? "NO" : "YES") << endl;
	return 0;
}
0