結果

問題 No.1949 足し算するだけのパズルゲーム(2)
ユーザー tailstails
提出日時 2022-08-09 18:41:47
言語 cLay
(20240104-1)
結果
AC  
実行時間 66 ms / 3,000 ms
コード長 338 bytes
コンパイル時間 3,709 ms
コンパイル使用メモリ 176,332 KB
実行使用メモリ 14,320 KB
最終ジャッジ日時 2023-10-20 03:41:18
合計ジャッジ時間 6,425 ms
ジャッジサーバーID
(参考情報)
judge12 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
7,768 KB
testcase_01 AC 2 ms
7,768 KB
testcase_02 AC 3 ms
7,768 KB
testcase_03 AC 3 ms
7,772 KB
testcase_04 AC 2 ms
7,768 KB
testcase_05 AC 2 ms
7,768 KB
testcase_06 AC 2 ms
7,768 KB
testcase_07 AC 31 ms
13,776 KB
testcase_08 AC 12 ms
11,888 KB
testcase_09 AC 12 ms
11,884 KB
testcase_10 AC 12 ms
11,892 KB
testcase_11 AC 13 ms
13,392 KB
testcase_12 AC 12 ms
13,868 KB
testcase_13 AC 16 ms
13,588 KB
testcase_14 AC 21 ms
14,320 KB
testcase_15 AC 21 ms
14,320 KB
testcase_16 AC 8 ms
11,580 KB
testcase_17 AC 66 ms
13,844 KB
testcase_18 AC 7 ms
11,580 KB
testcase_19 AC 2 ms
7,772 KB
testcase_20 AC 2 ms
7,772 KB
testcase_21 AC 3 ms
7,772 KB
testcase_22 AC 36 ms
13,528 KB
testcase_23 AC 2 ms
7,772 KB
testcase_24 AC 12 ms
13,500 KB
testcase_25 AC 13 ms
13,824 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

ll@h,@w,@y--,@x--,@a[h*w],b=0;
DijkstraHeap<ll>q;
q.malloc(h*w,1);
q.change(y*w+x,0);

while(q.size&&b<=1000000000){
	ll t=q.pop();
	if(b&&a[t]>=b){
		wt("No");
		exit(0);
	}
	b+=a[t];
	if(t/w    ) q.change(t-w,a[t-w]);
	if(t/w<h-1) q.change(t+w,a[t+w]);
	if(t%w    ) q.change(t-1,a[t-1]);
	if(t%w<w-1) q.change(t+1,a[t+1]);
}
wt("Yes");
0