main()
{
long i,k,m,n;
scanf("%d\n",&m);
for(i=1;i<=m;i++)
{
scanf("%d%d\n",&n,&k);
if(k==(n&k)) printf("%d\n",1);
else
printf("%d\n",0);
}
}
题目编号:29-[stupid]愚蠢的组合数 查看该题
状态: Accepted
测评机: Xeost[5]
得分: 100分
提交日期: 2009-9-9 22:45:00
有效耗时: 1844毫秒
测试结果1: 通过本测试点|有效耗时94ms
测试结果2: 通过本测试点|有效耗时63ms
测试结果3: 通过本测试点|有效耗时63ms
测试结果4: 通过本测试点|有效耗时188ms
测试结果5: 通过本测试点|有效耗时187ms
测试结果6: 通过本测试点|有效耗时266ms
测试结果7: 通过本测试点|有效耗时234ms
测试结果8: 通过本测试点|有效耗时234ms
测试结果9: 通过本测试点|有效耗时265ms
测试结果10: 通过本测试点|有效耗时250ms
var
i,k,n,m:longint;
begin
readln(m);
for i:=1 to m do
begin
readln(n,k);
if k = n and k then writeln(1) else writeln(0);
end;
end.
题目编号:29-[stupid]愚蠢的组合数 查看该题
状态: Unaccepted
测评机: Xeost[5]
得分: 50分
提交日期: 2009-9-9 22:23:00
有效耗时: 1937毫秒
测试结果1: 通过本测试点|有效耗时219ms
测试结果2: 通过本测试点|有效耗时203ms
测试结果3: 通过本测试点|有效耗时203ms
测试结果4: 通过本测试点|有效耗时625ms
测试结果5: 通过本测试点|有效耗时687ms
测试结果6: 选手程序运行超过时限
测试结果7: 选手程序运行超过时限
测试结果8: 选手程序运行超过时限
测试结果9: 选手程序运行超过时限
测试结果10: 选手程序运行超过时限
看来掌握多种语言是很有必要的- -!
在遇到这种xxx题的时候可以自行翻译一下.....
orz...
#include<iostream>
using namespace ;std;
int main()
{
long t;
int s;
int n,k;
long h,i,j;
bool a,b,c;
cin>>t;//组数
for(h=1;h<=t;h++)
{
cin>>n>>k;
if((n&k)==k)cout<<1<<endl; else cout<<0<<endl;
}
return ;0;
}
这是由于cin和cout输入输出流的问题,把它换成c的输入输出就完全没事了,因为c 的输入输出中,当大量输入输出时就占很大时间