結果

問題 No.2639 Longest Increasing Walk
ユーザー hirayuu_ychirayuu_yc
提出日時 2024-02-19 21:26:19
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 612 bytes
コンパイル時間 132 ms
コンパイル使用メモリ 81,700 KB
実行使用メモリ 118,196 KB
最終ジャッジ日時 2024-02-19 21:26:26
合計ジャッジ時間 6,814 ms
ジャッジサーバーID
(参考情報)
judge16 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 31 ms
53,460 KB
testcase_01 AC 31 ms
53,460 KB
testcase_02 AC 29 ms
53,460 KB
testcase_03 AC 30 ms
53,460 KB
testcase_04 AC 181 ms
116,740 KB
testcase_05 AC 210 ms
117,580 KB
testcase_06 AC 209 ms
117,212 KB
testcase_07 AC 329 ms
117,044 KB
testcase_08 AC 207 ms
117,848 KB
testcase_09 AC 370 ms
118,196 KB
testcase_10 AC 449 ms
97,648 KB
testcase_11 AC 366 ms
99,952 KB
testcase_12 AC 80 ms
73,772 KB
testcase_13 AC 477 ms
102,404 KB
testcase_14 AC 254 ms
92,540 KB
testcase_15 WA -
testcase_16 AC 46 ms
64,576 KB
testcase_17 AC 190 ms
92,656 KB
testcase_18 AC 312 ms
96,380 KB
testcase_19 AC 118 ms
80,412 KB
testcase_20 AC 194 ms
82,696 KB
testcase_21 AC 382 ms
98,160 KB
testcase_22 AC 146 ms
84,340 KB
testcase_23 AC 40 ms
61,848 KB
testcase_24 AC 40 ms
61,844 KB
testcase_25 AC 48 ms
64,580 KB
testcase_26 AC 31 ms
53,460 KB
testcase_27 AC 44 ms
64,592 KB
testcase_28 AC 30 ms
53,460 KB
testcase_29 AC 33 ms
53,460 KB
testcase_30 AC 30 ms
53,460 KB
testcase_31 AC 30 ms
53,460 KB
testcase_32 AC 29 ms
53,460 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
#sys.setrecursionlimit((1<<19)-1)
#import pypyjit
#pypyjit.set_param('max_unroll_recursion=-1')
input=sys.stdin.buffer.readline

H,W=map(int,input().split())
A=[list(map(int,input().split())) for i in range(H)]
p=[]
for i in range(H):
    for j in range(W):
        p.append((A[i][j],i,j))
p.sort()
dp=[[-(1<<60)]*(W) for i in range(H)]
for a,i,j in p:
    dp[i][j]=1
    for dx,dy in [(0,1),(1,0),(0,-1),(-1,0)]:
        try:
            if a>A[i+dx][j+dy]:
                dp[i][j]=max(dp[i][j],dp[i+dx][j+dy]+1)
        except:
            pass
ans=0
for i in dp:
    ans=max(ans,max(i))
print(ans)
0