結果

問題 No.2581 [Cherry Anniversary 3] 28輪の桜のブーケ
ユーザー 👑 p-adicp-adic
提出日時 2023-12-04 21:38:09
言語 cLay
(20240104-1)
結果
AC  
実行時間 495 ms / 3,000 ms
コード長 490 bytes
コンパイル時間 2,607 ms
コンパイル使用メモリ 192,212 KB
実行使用メモリ 6,548 KB
最終ジャッジ日時 2023-12-08 23:30:35
合計ジャッジ時間 9,218 ms
ジャッジサーバーID
(参考情報)
judge14 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 3 ms
6,548 KB
testcase_01 AC 8 ms
6,548 KB
testcase_02 AC 30 ms
6,548 KB
testcase_03 AC 157 ms
6,548 KB
testcase_04 AC 93 ms
6,548 KB
testcase_05 AC 21 ms
6,548 KB
testcase_06 AC 131 ms
6,548 KB
testcase_07 AC 124 ms
6,548 KB
testcase_08 AC 35 ms
6,548 KB
testcase_09 AC 83 ms
6,548 KB
testcase_10 AC 123 ms
6,548 KB
testcase_11 AC 31 ms
6,548 KB
testcase_12 AC 160 ms
6,548 KB
testcase_13 AC 186 ms
6,548 KB
testcase_14 AC 156 ms
6,548 KB
testcase_15 AC 139 ms
6,548 KB
testcase_16 AC 147 ms
6,548 KB
testcase_17 AC 149 ms
6,548 KB
testcase_18 AC 171 ms
6,548 KB
testcase_19 AC 190 ms
6,548 KB
testcase_20 AC 187 ms
6,548 KB
testcase_21 AC 180 ms
6,548 KB
testcase_22 AC 478 ms
6,548 KB
testcase_23 AC 495 ms
6,548 KB
testcase_24 AC 483 ms
6,548 KB
testcase_25 AC 479 ms
6,548 KB
testcase_26 AC 480 ms
6,548 KB
testcase_27 AC 13 ms
6,548 KB
testcase_28 AC 14 ms
6,548 KB
testcase_29 AC 385 ms
6,548 KB
testcase_30 AC 2 ms
6,548 KB
testcase_31 AC 156 ms
6,548 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#define T second
ll@M,@G[2][28],@Q,l,r,m,b;unordered_map<ll,ll>L[15];map<ll,ll>R[15],S[15];REP(i,1<<14){l=r=m=0;rep(d,14)b=((i>>d)&1),m+=1-b,l+=G[b][d],r+=G[b][14+d];L[m][l%M]++;R[m][r%M]++;}rep(c,15){l=0;auto j=R[c].begin(),e=R[c].end();for(;j!=e;j++)S[c][j->first]=l,l+=j->T;S[c][M]=l;}rep(Q){ll@K,@X,a=0;REP(c,max(0,K-14),min(15,K+1)){m=K-c;auto j=L[c].begin(),e=L[c].end();for(;j!=e;j++)l=j->first,b=l>X,a+=j->T*(S[m].lower_bound(M-l)->T-S[m].lower_bound(M*b+X-l)->T+S[m][M]*b);}wt(a);}
0