Submission #120500

#TimeUsernameProblemLanguageResultExecution timeMemory
120500_SamirCATS (NOI14_cats)C++17
0 / 25
222 ms2500 KiB
//https://github.com/mostafa-saad/MyCompetitiveProgramming/blob/master/Olympiad/MCO/official/2016/editorial.pdf #include<queue> #include<map> #include <string> #include<bits/stdc++.h> #define pi 3.141592654 #define forr(i,a,b) for(int i=a;i<=b;i++) #define F first #define S second #define input ios_base::sync_with_stdio(0);cin.tie(0); //#define x real() //#define y imag() using namespace std; typedef pair<double,double>pdd; typedef long long ll; typedef pair<ll, ll>pii; //typedef complex<double> point; //template<typename T>T gcd(T x, T y) { if(y == 0)return x; else return gcd(y, x%y); } //typedef bitset<30> mask; //int x[8]={1,0,0,-1,-1,-1,1,1}; //int y[8]={0,1,-1,0,-1,1,-1,1}; //#define var(x) ((x)<<1) //#define nvar(x) ((x)^1) const int N=100000,M=100000; ll n,x,l,q; main() { //cout<<Pow((ll)1000000,(ll)110); //freopen("input.txt","r",stdin); //freopen("output.txt","w",stdout); // char input[15]; // scanf("%s", &input); array of char // gets(c+1); array of char //printf("%s, ",name[k[i]].c_str()); printf of string //priority_queue<ll,vector<ll>,greater<ll>>y; input; cin>>q; while(q--) { cin>>x>>l>>n; int c=0; while(x) { if(x%2)c++; x/=2; } cout<<2*n*(l/(2*n)+1)+c%2<<endl; } return 0; }

Compilation message (stderr)

cats.cpp:27:7: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
  main()
       ^
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...