結果
| 問題 |
No.819 Enjapma game
|
| コンテスト | |
| ユーザー |
maspy
|
| 提出日時 | 2020-04-23 22:36:19 |
| 言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
| 結果 |
AC
|
| 実行時間 | 517 ms / 2,000 ms |
| コード長 | 404 bytes |
| コンパイル時間 | 83 ms |
| コンパイル使用メモリ | 12,544 KB |
| 実行使用メモリ | 43,804 KB |
| 最終ジャッジ日時 | 2024-10-14 01:39:16 |
| 合計ジャッジ時間 | 16,526 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 26 |
ソースコード
import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
import numpy as np
H, W = map(int, readline().split())
# 1次元の場合を実験して観察すると解ける
S = np.frombuffer(read(), 'S1').reshape(H, -1)[:, :W]
S = 1 * (S == b'o')
x = S[::2, ::2].sum() + S[1::2, 1::2].sum()
y = S.sum() - x
print('NO' if (x - y) % 3 else 'YES')
maspy