結果

問題 No.1477 Lamps on Graph
ユーザー tailstails
提出日時 2021-04-16 20:29:01
言語 cLay
(20240104-1)
結果
AC  
実行時間 25 ms / 2,000 ms
コード長 384 bytes
コンパイル時間 5,867 ms
コンパイル使用メモリ 221,432 KB
実行使用メモリ 14,636 KB
最終ジャッジ日時 2023-09-19 02:22:01
合計ジャッジ時間 11,525 ms
ジャッジサーバーID
(参考情報)
judge14 / judge13
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
4,380 KB
testcase_01 AC 2 ms
4,384 KB
testcase_02 AC 1 ms
4,384 KB
testcase_03 AC 2 ms
4,380 KB
testcase_04 AC 1 ms
4,384 KB
testcase_05 AC 1 ms
4,380 KB
testcase_06 AC 2 ms
4,384 KB
testcase_07 AC 1 ms
4,384 KB
testcase_08 AC 1 ms
4,380 KB
testcase_09 AC 2 ms
4,384 KB
testcase_10 AC 1 ms
4,384 KB
testcase_11 AC 2 ms
4,380 KB
testcase_12 AC 14 ms
8,724 KB
testcase_13 AC 13 ms
8,640 KB
testcase_14 AC 15 ms
8,944 KB
testcase_15 AC 8 ms
7,788 KB
testcase_16 AC 7 ms
7,400 KB
testcase_17 AC 7 ms
7,600 KB
testcase_18 AC 16 ms
11,404 KB
testcase_19 AC 13 ms
8,828 KB
testcase_20 AC 6 ms
5,096 KB
testcase_21 AC 14 ms
11,244 KB
testcase_22 AC 4 ms
4,380 KB
testcase_23 AC 10 ms
8,256 KB
testcase_24 AC 18 ms
11,184 KB
testcase_25 AC 8 ms
7,392 KB
testcase_26 AC 18 ms
11,344 KB
testcase_27 AC 10 ms
7,976 KB
testcase_28 AC 11 ms
8,464 KB
testcase_29 AC 11 ms
8,440 KB
testcase_30 AC 9 ms
8,196 KB
testcase_31 AC 8 ms
7,556 KB
testcase_32 AC 21 ms
14,636 KB
testcase_33 AC 20 ms
14,024 KB
testcase_34 AC 16 ms
12,588 KB
testcase_35 AC 24 ms
14,072 KB
testcase_36 AC 23 ms
14,068 KB
testcase_37 AC 21 ms
13,820 KB
testcase_38 AC 22 ms
14,220 KB
testcase_39 AC 25 ms
14,244 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

{
	int@n,@m;
	VI@a(n);
	VI u(m),v(m);
	rd((u--,v--)(m));
	int@k;
	VI b(n);
	rep(k){
		int@bk;
		b[bk-1]=1;
	}
	graph g;
	g.setEdge(n,m,u.data(),v.data());

	VI a1=a;
	VI i1(n);
	rep(i,n) i1[i]=i;
	sortV(a1,i1);
	VI z;
	rep[i1](i,n){
		if(b[i]){
			z.push_back(i+1);
			rep[g.edge[i]](k,g.es[i]){
				if(a[i]<a[k]){
					b[k]^=1;
				}
			}
		}
	}
	int zs=z.size();
	wtLn(zs,z(zs));
}
0