# |
Submission time |
Handle |
Problem |
Language |
Result |
Execution time |
Memory |
711711 |
2023-03-17T11:31:30 Z |
pcc |
Popcount (COCI19_popcount) |
C++14 |
|
1 ms |
340 KB |
#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-1<<'\n';
for(int i = 1;i<n;i++){
cout<<"A=(((A&(1<<"<<i<<"))>>"<<i<<")+(A-(A&"<<"(1<<"<<i<<"))))\n";
}
// 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 |
1 |
Correct |
0 ms |
212 KB |
Accepted. |
2 |
Correct |
0 ms |
212 KB |
Accepted. |
3 |
Correct |
0 ms |
212 KB |
Accepted. |
4 |
Correct |
0 ms |
212 KB |
Accepted. |
5 |
Correct |
0 ms |
212 KB |
Accepted. |
6 |
Correct |
0 ms |
212 KB |
Accepted. |
7 |
Correct |
1 ms |
340 KB |
Accepted. |
8 |
Correct |
1 ms |
212 KB |
Accepted. |
9 |
Correct |
0 ms |
324 KB |
Accepted. |
10 |
Correct |
1 ms |
212 KB |
Accepted. |
11 |
Correct |
0 ms |
212 KB |
Accepted. |
12 |
Correct |
0 ms |
212 KB |
Accepted. |
13 |
Correct |
0 ms |
212 KB |
Accepted. |
14 |
Correct |
0 ms |
212 KB |
Accepted. |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
1 ms |
340 KB |
Incorrect number of commands. |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
0 ms |
212 KB |
Accepted. |
2 |
Incorrect |
0 ms |
212 KB |
Incorrect number of commands. |
3 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
1 ms |
212 KB |
Incorrect number of commands. |
2 |
Halted |
0 ms |
0 KB |
- |