116 条题解
-
0xixid2000 LV 6 @ 2009-07-21 00:26:06
这个题我提交了N次,结果总是。。。
编译通过...
├ 测试数据 01:答案错误...程序输出比正确答案长
---|---|---|---|---|---|---|---|-
Unaccepted 有效得分:0 有效耗时:0ms检查了一天,没有发现哪有问题。没有办法,用一个正确(能AC)的程序测试我的数据:1990.1.1至2001.11.4,共37198个数据,再把结果写入out.txt 文件;同时用我自己的源程序运行同样这些数据,得到out1.txt;再编写一个程序判断这两个文件是否一样,结果这两个文件完全一样。以下为AC的程序:
#include
using namespace std;
int t, y, m, d;
int main() {
scanf("%d", &t);
while (t--) {
bool res = false;
fscanf(fp,"%d %d %d", &y, &m, &d);
if (m == 2 && d == 28) res = true;
else if (m == 9 && d == 30) res = true;
else if (m == 11 && d == 30) res = true;
else if ((m + d) % 2 == 0) res = true;
if (res) printf("YES\n");
else printf("NO\n");
}
return 0;
}
遇到这样的情况,我真是无语了,所有测试数据的结果完全一样,为什么过不了?之后,我把我的程序提交到ZOJ(zoj1024),结果为 Wrong Answer,我快崩溃了。
就在刚才,跑到POJ(poj1082)提交,结果Accepted!!!浪费一天多时间,我真的搞不懂,是我错了,还是系统错了?以下是我的源代码,望有心人能给予解答,谢谢!!!!
#include
#include
typedef struct date{
int year;
int month;
int day;
}date;
int n,top,t_day;
date d={2001,11,4};
bool a[40000];
//FILE *p;
int b[12]={31,28,31,30,31,30,31,31,30,31,30,31};
int getDay(date dat){//设公元1年1月1天为第一天,求dat为第几天
int i,t=0;
for(i=1;i -
02009-07-19 17:45:27@
我用小号刷了一个小时的数据,结果如下:
writeln('YES');
writeln('YES');
writeln('YES');
writeln('NO');
writeln('NO');
writeln('NO');
writeln('YES');
writeln('NO');
writeln('YES');
writeln('NO');
writeln('NO');
writeln('YES');
writeln('YES');
writeln('NO');
writeln('YES');
writeln('NO');
writeln('NO');
writeln('NO');
writeln('NO');
writeln('NO');
writeln('NO');
writeln('NO');
writeln('YES');
writeln('YES');
writeln('NO');
最后两个数据错了..... vijos令人无奈...... -
02009-07-18 09:21:10@
var
a,b,c,d,e:integer;
begin
readln(a);
for b:=1 to a do
begin
readln(e,c,d);
if(c=9)and(d=30)then writeln('YES')
else if(c=11)and(d=30)then writeln('YES')
else if not(odd(c+d))then writeln('YES')
else writeln('NO');
end;
end. -
02009-07-17 23:14:53@
记忆搜、
么话说、 -
02009-07-08 13:29:38@
var
c,i,m,n,y:integer;
begin
readln(c);
for i:=1 to c do
begin
readln(y,m,n);
if(m=9)and(n=30)then writeln('YES')
else if(m=11)and(n=30)then writeln('YES')
else if not(odd(m+n))then writeln('YES')
else writeln('NO');
end;
end. -
02009-05-29 04:00:30@
编译通过...
├ 测试数据 01:答案正确... 0ms
---|---|---|---|---|---|---|---|-
Accepted 有效得分:100 有效耗时:0ms超简版AC
#include "stdio.h"
int main()
{
int c,y,m,n,i;
scanf("%d",&c);
for(i=1;i -
02009-05-02 08:55:55@
program adam;
var day:array[1900..2001,1..12,1..31]of integer;
res:array[1..5000]of boolean;
n,t,i,j,k:integer;
flag:boolean;
begin
fillchar(day,sizeof(day),0);
for i:=1900 to 2001 do begin
day:=maxint;
day:=maxint;
day:=maxint;
day:=maxint;
day:=maxint;
day:=maxint;
day:=maxint;end;
for i:=1901 to 2001 do
if i mod 4=0 then day:=0;flag:=false;
for i:=5 to 30 do day[2001,11,i]:=1;day[2001,10,4]:=1;
day[2001,11,4]:=0;
for i:=3 downto 1 do
if i mod 2=1 then day[2001,11,i]:=1;
for i:=1 to 31 do day[2001,12,i]:=1;for k:=2001 downto 1900 do
for j:=12 downto 1 do
for i:=31 downto 1 do begin
if day[k,j,i]=1 then continue;if (i=3) and (j=10) then flag:=true;
if flag=false then continue;if day[k,j,i]=maxint then continue;
if (j=12)and (i=31) then begin
if (day[k+1,1,1]=0)or(day[k+1,1,31]=0)then day[k,j,i]:=1;continue;end;if j=12 then begin
if (day[k+1,1,i]=0)or(day[k,j,i+1]=0)then day[k,j,i]:=1;continue;end;if (day[k,j,i+1]=maxint)then begin
if (day[k,j+1,1]=0)or(day[k,j+1,i]=0) then day[k,j,i]:=1;continue;end;if (day[k,j+1,i]=0) or (day[k,j,i+1]=0) then
day[k,j,i]:=1;end;
readln(n);
for t:=1 to n do begin
readln(i,j,k);
if day=0 then res[t]:=false else res[t]:=true;
end;
for i:=1 to n do if res[i]=true then writeln('YES') else writeln('NO');
end. -
02009-04-23 21:24:22@
怎么个dp法?那位高人写个状态方程?
-
02009-04-04 12:57:44@
搞了一上午 最后还是cheat过。对自己无语 太菜了
-
02009-03-22 18:46:17@
Program yidian;
var a1,a2,a3:array[1..30] of integer;
a4:array[1..30] of string;
n,i,j:integer;
begin
readln(n);
for i:=1 to n do
begin
read(a1[i],a2[i],a3[i]);
if (a1[i]>=1900)or(a1[i]30 then a4[i]:='c';
2:if a1[i]=1900 then
begin
if a3[i]>28 then a4[i]:='c'
end
else if a1[i] mod 4=0 then
begin
if a3[i]>29 then a4[i]:='c'
end
else if a3[i]>28 then a4[i]:='c';end;
end;
end;
end;
for j:=1 to n do
writeln(a4[j]);
end. -
02009-03-07 16:24:53@
var
c,i,m,n,y:integer;
begin
readln(c);
for i:=1 to c do
begin
readln(y,m,n);
if(m=9)and(n=30)then writeln('YES')
else if(m=11)and(n=30)then writeln('YES')
else if not(odd(m+n))then writeln('YES')
else writeln('NO');
end;
end.
此程错了!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -
02009-02-25 22:41:07@
这个题有数学方法吗?
能用数学证明一个直接就能算出来的方法吗 -
02009-02-23 20:05:45@
一开始以为是博弈论,后来发现是DP。注意日期正确性的判断。
还有日期是要变到2006.11.4,和题目说的不一样。 -
02009-02-19 17:03:08@
var
c,i,m,n,y:integer;
begin
readln(c);
for i:=1 to c do
begin
readln(y,m,n);
if(m=9)and(n=30)then writeln('YES')
else if(m=11)and(n=30)then writeln('YES')
else if not(odd(m+n))then writeln('YES')
else writeln('NO');
end;
end. -
02009-02-11 00:56:34@
@#@\(@#\)@\(@\)............
日期先变到2006.11.4的赢。 -
02009-02-02 10:27:31@
此题让人发疯……
-
02009-01-22 19:41:02@
var
c,i,m,n,y:integer;
begin
readln(c);
for i:=1 to c do
begin
readln(y,m,n);
if(m=9)and(n=30)then writeln('YES')
else if(m=11)and(n=30)then writeln('YES')
else if not(odd(m+n))then writeln('YES')
else writeln('NO');
end;
end. -
02008-12-04 22:33:02@
囧~ 边读入边输出WA~ 保存输出AC~
-
02008-11-30 10:45:40@
2006.11.4
-
02008-11-24 17:10:52@
晕哦,题目有问题,而且两个人的操作范围都不能超过2006.11.04