| Run ID | Author | Problem | Lang | Verdict | Score | Time | Memory | Code Length | Submit Time |
|---|---|---|---|---|---|---|---|---|---|
| 5917 | 顾郁铭 | 统计1和0的个数 | C++ | Accepted | 100 | 5 MS | 248 KB | 284 | 2020-08-16 20:13:40 |
#include<bits/stdc++.h> using namespace std; int n,a,count1,count2; int main(){ cin>>n; for(int i=1;i<=n;i++){ cin>>a; count1=0; count2=0; while(a!=0){ if(a%2==1) count1++; else count2++; a/=2; } cout<<count1<<" "<<count2<<endl; } return 0; }