Run ID | 作者 | 问题 | 语言 | 测评结果 | 分数 | 时间 | 内存 | 代码长度 | 提交时间 |
---|---|---|---|---|---|---|---|---|---|
169835 | C班-张腾午 | 二进制计数游戏 | C++ | 编译错误 | 0 | 0 MS | 0 KB | 442 | 2024-08-20 17:24:50 |
#include<bits/stdc++.h> using namespace std; typedef long long ll; string to_string(ll x) { string s; while(x!=0) { s=char(x%10+48)+s; x/=10; } return s; } int main() { ll n,m,x,i,j,cn1,ans=0; string s; scanf("%lld %lld %lld",&x,&n,&m); for(i=n;i<m;i++) { cn1=0; s=to_string(i); for(j=0;j<s.size();j++) if(s[j]=='1') cn1++; if(cn1<=x) ans++; } printf("%lld",ans); return 0; }