378 条题解
-
0常可 LV 9 @ 2012-10-31 21:14:38
...
被水题水了,交了四次啊!!
第一次,字符串定义成string
第二次,循环变量定成integer
第三次,输的谁赢谁在前面
第四次,AC!
倒霉啊,多亏网上有测试数据! -
02010-07-05 23:14:29@
- 输入中有空格
- 一场结束后自动0:0要输出
- 比分差小于2时才要加时,等于2不要
- 最好读入一个立刻判断有没有一局结束,否则有点麻烦
- 输入中有空格
-
02010-02-28 16:58:14@
var i,j,l1,l2,r1,r2,k:longint;
t:char;
a:array [1..2,1..5000] of longint;
b:array [1..2,1..5000] of longint;
begin
read(t);
while t'E' do
begin
if t='W' then
begin
l1:=l1+1;
l2:=l2+1;
end
else if t='L' then
begin
r1:=r1+1;
r2:=r2+1;
end;
if (l1>=11)or(r1>=11)and(abs(l1-r1)>1)then begin i:=i+1;a[1,i]:=l1;a[2,i]:=r1;l1:=0;r1:=0;end;
if (l2>=21)or(r2>=11)and(abs(l2-r2)>1)then begin j:=j+1;b[1,j]:=l2;b[2,j]:=r2;l2:=0;r2:=0;end;
read(t);
end;
for k:=1 to i do
writeln(a[1,k],':',a[2,k]);
if l1+r10 then writeln(l1,':',r1);
writeln;
for k:=1 to j do
writeln(b[1,k],':',b[2,k]);
if l2+r20 them writeln(l2,':',r2);
end. -
02009-11-09 23:21:09@
我的题解 - My Solution
program sadf;var c:char; a:array[1..20000,1..2]of longint; h,h2,d,d2,i:int64; j:longint;begin i:=0;h:=0;h2:=0;d:=0;d2:=0; while c'E' do begin read(c); if c='W' then begin inc(h);inc(h2) end else if c='L' then begin inc(d); inc(d2); end; if (((h>11)or (d>11))and (abs(h-d)>1)) then begin writeln(h,':',d); h:=0; d:=0; end else if(((h=11)or (d=11))and(abs(h-d)>1)) then begin writeln(h,':',d); h:=0; d:=0; end; if (((h2>21)or (d2>21))and (abs(h2-d2)>1)) then begin inc(i); a:=h2; a:=d2; h2:=0; d2:=0; end else if (((h2=21)or (d2=21))and(abs(h2-d2)>1)) then begin inc(i); a:=h2; a:=d2; h2:=0; d2:=0; end; end; if (h>=0) and (d>=0) then writeln(h,':',d); writeln; for j:=1 to i do writeln(a[j,1],':',a[j,2]); if (h>=0) and (d>=0) then writeln(h2,':',d2); readlnend.
----------------------我是天才的分割线------------------
别说你看不见我是SC 的 小号{大号抄小号被封了} -
02009-11-08 12:24:30@
program lf;
{$R-,Q-,S-}
var
n,i,s1,s2:longint;
ch:char;
score:array[0..1000000] of char;
begin
n:=0;
while not eof do
begin
read(ch);
if ch='E' then break;
if (ch='W') or (ch='L') then
begin
inc(n);
score[n]:=ch;
end;
end;
s1:=0;
s2:=0;
for i:=1 to n do
begin
if score[i]='W' then inc(s1)
else inc(s2);
if ((s1>=11) or (s2>=11)) and (abs(s1-s2)>1) then
begin
writeln(s1,':',s2);
s1:=0;
s2:=0;
end;
end;
writeln(s1,':',s2);
writeln;
s1:=0;
s2:=0;
for i:=1 to n do
begin
if score[i]='W' then inc(s1)
else inc(s2);
if ((s1>=21) or (s2>=21)) and (abs(s1-s2)>1) then
begin
writeln(s1,':',s2);
s1:=0;
s2:=0;
end;
end;
writeln(s1,':',s2);
end. -
02009-11-02 20:20:50@
编译通过...
├ 测试数据 01:答案正确... 0ms
├ 测试数据 02:答案正确... 0ms
├ 测试数据 03:答案正确... 0ms
├ 测试数据 04:答案正确... 0ms
├ 测试数据 05:答案正确... 0ms
├ 测试数据 06:答案正确... 0ms
├ 测试数据 07:运行超时|格式错误...
├ 测试数据 08:答案正确... 0ms
├ 测试数据 09:答案正确... 0ms
├ 测试数据 10:答案正确... 0ms
---|---|---|---|---|---|---|---|-
Unaccepted 有效得分:90 有效耗时:0msvar i,x,s1,s2:longint;a:packed array[1..1000000] of char;
begin
i:=0;
repeat
i:=i+1;
read(a[i]);
if a[i]=' ' then i:=i-1;
until a[i]='E';
x:=i;
for i:=1 to x do begin
if a[i]='W' then s1:=s1+1 else if a[i]='L' then s2:=s2+1;
if ((s1=11)and(s21)or(s2>11)and(s2-s1>1) then begin writeln(s1,':',s2);s1:=0;s2:=0;end;end;
writeln(s1,':',s2);writeln;s1:=0;s2:=0;
for i:=1 to x do begin
if a[i]='W' then s1:=s1+1 else if a[i]='L' then s2:=s2+1;
if ((s1=21)and(s21)or(s2>21)and(s2-s1>1) then begin writeln(s1,':',s2);s1:=0;s2:=0;end;end;
write(s1,':',s2);
end.
大牛看看为什么? -
02009-11-02 12:43:05@
program p200303;
var
c:char;
a:array[1..1000] of char;
l:longint;
procedure print(a,b:longint);
begin
writeln(a,':',b);
end;
procedure cyz(goal:longint);
var
x,y,i:longint;
begin
x:=0;y:=0;i:=1;
while a[i]'E' do
begin
if a[i]='W' then x:=x+1 else if a[i]='L'then y:=y+1;
i:=i+1;
if (((x>goal-1) or(y>goal-1))and (abs(x-y)>1)) or(a[i]='E')then
begin
print(x,y);
x:=0;y:=0;
end;
end;
if i=1 then print(0,0)
end;
begin
l:=1;
repeat
read(c);
a[l]:=c;
l:=l+1;
until c='E';
l:=l-2;
cyz(11);
writeln;
cyz(21);我疯了,哪位英雄好汉帮我看看为什么过不了
-
02009-10-31 21:18:41@
编译通过...
├ 测试数据 01:答案正确... 0ms
├ 测试数据 02:答案正确... 0ms
├ 测试数据 03:答案正确... 0ms
├ 测试数据 04:答案正确... 0ms
├ 测试数据 05:答案正确... 0ms
├ 测试数据 06:答案正确... 0ms
├ 测试数据 07:答案正确... 0ms
├ 测试数据 08:答案正确... 0ms
├ 测试数据 09:答案正确... 0ms
├ 测试数据 10:答案正确... 0ms
---|---|---|---|---|---|---|---|-
Accepted 有效得分:100 有效耗时:0ms
program lq;
const
inf='lq.in';
ouf='lq.out';
var
a,b:array[0..10000] of longint;
ch:char;
n,w,l,i:longint;
begin
n:=1;
repeat
read(ch);
if ch='E' then break;
if ch='W' then begin
inc(w);
inc(a[n])
end;
if ch='L' then begin
inc(l);
inc(b[n])
end;
if ((w>10)or(l>10))and(abs(w-l)>1) then begin
writeln(w,':',l);
w:=0;l:=0
end;
if ((a[n]>20)or(b[n]>20))and(abs(a[n]-b[n])>1) then inc(n);
until false;
writeln(w,':',l);
writeln;
for i:=1 to n do writeln(a[i],':',b[i]);
end.汗了我好久^
-
02009-10-30 22:58:10@
都沙茶啊,哪有那么长
23行解决,别想太多了
去年NOIp提高前两道,我们μ联全都一次AC,但是当时考完的情况是:高中黍蜀连对表都不会,没几个全对的一定要简洁!!!!!!!!!!!!!!
program sheep;
var
x,y:array[0..10000]of longint;
a,b,t,i:longint;
c:char;
begin
t:=1;
repeat
read(c);
if c='E'then break;
if c='W'then begin inc(a);inc(x[t]);end;
if c='L'then begin inc(b);inc(y[t]);end;
if((a>10)or(b>10))and(abs(a-b)>1)then begin
writeln(a,':',b);
a:=0;
b:=0;
end;
if((x[t]>20)or(y[t]>20))and(abs(x[t]-y[t])>1)then inc(t);
until false;
writeln(a,':',b);
writeln;
for i:=1 to t do writeln(x[i],':',y[i]);
end. -
02009-10-29 21:35:12@
program pingpong;
var a:char;
o,w,l,p:longint;
m:array[1..10000]of char;
begin
o:=1; w:=0;l:=0;
while a'E' do
begin
read(a);
if o=20 then readln;
m[o]:=a;
if a='W' then w:=w+1;
if a='L' then l:=l+1;
if (w>=11) or (l>=11) and (abs(w-l)>=2) then begin
write(w,' ',l); w:=0;l:=0 end;
o:=o+1;
end;
for p:=1 to o do
begin
if m[p]='W' then w:=w+1;
if m[p]='L' then l:=l+1;
if (w>=21) or (l>=21) and (abs(w-l)>=2) then begin
write(w,' ',l); w:=0;l:=0 end;
end;
end. -
02009-10-24 23:32:27@
N多Pac的 咱是C的用户来个C的~ 我晕这水题我提交了2次都不对 第三次才AC大家注意范围啊~....
#includeint main(){
char x,s[1000000];
int i,n=1,w,l;
for(;;){
scanf("%c",&x);
if (x=='E') break;
if (x=='W'||x=='L'){
s[n]=x;
n++;
}
}
w=0;
l=0;
for (i=1;i=11||l>=11)&&abs(w-l)>1){
printf("%d:%d\n",w,l);
w=0;
l=0;
}
}
printf("%d:%d\n\n",w,l);
w=0;
l=0;
for (i=1;i=21||l>=21)&&abs(w-l)>1){
printf("%d:%d\n",w,l);
w=0;
l=0;
}
}
printf("%d:%d\n",w,l);
system("pause");
return 0;
} -
02009-10-23 15:16:41@
var s:array[1..1000000] of char;
tmp:string;
b:boolean;
c,w,l,temp,d,last,lengths:longint;
begin
b:=true;
lengths:=0;
while b do
begin
readln(tmp);
if pos('E',tmp)0 then
begin
delete(tmp,pos('E',tmp),255);
b:=false;
end;
while pos(' ',tmp)0 do
delete(tmp,pos(' ',tmp),1);
for c:=1 to length(tmp) do
begin
lengths:=lengths+1;
s[lengths]:=tmp[c];
end;
end;
b:=true;
last:=1;
while b do
begin
w:=0;
l:=0;
for d:=last to lengths do
begin
if s[d]='W' then w:=w+1;
if s[d]='L' then l:=l+1;
if ((w>=11)or(l>=11))and(abs(w-l)>=2) then break;
end;
last:=d+1;
writeln(w,':',l);
if last>lengths then b:=false;
if ((w>=11)or(l>=11))and(abs(w-l)>=2)and(b=false) then
writeln('0:0');
end;
writeln;
b:=true;
last:=1;
while b do
begin
w:=0;
l:=0;
for d:=last to length(s) do
begin
if s[d]='W' then w:=w+1;
if s[d]='L' then l:=l+1;
if ((w>=21)or(l>=21))and(abs(w-l)>=2) then break;
end;
last:=d+1;
writeln(w,':',l);
if last>length(s) then b:=false;
if ((w>=21)or(l>=21))and(abs(w-l)>=2)and(b=false) then
writeln('0:0');
end;
end.
注意输出是有0:0,我自己错了2次,我的AC率! -
02009-10-22 16:55:06@
var ch:char;
s:array[1..1000000]of char;
a,b,c,d,w,l,i,j:longint;
begin
read(c);i:=0;
while ch'E'do
begin
i:=i+1;s[i]:=ch;
if ch='W'then w:=w+1;
if ch='L'then l:=l+1;
if ((w>=11)or(l>=11))and(abs(w-l)>=2)then begin
writeln(w,':',l);w:=0;l:=0;end;
read(ch);
end;
writeln(w,':',l);writeln;w:=0;l:=0;
for j:=1 to i do
begin
if s[j]='W'then w:=w+1;
if s[j]='L'then l:=l+1;
if ((w>=21)or(l>=21))and(abs(w-l)>=2)then begin
writeln(w,':',l);L:=0;W:=0;end;end;
writeln(w,':',l);
end. -
02009-10-13 21:54:47@
水題啊。。。
樓下說了要注意的地方,
我只是想說,如果要把它輸入的東西存起來,一定要用ansisting。
本人以為這個東西交了3次。
我原本已經夠可憐的正確率啊!!!
但是還是向100道邁出了一步!
-
02009-10-11 17:22:33@
Vijos Sunny 猥琐的题,猥琐的测评机
我的通过率!!!
第一个点 考的是只有E的情况
最后一个点 考的是刚好比完一场,下一场0:0情况。。。 -
02009-10-11 15:58:17@
program lx1;
var ch:char;
s:array[1..1000000] of char;
a,b,c,d,w,l,i,j
:longint;
begin
read(ch);i:=0;
while ch'E' do
begin
i:=i+1;s[i]:=ch;
if ch='W' then w:=w+1;
if ch='L' then l:=l+1;
if ((w>=11)or(l>=11))and(abs(w-l)>=2) then begin
writeln(w,':',l);w:=0;l:=0;end;
read(ch);
end;
writeln(w,':',l);writeln;w:=0;l:=0;
for j:=1 to i do
begin
if s[j]='W' then w:=w+1;
if s[j]='L' then l:=l+1;
if ((w>=21)or(l>=21))and(abs(w-l)>=2) then begin
writeln(w,':',l);w:=0;l:=0;end;
end;
writeln(w,':',l);
end. -
02009-10-10 21:22:16@
靠 交了3次都是范围不够
好不容易第四次交上去了 对了九个点 一个超时 万恶的VJSunny
Program ex;
var
c:char ;
a1,a2:array[1..1000,1..2] of longint ;
i,b1,b2:longint ;BEGIN
fillchar(a1,sizeof(a1),0) ;
fillchar(a2,sizeof(a2),0) ;
b1 := 1 ;
b2 := 1 ;
assign(input,'p1217.in') ;
reset(input) ;
read(c) ;
while c 'E' do
begin
if c = 'W' then
begin
inc(a1[b1,1]) ;
if (a1[b1,1] >= 11) and (a1[b1,1] - a1[b1,2] >= 2) then
inc(b1) ;
inc(a2[b2,1]) ;
if (a2[b2,1] >= 21) and (a2[b2,1] - a2[b2,2] >= 2) then
inc(b2) ;
end else
if c = 'L' then
begin
inc(a1[b1,2]) ;
if (a1[b1,2] >= 11) and (a1[b1,2] - a1[b1,1] >= 2) then
inc(b1) ;
inc(a2[b2,2]) ;
if (a2[b2,2] >= 21) and (a2[b2,2] - a2[b2,1] >= 2) then
inc(b2) ;
end ;
read(c) ;
end ;
close(input) ;
for i := 1 to b1 do
writeln(a1,':',a1) ;
writeln ;
for i := 1 to b2 do
writeln(a2,':',a2) ;
END . -
02009-10-08 10:18:20@
program Table(input,output);
varb: char;
i,j,d,c:integer;begin
assign(input,'Table.in');
reset(input);while b'E' do
begin
read(b);
if b='w' then c:=c+1;
if b='l' then d:=d+1;
if ((c>=11) and (c-d>=2)) or ((d>=11) and (d-c>=2)) then
begin
writeln(c,':',d);
c:=0;
d:=0;
end;
end;if c+d>=1 then writeln(c,':',d);
c:=0;
d:=0;
writeln;
close(input);
reset(input);
b:=' ';
while b'E' do
begin
read(b);
if b='w' then c:=c+1;
if b='l' then d:=d+1;
if ((c>=21) and (c-d>=2)) or ((d>=21) and (d-c>=2)) then
begin
writeln(c,':',d);
c:=0;
d:=0;
end;
end;end.
-
02009-10-08 10:11:49@
var
a:array[1..2,1..100000] of integer;
b:string;
c,d,e,f,g,h:longint;
begin
c:=1;readln(b);
while b'' do
begin
h:=1;
while (b[h]'E') and (h=11) and (e-f>=2)) or ((f>=11) and (f-e>=2))) or (d=c) then
begin
writeln(e,':',f);
e:=0;
f:=0;
end;
end;
writeln;
e:=0;
f:=0;
for d:=1 to c do
begin
e:=e+a[1,d];
f:=f+a[2,d];
if (((e>=21) and (e-f>=2)) or ((f>=21) and (f-e>=2))) or (d=c) then
begin
writeln(e,':',f);
e:=0;
f:=0;
end;
end;end.
-
02009-10-08 09:48:33@
不会,谁能写个正确的