結果

問題 No.2716 Falcon Method
ユーザー 👑 p-adicp-adic
提出日時 2024-02-07 10:04:13
言語 cLay
(20240104-1)
結果
AC  
実行時間 150 ms / 2,000 ms
コード長 261 bytes
コンパイル時間 3,198 ms
コンパイル使用メモリ 176,076 KB
実行使用メモリ 15,496 KB
最終ジャッジ日時 2024-02-07 17:36:39
合計ジャッジ時間 6,702 ms
ジャッジサーバーID
(参考情報)
judge12 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
7,616 KB
testcase_01 AC 2 ms
7,616 KB
testcase_02 AC 2 ms
7,616 KB
testcase_03 AC 2 ms
7,616 KB
testcase_04 AC 2 ms
7,616 KB
testcase_05 AC 3 ms
7,616 KB
testcase_06 AC 3 ms
7,616 KB
testcase_07 AC 3 ms
7,616 KB
testcase_08 AC 3 ms
7,616 KB
testcase_09 AC 3 ms
7,616 KB
testcase_10 AC 2 ms
7,616 KB
testcase_11 AC 66 ms
12,064 KB
testcase_12 AC 103 ms
14,964 KB
testcase_13 AC 75 ms
14,968 KB
testcase_14 AC 107 ms
14,144 KB
testcase_15 AC 79 ms
14,696 KB
testcase_16 AC 92 ms
14,016 KB
testcase_17 AC 105 ms
14,400 KB
testcase_18 AC 126 ms
14,616 KB
testcase_19 AC 93 ms
13,876 KB
testcase_20 AC 79 ms
14,628 KB
testcase_21 AC 55 ms
11,568 KB
testcase_22 AC 79 ms
12,300 KB
testcase_23 AC 150 ms
15,496 KB
testcase_24 AC 75 ms
12,300 KB
testcase_25 AC 3 ms
7,616 KB
testcase_26 AC 2 ms
7,616 KB
testcase_27 AC 135 ms
15,496 KB
testcase_28 AC 130 ms
15,424 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

ll@N,@Q,b,c[2]{};string@S;fenwick<ll>t[2];rep(b,2)t[b].malloc(2N,1);rep(i,N)b=S[i]>'D',t[b].add(i,1),t[b].add(i+N,1),++c[b];rep(Q){ll@H[2],@P,d[2]{1d15,1d15},q;rep(b,2)if(c[b])q=(H[b]-1)/c[b],d[b]=q*N+1+t[b].kth(t[b].get(P-1)+H[b]-q*c[b]-1);wt(min(*d,d[1])%N);}
0