結果

問題 No.1194 Replace
ユーザー tailstails
提出日時 2020-09-14 18:26:32
言語 cLay
(20240104-1)
結果
RE  
実行時間 -
コード長 244 bytes
コンパイル時間 5,038 ms
コンパイル使用メモリ 212,484 KB
実行使用メモリ 14,908 KB
最終ジャッジ日時 2023-09-19 01:13:31
合計ジャッジ時間 12,279 ms
ジャッジサーバーID
(参考情報)
judge15 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 RE -
testcase_01 RE -
testcase_02 RE -
testcase_03 RE -
testcase_04 RE -
testcase_05 RE -
testcase_06 RE -
testcase_07 RE -
testcase_08 RE -
testcase_09 RE -
testcase_10 RE -
testcase_11 RE -
testcase_12 RE -
testcase_13 AC 137 ms
14,900 KB
testcase_14 AC 121 ms
13,764 KB
testcase_15 AC 69 ms
12,312 KB
testcase_16 AC 122 ms
14,908 KB
testcase_17 AC 64 ms
11,996 KB
testcase_18 AC 77 ms
11,648 KB
testcase_19 AC 111 ms
14,684 KB
testcase_20 AC 2 ms
5,064 KB
testcase_21 AC 2 ms
5,060 KB
testcase_22 AC 2 ms
5,064 KB
testcase_23 AC 23 ms
7,636 KB
testcase_24 AC 6 ms
5,256 KB
testcase_25 AC 6 ms
5,004 KB
testcase_26 AC 47 ms
8,620 KB
testcase_27 AC 10 ms
5,068 KB
testcase_28 AC 20 ms
5,816 KB
testcase_29 AC 3 ms
5,000 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

graph g;
map<int,int>v;
ll n,m,w,z;
int b[2d5],c[2d5];

void f(int i){
	rep[g.edge[i]](j,g.es[i])
		if(j<w&&!v[j]++)
			z+=w-j,f(j);
}

{
	rd(n,m,(b,c)(m));
	g.setDirectEdge(n+1,m,c,b);
	z=n*(n+1)/2;
	sortA(m,c);
	rrep[c](i,m)f(w=i);
	wt(z);
}
0