結果

問題 No.923 オセロきりきざむたん
コンテスト
ユーザー lumc_
提出日時 2019-09-26 20:09:26
言語 Python3
(3.14.7 + numpy 2.5.2 + scipy 1.18.0 + ACL)
コンパイル:
python3 -mpy_compile _filename_
実行:
python3 _filename_
結果
AC  
実行時間 266 ms / 2,000 ms
+ 255µs
コード長 400 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 297 ms
コンパイル使用メモリ 21,284 KB
実行使用メモリ 25,212 KB
最終ジャッジ日時 2026-08-27 16:17:53
合計ジャッジ時間 13,981 ms
ジャッジサーバーID
(参考情報)
judge2_0 / judge3_1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 4
other AC * 84
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

h, w = map(int, input().split())
f = [[int(c) for c in input()] for _ in range(h)]

yes = 2

for i in range(h):
    same = True
    for j in range(w):
        same = same and f[i][j] == f[i][0]
    if same and yes == 2: yes = 1

for j in range(w):
    same = True
    for i in range(h):
        same = same and f[i][j] == f[0][j]
    if same and yes == 1: yes = 0

print("YES" if yes > 0 else "NO")

0