結果
問題 |
No.1668 Grayscale
|
ユーザー |
![]() |
提出日時 | 2021-08-31 00:44:48 |
言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
結果 |
TLE
|
実行時間 | - |
コード長 | 675 bytes |
コンパイル時間 | 649 ms |
コンパイル使用メモリ | 12,672 KB |
実行使用メモリ | 237,856 KB |
最終ジャッジ日時 | 2024-12-15 09:00:19 |
合計ジャッジ時間 | 23,300 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 2 |
other | AC * 20 TLE * 2 |
ソースコード
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)