結果

問題 No.179 塗り分け
ユーザー maspymaspy
提出日時 2020-02-02 13:32:58
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 657 bytes
コンパイル時間 313 ms
コンパイル使用メモリ 81,708 KB
実行使用メモリ 110,480 KB
最終ジャッジ日時 2023-10-19 00:44:17
合計ジャッジ時間 24,358 ms
ジャッジサーバーID
(参考情報)
judge14 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 66 ms
74,948 KB
testcase_01 AC 319 ms
79,208 KB
testcase_02 WA -
testcase_03 AC 279 ms
80,316 KB
testcase_04 AC 86 ms
75,512 KB
testcase_05 AC 521 ms
86,452 KB
testcase_06 AC 70 ms
75,372 KB
testcase_07 WA -
testcase_08 WA -
testcase_09 WA -
testcase_10 AC 48 ms
61,692 KB
testcase_11 AC 47 ms
61,692 KB
testcase_12 AC 978 ms
106,872 KB
testcase_13 WA -
testcase_14 AC 272 ms
77,064 KB
testcase_15 AC 258 ms
79,640 KB
testcase_16 AC 45 ms
59,388 KB
testcase_17 WA -
testcase_18 AC 90 ms
75,768 KB
testcase_19 AC 89 ms
75,748 KB
testcase_20 AC 983 ms
107,316 KB
testcase_21 AC 1,082 ms
108,040 KB
testcase_22 AC 1,085 ms
109,132 KB
testcase_23 AC 67 ms
75,284 KB
testcase_24 AC 1,012 ms
107,000 KB
testcase_25 WA -
testcase_26 AC 452 ms
86,760 KB
testcase_27 AC 1,015 ms
107,824 KB
testcase_28 WA -
testcase_29 AC 1,004 ms
108,124 KB
testcase_30 AC 296 ms
82,360 KB
testcase_31 AC 1,017 ms
108,416 KB
testcase_32 AC 444 ms
87,248 KB
testcase_33 AC 1,011 ms
105,148 KB
testcase_34 AC 91 ms
75,804 KB
testcase_35 AC 1,004 ms
106,488 KB
testcase_36 AC 262 ms
79,500 KB
testcase_37 AC 287 ms
80,432 KB
testcase_38 AC 288 ms
80,120 KB
testcase_39 AC 266 ms
78,064 KB
testcase_40 AC 294 ms
80,088 KB
testcase_41 AC 481 ms
81,896 KB
testcase_42 AC 470 ms
82,312 KB
testcase_43 AC 381 ms
82,740 KB
testcase_44 AC 525 ms
86,592 KB
testcase_45 AC 331 ms
81,224 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines

from math import gcd
import itertools

H,W = map(int,readline().split())
data = ''.join(read().decode().split())

def test(a,b):
    # ax + by = const 上をまとめる
    words = [[] for _ in range(5000)]
    for x,y in itertools.product(range(H), range(W)):
        key = a * x + b * y
        words[key].append(data[W*x+y])
    for w in words:
        if ''.join(w).replace('##','').count('#'):
            return False
    return True

answer = 'YES' if any(test(a,b) for a in range(50) for b in range(-50,50)) else 'NO'
print(answer)
0