| Run ID | Author | Problem | Lang | Verdict | Score | Time | Memory | Code Length | Submit Time |
|---|---|---|---|---|---|---|---|---|---|
| 54496 | 202203xhl | 寻找最低数 | C++ | Wrong Answer | 0 | 0 MS | 272 KB | 415 | 2022-07-29 15:46:26 |
#include<bits/stdc++.h> using namespace std; int n[100000],t,m[100000]; void t_to_tw(int a){ while(a){ t++; n[t]=a%2; a/=2; } } void tw_to_t(int k){ int sum; for(int i=1;i<=k;i++){ sum+=pow(n[i],i-1); } cout<<sum; } int main(){ int a; while(cin>>a&&a!=0){ t_to_tw(a); for(int i=1;i<=t;i++){ if(n[i]==1){ tw_to_t(i); break; } } t=0; } return 0; }