151 条题解
-
0沧海一剑 LV 3 @ 2006-07-23 16:25:09
用滚动数组保存读入数的后两位即可
-
02006-08-15 12:32:56@
if(n
-
02006-06-06 11:01:43@
只可能有1或0两种情况。因为相邻两个数可以抵消为1或者-1。于是判断n的奇偶,然后判断n div 2之后的奇偶,总共4种情况。这四种情况分别对应1或者0中的一种。而由于n很大,不能直接进行这个判断,于是需要通过判断n mod 4 之后的值来实现上述判断。这里值得注意的是,判断一个数mod 4之后的值,只需要考虑后面两位就可以,因为整个数可以表示为前面的那部分*100+后两位组成的两位数,其中100 mod 4=0。这样,这道数论题就解决了!
-
02006-06-03 18:30:15@
吃亏了,我用STRING,真的亏了!!!!
-
02006-05-19 17:48:04@
very easy
-
02006-05-03 21:00:46@
找规律
读入要用ansistring -
-12016-09-20 16:38:40@
水水水
测试数据 #0: Accepted, time = 15 ms, mem = 560 KiB, score = 20
测试数据 #1: Accepted, time = 0 ms, mem = 560 KiB, score = 20
测试数据 #2: Accepted, time = 0 ms, mem = 560 KiB, score = 20
测试数据 #3: Accepted, time = 0 ms, mem = 560 KiB, score = 20
测试数据 #4: Accepted, time = 0 ms, mem = 560 KiB, score = 20
c++
#include<cstdio>
using namespace std;
int main()
{
long long n;
scanf("%d",&n);//错误的输入居然能过,如果改成“%lld”不能过,必须用%d才能过,,,,醉了
if(n%4==1||n%4==2)printf("1");
if(n%4==3||n%4==0)printf("0");
return 0;
}
-
-12016-07-14 22:02:10@
foo.cpp:5:6: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
main()
^
测试数据 #0: Accepted, time = 0 ms, mem = 556 KiB, score = 20
测试数据 #1: Accepted, time = 0 ms, mem = 560 KiB, score = 20
测试数据 #2: Accepted, time = 0 ms, mem = 564 KiB, score = 20
测试数据 #3: Accepted, time = 0 ms, mem = 560 KiB, score = 20
测试数据 #4: Accepted, time = 0 ms, mem = 560 KiB, score = 20
Accepted, time = 0 ms, mem = 564 KiB, score = 100
0
second -
-12016-03-23 07:21:46@
P1141最小非负值Accepted记录信息
评测状态 Accepted
题目 P1141 最小非负值
递交时间 2016-03-23 07:21:20
代码语言 C++
评测机 ShadowShore
消耗时间 0 ms
消耗内存 556 KiB
评测时间 2016-03-23 07:21:21评测结果
编译成功测试数据 #0: Accepted, time = 0 ms, mem = 556 KiB, score = 20
测试数据 #1: Accepted, time = 0 ms, mem = 556 KiB, score = 20
测试数据 #2: Accepted, time = 0 ms, mem = 556 KiB, score = 20
测试数据 #3: Accepted, time = 0 ms, mem = 556 KiB, score = 20
测试数据 #4: Accepted, time = 0 ms, mem = 552 KiB, score = 20
Accepted, time = 0 ms, mem = 556 KiB, score = 100
-
-12012-11-27 20:26:36@
我会告诉你我看到这道题的第一想法是DP么……
直到我看见了1e1000的数据范围…… -
-12012-08-18 09:47:52@
var
s:ansistring;
j:longint;
begin
readln(s);
s:=copy(s,length(s)-1,length(s));
val(s,j);
j:=j mod 4;
if j=0 then writeln(0) else
if j=1 then writeln(1) else
if j=2 then writeln(1) else
if j=3 then writeln(0);
end.