Run ID | 作者 | 问题 | 语言 | 测评结果 | 分数 | 时间 | 内存 | 代码长度 | 提交时间 |
---|---|---|---|---|---|---|---|---|---|
136805 | 唐钧 | 二进制计数游戏 | C++ | 运行超时 | 40 | 1000 MS | 252 KB | 459 | 2024-03-09 15:21:17 |
//D #include<bits/stdc++.h> using namespace std; #define ll long long ll r0,ans=0; stack<ll>s; void clear() { while(!s.empty()) { if(s.top()==1) { r0++; } s.pop(); } return; } void bin(ll a) { ll sb=a; while(sb>=1) { s.push(sb%2); sb/=2; } } int main() { ll n,s,t; cin>>n>>s>>t; for(int i=s;i<=t;i++) { r0=0; bin(i); clear(); if(r0<=n) { ans++; } } cout<<ans; return 0; }