QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#443154 | #8416. Dzielniki [B] | IDontKnowGoodNames | 0 | 1ms | 4108kb | C++17 | 1.1kb | 2024-06-15 14:34:24 | 2024-06-15 14:34:25 |
answer
#include"dzilib.h"
#include<bits/stdc++.h>
#define int long long
using namespace std;
int n,C,q;
unordered_map<int,int>mp;
mt19937_64 rnd(chrono::system_clock::now().time_since_epoch().count());
int ask(int x){
if(mp.count(x))return mp[x];
return mp[x]=Ask(x);
}
inline int solve(int x,int k){
if((1ll<<k)>C)return (1ll<<k)-x;
int a=ask(x),b=ask(x+(1ll<<k));
if(a%(k+1)==0){
for(int i=k+1;i<60;i++)
if(b%(i+1)==0){
int y=solve(x+(1ll<<k),i);
if(y!=-1)return y;
else break;
}
}
if(b%(k+1)==0){
for(int i=k+1;i<60;i++)
if(a%(i+1)==0){
int y=solve(x,i);
if(y!=-1)return y;
else break;
}
}
return -1;
}
void Solve(){
int T=GetT();n=GetN(),C=GetC(),q=GetQ();
while(T--){
mp.clear();
if(q>=1300)Answer(solve(rnd()%5000ll+1,0));
else Answer(solve(rnd()%10000000000000ll+1,0));
}
}
signed main(){
int T=GetT();n=GetN(),C=GetC(),q=GetQ();
while(T--){
mp.clear();
if(q>=1300)Answer(solve(rnd()%5000+1,0));
else Answer(solve(rnd()%1000000000000+1,0));
}
return 0;
}
詳細信息
Subtask #1:
score: 0
Wrong Answer
Test #1:
score: 0
Wrong Answer
time: 1ms
memory: 3896kb
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: given 1099511578668 out of range [0,C]
result:
wrong answer
Subtask #2:
score: 0
Wrong Answer
Test #11:
score: 0
Wrong Answer
time: 1ms
memory: 3892kb
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:
ERROR: given 1099510641189 out of range [0,C]
result:
wrong answer
Subtask #3:
score: 0
Wrong Answer
Test #21:
score: 0
Wrong Answer
time: 1ms
memory: 3844kb
input:
10 1000000000 50000 1000000000000 408103384 716411227 312685147 924284703 375298759 152825423 311623701 481729457 215396950 9146195
output:
ERROR: given 1099103524392 out of range [0,C]
result:
wrong answer
Subtask #4:
score: 0
Wrong Answer
Test #31:
score: 0
Wrong Answer
time: 0ms
memory: 3828kb
input:
10 100000000000000 5000 100000000000000000 60077435990701 17220541740604 64191465861673 55745499051041 92001632467345 9358956369292 35872866769179 78367022100297 7839460363340 34668026591527
output:
ERROR: given 144055110639865171 out of range [0,C]
result:
wrong answer
Subtask #5:
score: 0
Wrong Answer
Test #41:
score: 0
Wrong Answer
time: 0ms
memory: 4088kb
input:
10 100000000000000 2000 100000000000000000 12494380076190 85448577530879 31501976723503 61560401637840 9958432442859 68538788138133 81056300713749 31455642088461 52813858531796 2350217441027
output:
ERROR: given 144102693695779682 out of range [0,C]
result:
wrong answer
Subtask #6:
score: 0
Wrong Answer
Test #51:
score: 0
Wrong Answer
time: 1ms
memory: 3900kb
input:
10 100000000000000 1300 100000000000000000 93861841503524 187801688618 12767914004896 68441979369935 44276894335941 10366130300247 10581531522622 34683620486862 71739885742802 31789387511772
output:
ERROR: given 144021326234352348 out of range [0,C]
result:
wrong answer
Subtask #7:
score: 0
Wrong Answer
Test #61:
score: 0
Wrong Answer
time: 1ms
memory: 3836kb
input:
10 100000000000000 950 100000000000000000 89476806232027 12353673422544 87587374109960 29662216144897 59695535958606 16446701644855 15698587958167 76032905298130 18875210693225 2202458936163
output:
ERROR: given 144025711269623845 out of range [0,C]
result:
wrong answer
Subtask #8:
score: 0
Wrong Answer
Test #71:
score: 0
Wrong Answer
time: 1ms
memory: 4104kb
input:
10 100000000000000 820 100000000000000000 57380646951677 24500445660413 52513218855562 35936833055954 21061776201610 17990465203024 53667291726216 50437972694073 8891884060027 40201586063900
output:
ERROR: given 144057807428904195 out of range [0,C]
result:
wrong answer
Subtask #9:
score: 0
Wrong Answer
Test #81:
score: 0
Wrong Answer
time: 0ms
memory: 4108kb
input:
10 100000000000000 750 100000000000000000 5121346638871 87604132110850 89767773421324 36910678760633 22317088453717 9150554156208 86627018380188 91455697966830 39854585335842 25531102467103
output:
ERROR: given 144110066729217001 out of range [0,C]
result:
wrong answer
Subtask #10:
score: 0
Wrong Answer
Test #91:
score: 0
Wrong Answer
time: 1ms
memory: 4092kb
input:
10 100000000000000 720 100000000000000000 32571246806419 17047845628559 72028252544868 84189424781123 34278867527450 31844169904318 25833108322349 14895620716019 41844198477918 35390870210849
output:
ERROR: given 144082616829049453 out of range [0,C]
result:
wrong answer