結果

問題 No.1209 XOR Into You
ユーザー tailstails
提出日時 2020-08-30 20:57:27
言語 cLay
(20240104-1)
結果
AC  
実行時間 338 ms / 2,000 ms
コード長 319 bytes
コンパイル時間 2,491 ms
コンパイル使用メモリ 173,000 KB
実行使用メモリ 79,852 KB
最終ジャッジ日時 2023-09-19 01:05:06
合計ジャッジ時間 16,376 ms
ジャッジサーバーID
(参考情報)
judge14 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
5,348 KB
testcase_01 AC 2 ms
5,324 KB
testcase_02 AC 2 ms
5,392 KB
testcase_03 AC 2 ms
5,348 KB
testcase_04 AC 9 ms
7,944 KB
testcase_05 AC 9 ms
7,916 KB
testcase_06 AC 230 ms
79,764 KB
testcase_07 AC 275 ms
67,612 KB
testcase_08 AC 249 ms
61,556 KB
testcase_09 AC 238 ms
61,724 KB
testcase_10 AC 182 ms
51,592 KB
testcase_11 AC 238 ms
60,908 KB
testcase_12 AC 219 ms
57,092 KB
testcase_13 AC 259 ms
64,104 KB
testcase_14 AC 217 ms
55,560 KB
testcase_15 AC 232 ms
58,532 KB
testcase_16 AC 234 ms
57,480 KB
testcase_17 AC 216 ms
55,236 KB
testcase_18 AC 330 ms
76,448 KB
testcase_19 AC 223 ms
57,436 KB
testcase_20 AC 258 ms
64,372 KB
testcase_21 AC 188 ms
50,488 KB
testcase_22 AC 155 ms
79,720 KB
testcase_23 AC 156 ms
79,840 KB
testcase_24 AC 158 ms
79,820 KB
testcase_25 AC 328 ms
79,788 KB
testcase_26 AC 338 ms
79,776 KB
testcase_27 AC 332 ms
79,852 KB
testcase_28 AC 322 ms
79,796 KB
testcase_29 AC 325 ms
79,824 KB
testcase_30 AC 330 ms
79,784 KB
testcase_31 AC 49 ms
9,220 KB
testcase_32 AC 48 ms
9,324 KB
testcase_33 AC 48 ms
9,128 KB
testcase_34 AC 48 ms
9,152 KB
testcase_35 AC 48 ms
9,128 KB
testcase_36 AC 47 ms
9,128 KB
testcase_37 AC 13 ms
8,788 KB
testcase_38 AC 261 ms
67,160 KB
testcase_39 AC 224 ms
60,408 KB
testcase_40 AC 158 ms
79,828 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

ll n,a[1d5],b[1d5],x,z;
map<ll,stack<ll>>m;
fenwick<ll>f;
{
	rd(n,a(n),b(n));
	if(a[0]!=b[0]||a[n-1]!=b[n-1])wt(-1),exit(0);
	f.walloc(n,1);
	rep(i,n-1)a[i]^=a[i+1],b[i]^=b[i+1],m[b[i]].push(i);
	rrep(i,n-1){
		if(m[a[i]].empty())wt(-1),exit(0);
		z+=f.get(x=m[a[i]].top());
		f.add(x,1);
		m[a[i]].pop();
	}
	wt(z);
}
0