結果

問題 No.728 ギブ and テイク
ユーザー 👑 hos.lyrichos.lyric
提出日時 2019-01-27 09:16:30
言語 cLay
(20231016-1)
結果
AC  
実行時間 191 ms / 3,000 ms
コード長 321 bytes
コンパイル時間 5,269 ms
コンパイル使用メモリ 216,376 KB
実行使用メモリ 41,200 KB
最終ジャッジ日時 2023-09-19 00:19:48
合計ジャッジ時間 8,374 ms
ジャッジサーバーID
(参考情報)
judge12 / judge13
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 3 ms
11,732 KB
testcase_01 AC 3 ms
11,548 KB
testcase_02 AC 4 ms
11,624 KB
testcase_03 AC 3 ms
11,736 KB
testcase_04 AC 3 ms
11,544 KB
testcase_05 AC 3 ms
11,560 KB
testcase_06 AC 3 ms
11,544 KB
testcase_07 AC 3 ms
11,824 KB
testcase_08 AC 4 ms
11,548 KB
testcase_09 AC 3 ms
11,624 KB
testcase_10 AC 3 ms
11,552 KB
testcase_11 AC 3 ms
11,576 KB
testcase_12 AC 3 ms
11,592 KB
testcase_13 AC 9 ms
14,200 KB
testcase_14 AC 15 ms
16,624 KB
testcase_15 AC 8 ms
13,996 KB
testcase_16 AC 12 ms
14,420 KB
testcase_17 AC 12 ms
14,332 KB
testcase_18 AC 123 ms
33,644 KB
testcase_19 AC 128 ms
33,744 KB
testcase_20 AC 165 ms
36,292 KB
testcase_21 AC 139 ms
33,920 KB
testcase_22 AC 47 ms
23,092 KB
testcase_23 AC 31 ms
17,852 KB
testcase_24 AC 98 ms
28,880 KB
testcase_25 AC 95 ms
28,884 KB
testcase_26 AC 46 ms
22,824 KB
testcase_27 AC 191 ms
41,200 KB
testcase_28 AC 65 ms
30,732 KB
testcase_29 AC 3 ms
11,552 KB
testcase_30 AC 3 ms
11,560 KB
testcase_31 AC 4 ms
11,604 KB
testcase_32 AC 3 ms
11,600 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

ll N,A[9d5],B[9d5],c[9d5],z,j,k;{rd(N,A(N));rep(i,N)rd(B[i],B[i+N]);rep(i,2N)c[i]=i;sortA(2N,B,c);fenwick<ll> l,r;l.malloc(N);r.malloc(N);l.init(N);r.init(N);rep(i,2N)j=c[i],k=lower_bound(A,A+N,j<N?A[j]-B[i]:A[j-N]+B[i]+1)-A,j<N?z+=j-k-r.get(j-1)+r.get(k-1),l.add(j,1):(j-=N,z+=--k-j-l.get(k)+l.get(j),r.add(j,1));wt(z);}
0