QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#420119 | #8416. Dzielniki [B] | Flamire | 1 | 14ms | 4152kb | C++17 | 674b | 2024-05-24 14:46:07 | 2024-05-24 14:46:07 |
Judging History
answer
#include "dzilib.h"
#include <bits/stdc++.h>
using namespace std;
#define ll long long
map<ll,ll> mp;
ll ask(ll x){if(mp.find(x)!=mp.end())return mp[x];return mp[x]=Ask(x);}
vector<ll> ans;
int L;
void dfs(ll x,int k)
{
if(k==L){ans.push_back(x);return;}
ll x0=(1ll<<k)-x;
ll T0=ask(x0),T1=ask(x0+(1ll<<k));
if(T0%(k+1)==0)
{
for(int i=k+1;i<=L;++i)if(T1%(i+1)==0)dfs((1ll<<i)-(1ll<<k+1)+x,i);
}
if(T1%(k+1)==0)
{
for(int i=k+1;i<=L;++i)if(T0%(i+1)==0)dfs((1ll<<i)-(1ll<<k)+x,i);
}
}
int main()
{
int t=GetT();
L=ceil(log2l(GetN()));
while(t--){
mp.clear();ans.clear();
dfs(0,0);
Answer(ans.front());
}
return 0;
}
详细
Subtask #1:
score: 0
Wrong Answer
Test #1:
score: 0
Wrong Answer
time: 2ms
memory: 4036kb
input:
50 100000 50000 1000000000000 49108 86361 48807 44296 98962 74228 70938 50085 85439 82491 61850 10270 86867 40660 48433 67675 57312 17321 8228 87878 61853 80754 9880 65714 55443 34797 89187 44610 75431 56726 52425 16106 49808 75351 46368 19446 65264 39323 25273 46629 98 24463 76734 54088 12393 93157...
output:
ERROR: expected 74228, found 131032
result:
wrong answer
Subtask #2:
score: 0
Wrong Answer
Test #11:
score: 1
Accepted
time: 14ms
memory: 3808kb
input:
50 1000000 5000 1000000000000 986587 791769 338733 959743 466876 613054 887723 862451 853797 721415 115910 736804 796748 950095 362863 419090 786887 27917 364483 289769 26581 70926 685791 12202 554610 768721 279241 297080 445667 441723 529286 230179 985659 690926 297172 606535 540585 426446 300803 5...
output:
Accepted: queries used = 2325.
result:
ok
Test #12:
score: 0
Wrong Answer
time: 13ms
memory: 3776kb
input:
50 1000000 5000 1000000000000 408852 226852 398523 636358 555959 300412 871671 303116 560497 760348 742976 83603 260140 462078 36416 407802 37046 49682 137208 553464 298995 441806 740810 507554 524963 58279 426298 655003 152450 334164 857376 197237 678363 591606 177637 558873 346552 51195 502626 326...
output:
ERROR: expected 614358, found 1040278
result:
wrong answer
Subtask #3:
score: 1
Accepted
Test #21:
score: 1
Accepted
time: 7ms
memory: 3920kb
input:
10 1000000000 50000 1000000000000 408103384 716411227 312685147 924284703 375298759 152825423 311623701 481729457 215396950 9146195
output:
Accepted: queries used = 834.
result:
ok
Test #22:
score: 1
Accepted
time: 8ms
memory: 4124kb
input:
10 1000000000 50000 1000000000000 708800233 175172934 173179851 979063909 265733080 344682863 958178918 989549919 409032428 280453549
output:
Accepted: queries used = 883.
result:
ok
Test #23:
score: 1
Accepted
time: 5ms
memory: 3984kb
input:
10 1000000000 50000 1000000000000 701712832 986726652 113619980 366011803 189676570 26736014 248627457 379195285 411344794 954348086
output:
Accepted: queries used = 878.
result:
ok
Test #24:
score: 1
Accepted
time: 8ms
memory: 3816kb
input:
10 1000000000 50000 1000000000000 961848720 913017579 933822749 997780972 982478374 965397362 993585954 786461482 886524960 851655942
output:
Accepted: queries used = 868.
result:
ok
Test #25:
score: 1
Accepted
time: 9ms
memory: 3980kb
input:
10 1000000000 50000 1000000000000 991792574 658024835 748402786 944137501 993731043 922310034 989857114 999543156 996908456 760833893
output:
Accepted: queries used = 925.
result:
ok
Test #26:
score: 1
Accepted
time: 5ms
memory: 3976kb
input:
10 1000000000 50000 1000000000000 876899138 905535224 983253823 874432418 972319229 996893036 993091756 936474125 752025977 675980729
output:
Accepted: queries used = 888.
result:
ok
Test #27:
score: 1
Accepted
time: 7ms
memory: 3924kb
input:
10 1000000000 50000 1000000000000 967458809 918330041 905969657 859963385 816293369 805306361 774840971 764411897 725594105 688747529
output:
Accepted: queries used = 772.
result:
ok
Test #28:
score: 1
Accepted
time: 5ms
memory: 3980kb
input:
10 1000000000 50000 1000000000000 436273009 436273010 436273008 436273011 436273005 436273014 436273000 436273019 436272993 436273026
output:
Accepted: queries used = 600.
result:
ok
Test #29:
score: 1
Accepted
time: 1ms
memory: 3984kb
input:
10 1000000000 50000 1000000000000 1 2 3 4 5 6 7 8 9 10
output:
Accepted: queries used = 327.
result:
ok
Test #30:
score: 1
Accepted
time: 7ms
memory: 3984kb
input:
10 1000000000 50000 1000000000000 1000000000 999999999 999999998 999999997 999999996 999999995 999999994 999999993 999999992 999999991
output:
Accepted: queries used = 714.
result:
ok
Subtask #4:
score: 0
Wrong Answer
Test #31:
score: 0
Wrong Answer
time: 3ms
memory: 3840kb
input:
10 100000000000000 5000 100000000000000000 60077435990701 17220541740604 64191465861673 55745499051041 92001632467345 9358956369292 35872866769179 78367022100297 7839460363340 34668026591527
output:
ERROR: expected 60077435990701, found 140735340838773
result:
wrong answer
Subtask #5:
score: 0
Wrong Answer
Test #41:
score: 0
Wrong Answer
time: 3ms
memory: 4040kb
input:
10 100000000000000 2000 100000000000000000 12494380076190 85448577530879 31501976723503 61560401637840 9958432442859 68538788138133 81056300713749 31455642088461 52813858531796 2350217441027
output:
ERROR: expected 12494380076190, found 140737479933914
result:
wrong answer
Subtask #6:
score: 0
Wrong Answer
Test #51:
score: 0
Wrong Answer
time: 3ms
memory: 4128kb
input:
10 100000000000000 1300 100000000000000000 93861841503524 187801688618 12767914004896 68441979369935 44276894335941 10366130300247 10581531522622 34683620486862 71739885742802 31789387511772
output:
ERROR: expected 93861841503524, found 140737479964240
result:
wrong answer
Subtask #7:
score: 0
Wrong Answer
Test #61:
score: 0
Wrong Answer
time: 5ms
memory: 4016kb
input:
10 100000000000000 950 100000000000000000 89476806232027 12353673422544 87587374109960 29662216144897 59695535958606 16446701644855 15698587958167 76032905298130 18875210693225 2202458936163
output:
ERROR: expected 12353673422544, found 140735340871504
result:
wrong answer
Subtask #8:
score: 0
Wrong Answer
Test #71:
score: 0
Wrong Answer
time: 3ms
memory: 3904kb
input:
10 100000000000000 820 100000000000000000 57380646951677 24500445660413 52513218855562 35936833055954 21061776201610 17990465203024 53667291726216 50437972694073 8891884060027 40201586063900
output:
ERROR: expected 57380646951677, found 140737479966545
result:
wrong answer
Subtask #9:
score: 0
Wrong Answer
Test #81:
score: 0
Wrong Answer
time: 2ms
memory: 4060kb
input:
10 100000000000000 750 100000000000000000 5121346638871 87604132110850 89767773421324 36910678760633 22317088453717 9150554156208 86627018380188 91455697966830 39854585335842 25531102467103
output:
ERROR: expected 5121346638871, found 140737488322549
result:
wrong answer
Subtask #10:
score: 0
Wrong Answer
Test #91:
score: 0
Wrong Answer
time: 7ms
memory: 4152kb
input:
10 100000000000000 720 100000000000000000 32571246806419 17047845628559 72028252544868 84189424781123 34278867527450 31844169904318 25833108322349 14895620716019 41844198477918 35390870210849
output:
ERROR: expected 17047845628559, found 140737488322549
result:
wrong answer