http://acm.zju.edu.cn/onlinejudge/showProblem.do?problemId=1995
#include<iostream> using namespace std; int cal(int n) { int ans=0; while(n>0) { ans+=n/2; n/=2; } return ans; } int main() { int a, b; while(scanf("%d %d",&a,&b)!=EOF) { if(cal(a)-cal(a-b) > cal(b)) cout<<0<<endl; else cout<<1<<endl; } }
本文提供了一个针对ZJU OJ 1995题目的解决方案,采用C++语言实现了一个计算函数来解决特定数学问题,并通过主函数进行输入输出处理。
377

被折叠的 条评论
为什么被折叠?



