結果

問題 No.1668 Grayscale
ユーザー rianoriano
提出日時 2021-08-31 00:40:07
言語 PyPy3
(7.3.15)
結果
TLE  
実行時間 -
コード長 636 bytes
コンパイル時間 218 ms
コンパイル使用メモリ 82,688 KB
実行使用メモリ 326,308 KB
最終ジャッジ日時 2024-05-09 00:48:31
合計ジャッジ時間 9,399 ms
ジャッジサーバーID
(参考情報)
judge2 / judge3
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 38 ms
57,728 KB
testcase_01 AC 39 ms
52,480 KB
testcase_02 AC 39 ms
52,096 KB
testcase_03 AC 38 ms
51,968 KB
testcase_04 AC 39 ms
51,840 KB
testcase_05 AC 38 ms
52,096 KB
testcase_06 AC 1,210 ms
321,612 KB
testcase_07 AC 1,254 ms
321,540 KB
testcase_08 AC 139 ms
84,480 KB
testcase_09 TLE -
testcase_10 -- -
testcase_11 -- -
testcase_12 -- -
testcase_13 -- -
testcase_14 -- -
testcase_15 -- -
testcase_16 -- -
testcase_17 -- -
testcase_18 -- -
testcase_19 -- -
testcase_20 -- -
testcase_21 -- -
testcase_22 -- -
testcase_23 -- -
権限があれば一括ダウンロードができます

ソースコード

diff #

H,W,N = map(int, input().split())
ans = 1

c = []
for i in range(H):
    lis = list(map(int, input().split()))
    c.append(lis)

ran = []
for i in range(H):
    for j in range(W-1):
        a = c[i][j]
        b = c[i][j+1]
        if(a!=b):
            if(a<b):
                a,b = b,a
            r = [a,b]
            ran.append(r)

for i in range(H-1):
    for j in range(W):
        a = c[i][j]
        b = c[i+1][j]
        if(a!=b):
            if(a<b):
                a,b = b,a
            r = [a,b]
            ran.append(r)

ran.sort()
mx = 0
for r in ran:
    if(r[1]>=mx):
        mx = r[0]
        ans += 1

print(ans)
0