# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
222502 | jamielim | Popcount (COCI19_popcount) | C++14 | 5 ms | 384 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include <bits/stdc++.h>
using namespace std;
const long long X=42;
const long long Y=47;
int main(){
string start="(((A-(A&" + to_string((1LL<<Y)-1) + "))>>" + to_string(Y-9) + ")+((A&1)";
for(long long i=1;i<Y;i++){
start+="+(((A&" + to_string(1LL<<i) + ")>>" + to_string(i) + ")";
}
for(int i=-1;i<Y;i++)start+=")";
//printf("%d %s\n",(int)start.length(),start.c_str());
string rep="((A&511)+(((A-(A&" + to_string((1LL<<(X+9))-1) + "))>>" + to_string(X) + ")";
for(long long i=9;i<X+9;i++){
rep+="+(((A&" + to_string(1LL<<i) + ")>>" + to_string(i) + ")";
}
for(int i=7;i<X+9;i++)rep+=")";
//printf("%d %s\n",(int)rep.length(),rep.c_str());
printf("%s\n",start.c_str());
int n,k;
scanf("%d%d",&n,&k);
n-=Y;
while(n>0){
printf("%s\n",rep.c_str());
n-=X;
}
}
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |