結果

問題 No.697 池の数はいくつか
ユーザー %20%20
提出日時 2018-06-09 22:26:04
言語 cLay
(20240104-1)
結果
AC  
実行時間 245 ms / 6,000 ms
コード長 223 bytes
コンパイル時間 1,706 ms
コンパイル使用メモリ 161,492 KB
実行使用メモリ 42,484 KB
最終ジャッジ日時 2023-08-08 02:00:30
合計ジャッジ時間 5,303 ms
ジャッジサーバーID
(参考情報)
judge15 / judge11
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
5,332 KB
testcase_01 AC 2 ms
5,448 KB
testcase_02 AC 2 ms
5,368 KB
testcase_03 AC 2 ms
5,352 KB
testcase_04 AC 2 ms
5,452 KB
testcase_05 AC 2 ms
5,320 KB
testcase_06 AC 2 ms
5,352 KB
testcase_07 AC 2 ms
5,348 KB
testcase_08 AC 2 ms
5,316 KB
testcase_09 AC 2 ms
5,292 KB
testcase_10 AC 2 ms
5,320 KB
testcase_11 AC 2 ms
5,620 KB
testcase_12 AC 2 ms
5,332 KB
testcase_13 AC 2 ms
5,308 KB
testcase_14 AC 2 ms
5,292 KB
testcase_15 AC 2 ms
5,432 KB
testcase_16 AC 2 ms
5,564 KB
testcase_17 AC 2 ms
5,356 KB
testcase_18 AC 2 ms
5,564 KB
testcase_19 AC 2 ms
5,288 KB
testcase_20 AC 2 ms
5,452 KB
testcase_21 AC 2 ms
5,312 KB
testcase_22 AC 2 ms
5,384 KB
testcase_23 AC 2 ms
5,484 KB
testcase_24 AC 29 ms
9,808 KB
testcase_25 AC 29 ms
9,804 KB
testcase_26 AC 29 ms
9,656 KB
testcase_27 AC 29 ms
9,584 KB
testcase_28 AC 29 ms
9,812 KB
testcase_29 AC 180 ms
42,484 KB
testcase_30 AC 244 ms
42,308 KB
testcase_31 AC 180 ms
42,428 KB
testcase_32 AC 245 ms
42,320 KB
testcase_33 AC 245 ms
42,460 KB
testcase_34 AC 244 ms
42,324 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

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