結果

問題 No.697 池の数はいくつか
ユーザー %20%20
提出日時 2018-06-09 22:43:22
言語 cLay
(20240104-1)
結果
AC  
実行時間 242 ms / 6,000 ms
コード長 196 bytes
コンパイル時間 1,799 ms
コンパイル使用メモリ 174,048 KB
実行使用メモリ 42,588 KB
最終ジャッジ日時 2024-04-25 19:58:53
合計ジャッジ時間 5,083 ms
ジャッジサーバーID
(参考情報)
judge4 / judge3
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
6,816 KB
testcase_01 AC 2 ms
6,944 KB
testcase_02 AC 1 ms
6,944 KB
testcase_03 AC 2 ms
6,940 KB
testcase_04 AC 1 ms
6,940 KB
testcase_05 AC 1 ms
6,940 KB
testcase_06 AC 1 ms
6,940 KB
testcase_07 AC 2 ms
6,944 KB
testcase_08 AC 1 ms
6,940 KB
testcase_09 AC 1 ms
6,940 KB
testcase_10 AC 1 ms
6,940 KB
testcase_11 AC 2 ms
6,944 KB
testcase_12 AC 2 ms
6,944 KB
testcase_13 AC 1 ms
6,940 KB
testcase_14 AC 2 ms
6,944 KB
testcase_15 AC 2 ms
6,940 KB
testcase_16 AC 2 ms
6,940 KB
testcase_17 AC 2 ms
6,944 KB
testcase_18 AC 2 ms
6,940 KB
testcase_19 AC 1 ms
6,944 KB
testcase_20 AC 2 ms
6,944 KB
testcase_21 AC 2 ms
6,944 KB
testcase_22 AC 1 ms
6,944 KB
testcase_23 AC 1 ms
6,940 KB
testcase_24 AC 27 ms
9,820 KB
testcase_25 AC 27 ms
11,432 KB
testcase_26 AC 26 ms
10,952 KB
testcase_27 AC 27 ms
11,040 KB
testcase_28 AC 27 ms
9,820 KB
testcase_29 AC 176 ms
42,588 KB
testcase_30 AC 242 ms
42,588 KB
testcase_31 AC 170 ms
42,588 KB
testcase_32 AC 232 ms
42,588 KB
testcase_33 AC 241 ms
42,584 KB
testcase_34 AC 236 ms
42,360 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

int A[1d7],H,W,i,z,t;
int f(int i){
	return A[i]=A[i]-i?f(A[i]):i;
}
{
	rd(H,W);
	rep(i,W+1,~H*~W){i%~W||++i;rd(t);if(A[i]=t*i)rep(j,2)if(t=f(i-1-j*W))A[f(i)]=t;}
	for(;--i;)z+=i==f(i);
	wt(z);
}
0