結果

問題 No.1668 Grayscale
ユーザー rianoriano
提出日時 2021-08-31 00:47:29
言語 PyPy3
(7.3.15)
結果
TLE  
実行時間 -
コード長 675 bytes
コンパイル時間 1,023 ms
コンパイル使用メモリ 82,432 KB
実行使用メモリ 314,580 KB
最終ジャッジ日時 2024-05-09 00:51:23
合計ジャッジ時間 9,335 ms
ジャッジサーバーID
(参考情報)
judge1 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 38 ms
60,088 KB
testcase_01 AC 38 ms
52,480 KB
testcase_02 AC 39 ms
52,480 KB
testcase_03 AC 39 ms
52,352 KB
testcase_04 AC 38 ms
51,840 KB
testcase_05 AC 38 ms
52,224 KB
testcase_06 AC 1,178 ms
314,536 KB
testcase_07 AC 1,276 ms
314,580 KB
testcase_08 AC 127 ms
84,992 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 #

import sys
input = sys.stdin.readline

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