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;
int main(){
// ios::sync_with_stdio(0);cin.tie(0);cout.tie(0);
int n,k;
cin>>n>>k;
cout<<(n+3)/4<<'\n';
for(int i = 0;i<n;i+=4){
printf("A=(((A&(1<<%d))>>%d)+((A&(1<<(%d+1)))>>(%d+1))+((A&(1<<(%d+2)))>>(%d+2))+((A&(1<<(%d+3)))>>(%d+3))+((A>>(%d+4))<<(%d+4)))\n",i,i,i,i,i,i,i,i,i,i);
// A=(((A&(1<<0))>>0)+((A&(1<<(0+1)))>>(0+1))+((A&(1<<(0+2)))>>(0+2))+((A&(1<<(0+3)))>>(0+3))+((A>>(0+3))<<(0+3)))
}
// for(int j = 0;j<(1<<n);j++){
// int A = j;
// for(int i = 1;i<n;i++){
// A=((A&(1<<i))>>i)+(A^(A&(1<<i)));
// }
// assert(A == __builtin_popcount(j));
// }
}
# | 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... |