| Run ID | Author | Problem | Lang | Verdict | Score | Time | Memory | Code Length | Submit Time |
|---|---|---|---|---|---|---|---|---|---|
| 27995 | 202102bxy | 数1的个数 | C++ | Accepted | 100 | 0 MS | 252 KB | 271 | 2021-12-22 21:37:22 |
#include<bits/stdc++.h> using namespace std; int n,a[10000],b,ans; int main(){ cin>>n; for(int i=0;i<=n;i++){ a[i]+=b; b++; while(a[i]!=0){ if(a[i]%10==1){ ans++; a[i]/=10; }else{ a[i]/=10; } } } cout<<ans; return 0; }