QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#418243 | #8416. Dzielniki [B] | IDontKnowGoodNames | Compile Error | / | / | C++14 | 1019b | 2024-05-23 12:03:46 | 2024-05-23 12:03:48 |
Judging History
answer
#include"dzilib.h"
#include<ext/pb_ds/assoc_container.hpp>
#include<ext/pb_ds/hash_policy.hpp>
#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 Ask(x);
}
inline int solve(int x,int k){
if((1ll<<k)>n)return (1ll<<k)-x;
int a=ask(x),b=ask(x+(1ll<<k));
if(b%(k+1)==0){
for(int i=k+2;i<63;i++)
if(a%i==0){
int y=solve(x,k+1);
if(y!=-1)return y;
else break;
}
}
if(a%(k+1)==0){
for(int i=k+2;i<63;i++)
if(b%i==0){
int y=solve(x+(1ll<<k),k+1);
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()%5000+1,0));
else Answer(solve(rnd()%10000000000+1,0));
}
return;
}
Details
implementer.cpp: In function ‘long long int Ask(long long int)’: implementer.cpp:254:18: warning: structured bindings only available with ‘-std=c++17’ or ‘-std=gnu++17’ [-Wc++17-extensions] 254 | for(auto [x,y]:mp) res=res*(y+1); | ^ /usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/13/../../../x86_64-linux-gnu/Scrt1.o: in function `_start': (.text+0x24): undefined reference to `main' collect2: error: ld returned 1 exit status