結果

問題 No.2639 Longest Increasing Walk
ユーザー tailstails
提出日時 2024-02-21 11:21:50
言語 cLay
(20240104-1)
結果
AC  
実行時間 242 ms / 2,000 ms
コード長 253 bytes
コンパイル時間 5,108 ms
コンパイル使用メモリ 182,472 KB
実行使用メモリ 55,236 KB
最終ジャッジ日時 2024-02-21 11:21:58
合計ジャッジ時間 8,274 ms
ジャッジサーバーID
(参考情報)
judge11 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
6,676 KB
testcase_01 AC 2 ms
6,676 KB
testcase_02 AC 2 ms
6,676 KB
testcase_03 AC 2 ms
6,676 KB
testcase_04 AC 135 ms
22,724 KB
testcase_05 AC 242 ms
22,724 KB
testcase_06 AC 141 ms
55,236 KB
testcase_07 AC 171 ms
22,468 KB
testcase_08 AC 148 ms
22,724 KB
testcase_09 AC 183 ms
22,724 KB
testcase_10 AC 87 ms
15,940 KB
testcase_11 AC 77 ms
15,044 KB
testcase_12 AC 13 ms
7,364 KB
testcase_13 AC 93 ms
16,580 KB
testcase_14 AC 54 ms
12,356 KB
testcase_15 AC 2 ms
6,676 KB
testcase_16 AC 3 ms
6,676 KB
testcase_17 AC 53 ms
12,356 KB
testcase_18 AC 64 ms
13,508 KB
testcase_19 AC 18 ms
7,876 KB
testcase_20 AC 38 ms
10,564 KB
testcase_21 AC 77 ms
14,916 KB
testcase_22 AC 28 ms
9,284 KB
testcase_23 AC 2 ms
6,676 KB
testcase_24 AC 2 ms
6,676 KB
testcase_25 AC 2 ms
6,676 KB
testcase_26 AC 2 ms
6,676 KB
testcase_27 AC 3 ms
6,676 KB
testcase_28 AC 2 ms
6,676 KB
testcase_29 AC 3 ms
6,676 KB
testcase_30 AC 2 ms
6,676 KB
testcase_31 AC 2 ms
6,676 KB
testcase_32 AC 2 ms
6,676 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

ll h,w,a[500][500];
ll f(ll y,ll x:Memoize){
	ll b=a[y][x];
	return max(
		y&&a[y-1][x]>b?f(y-1,x):0,
		~y+h&&a[y+1][x]>b?f(y+1,x):0,
		x&&a[y][x-1]>b?f(y,x-1):0,
		~x+w&&a[y][x+1]>b?f(y,x+1):0
	)+1;
}
{
	rd(h,w,a(h,w));
	wt(max[y,0,h,x,0,w](f(y,x)));
}
0