| Run ID | Author | Problem | Lang | Verdict | Score | Time | Memory | Code Length | Submit Time |
|---|---|---|---|---|---|---|---|---|---|
| 6122 | asdfghjkl123456789 | 统计1和0的个数 | C++ | Accepted | 100 | 5 MS | 256 KB | 254 | 2020-08-23 19:56:30 |
#include<bits/stdc++.h> using namespace std; int main(){ int a; cin>>a; for(;a>0;a--){ int n;cin>>n; int x=0,y=0; while(1){ if(n==0) break; if(n%2==0) y++; else x++; n/=2; } cout<<x<<" "<<y<<endl; } return 0; }