197 条题解
-
0Xu Taotao LV 9 @ 2009-07-23 15:03:41
program dsa;
var n,m,z,x,i:integer;
step:longint;
a:array[1..200] of integer;
f:boolean;
begin
read(n,m);
z:=1;
x:=0;
fillchar(a,sizeof(a),1);
while xn then
begin
f:=true;
break;
end;
end;
if f then
begin
z:=1;
for i:=1 to step do
begin
while a[z+1]=0 do inc(z);
inc(z);
if z>n then
begin
f:=true;
break;
end;
end;
end;
a[z]:=0;
if x=m then begin write(z);exit;end
else inc(z);
end;
end.农夫山泉
-
02009-07-23 09:28:00@
编译通过...
├ 测试数据 01:答案正确... 0ms
├ 测试数据 02:答案正确... 0ms
├ 测试数据 03:答案正确... 0ms
├ 测试数据 04:答案正确... 0ms
├ 测试数据 05:答案正确... 0ms
├ 测试数据 06:答案正确... 0ms
├ 测试数据 07:答案正确... 0ms
├ 测试数据 08:答案正确... 0ms
├ 测试数据 09:答案正确... 0ms
├ 测试数据 10:答案正确... 0ms
---|---|---|---|---|---|---|---|-
Accepted 有效得分:100 有效耗时:0ms -
02009-07-22 18:08:19@
编译通过...
├ 测试数据 01:答案正确... 0ms
├ 测试数据 02:答案正确... 0ms
├ 测试数据 03:答案正确... 0ms
├ 测试数据 04:答案正确... 0ms
├ 测试数据 05:答案正确... 0ms
├ 测试数据 06:答案正确... 0ms
├ 测试数据 07:答案正确... 0ms
├ 测试数据 08:答案正确... 0ms
├ 测试数据 09:答案正确... 0ms
├ 测试数据 10:答案正确... 0ms
---|---|---|---|---|---|---|---|-
Accepted 有效得分:100 有效耗时:0msprogram p1078(input,output);
var ab:array [0..210] of boolean;
n,m,i,f,guo:longint;
function find(k,j:longint):longint;
var i:longint;
begin
for i:=1 to j do
begin
k:=k+1;
while (not ab[k]) do
k:=k+1;
end;
if k>n then find:=0
else find:=k;
end;
begin
readln(n);
readln(m);
for i:=0 to 210 do
ab[i]:=true;
guo:=1;
for i:=1 to m do
begin
f:=find(guo,(i*i*i mod 5)+1);
if f0
then begin
ab[f]:=false;
guo:=find(f,1);
end
else begin
guo:=find(0,1);
f:=find(guo,(i*i*i mod 5)+1);
ab[f]:=false;
guo:=find(f,1);
end;
end;
writeln(f);
end.又AC一水题,Yeah!
-
02009-07-21 19:59:23@
var
n,m :longint;
a :array[1..500]of longint;
i,j :longint;
step :longint;
dir :longint;
ans :longint;
begin
readln(n);readln(m);
for i:=1 to n do
a[i]:=i;
dir:=1;
for i:=1 to m do begin
step:=((i*i*i) mod 5)+1;
dir:=dir+step;
if dir -
02009-07-17 09:21:06@
编译通过...
├ 测试数据 01:答案正确... 0ms
├ 测试数据 02:答案正确... 0ms
├ 测试数据 03:答案正确... 0ms
├ 测试数据 04:答案正确... 0ms
├ 测试数据 05:答案正确... 0ms
├ 测试数据 06:答案错误...程序输出比正确答案长
├ 测试数据 07:答案正确... 0ms
├ 测试数据 08:答案正确... 0ms
├ 测试数据 09:答案正确... 0ms
├ 测试数据 10:运行时错误...|错误号: -1073741571program songshuchiguozi;
type
arr=array[1..100]of integer;
var
a:arr;
n,m,i,b,s:integer;
procedure che(var a:arr);
var i:integer;
begin
for i:=b to n do a[i]:=a;
end;
begin
readln(n);
readln(m);
b:=1;
for i:= 1 to n do a[i]:=i;
for i:= 1to m do begin
s:=(i*i*i)mod 5+1;
b:=b+s;
if i -
02009-07-16 19:57:58@
var used:array[0..200]of boolean;
n,m,i,j,k,count,p:longint;
begin
fillchar(used,sizeof(used),false);
readln(n,m);
k:=1;
for i:=1 to m do begin
for j:=k to n do begin
count:=0;
if used[j]=false then inc(count);
end;
if count0 do begin
k:=k+1;
if used[k]=false then p:=p-1;
end;
used[k]:=true;
end;
writeln(k);
end. -
02009-07-13 20:00:03@
#include
using namespace std;
int main ()
{
int i,j,n,m,k,l,ss=0,h;
int a[201];
cin>>n>>m;
for (i=1;i -
02009-07-11 11:52:20@
模拟,我就不说什么了
还是很考验RP的,要小心,i>m,还有一些边界情况要考虑一下
最重要的发现是 FP中i*i*i可以写i**3, vijos里不能 :NO Compiled
今天WA了五道了。。。总算过了,增强信心 -
02009-07-10 16:58:40@
VAR
I,J,N,LOW,HIGH:LONGINT;
L,M:ARRAY[0..1000] OF LONGINT;
F:ARRAY[0..1000,0..1000] OF LONGINT;
BEGIN
ASSIGN(INPUT,'MWAND.IN');
RESET(INPUT);
ASSIGN(OUTPUT,'MWAND.OUT');
REWRITE(OUTPUT);
READLN(N,LOW,HIGH);
FOR I:=1 TO N DO
READ(L);
FOR I:=2 TO N DO
L:=L+L;
READLN;
FOR I:=1 TO N DO
READ(M);
FOR I:=2 TO N DO
M:=M+M;
FOR I:=1 TO N DO
FOR J:= I DOWNTO 0 DO
BEGIN
F:=F;
IF F>F THEN F:=F;
IF (L-L=LOW) AND (M-M+F>F) THEN
F:=M-M+F;
END;
WRITELN(F[N,0]);
CLOSE(INPUT);
CLOSE(OUTPUT);
END. -
02009-07-09 09:46:10@
沙茶题留名……
-
02009-07-01 15:18:03@
记录号 Flag 得分 记录信息 环境 评测机 程序提交时间
R1286807 Accepted 100 From zouxiangmin-
P1078 FPC Vivid Puppy 2009-7-1 15:16:42From ken_carter
松鼠吃果子编译通过...
├ 测试数据 01:答案正确... 0ms
├ 测试数据 02:答案正确... 0ms
├ 测试数据 03:答案正确... 0ms
├ 测试数据 04:答案正确... 0ms
├ 测试数据 05:答案正确... 0ms
├ 测试数据 06:答案正确... 0ms
├ 测试数据 07:答案正确... 0ms
├ 测试数据 08:答案正确... 0ms
├ 测试数据 09:答案正确... 0ms
├ 测试数据 10:答案正确... 0ms
---|---|---|---|---|---|---|---|-
Accepted 有效得分:100 有效耗时:0msvar a:array[1..200]of integer;i,j:integer;
temp:integer;iiim51,n,m:integer;
begin
readln(n);readln(m);
for i:=1 to n do a[i]:=i;temp:=1;
for i:=1 to m-1 do begin
iiim51:=(i mod 5)*(i mod 5)*(i mod 5)mod 5+1;
if temp+iiim51>n-i+1 then temp:=1;
temp:=temp+iiim51;for j:=temp to n-i do a[j]:=a[j+1];
a[n-i+1]:=0;
end;
iiim51:=(m mod 5)*(m mod 5)*(m mod 5)mod 5+1;
if temp+iiim51>n-m+1 then temp:=1;
temp:=temp+iiim51;
writeln(a[temp]);
end.Flag Accepted
题号 P1078
类型(?) 其它
通过 2840人
提交 6072次
通过率 47%
难度 1 -
02009-06-30 07:16:22@
模拟题,只要处理好细节就行了。没有让松鼠重复跳跃而吃不到果子的BT数据,放心做就行了.
-
02009-06-19 21:22:48@
Accepted 有效得分:100 有效耗时:0ms
完全bool数组模拟 挺讨厌模拟题的。麻烦 用的while do。烦死了
-
02009-05-25 18:28:53@
编译通过...
├ 测试数据 01:答案正确... 0ms
├ 测试数据 02:答案正确... 0ms
├ 测试数据 03:答案正确... 0ms
├ 测试数据 04:答案正确... 0ms
├ 测试数据 05:答案正确... 0ms
├ 测试数据 06:答案正确... 0ms
├ 测试数据 07:答案正确... 0ms
├ 测试数据 08:答案正确... 0ms
├ 测试数据 09:答案正确... 0ms
├ 测试数据 10:答案错误... ├ 标准行输出
├ 错误行输出
---|---|---|---|---|---|---|---|-
var
k,i,n,m,x:longint;
f,z:string;
begin
readln(n,m);
for i:=1 to n do
begin
if ilength(f) then x:=1;
x:=x+k;
z:=copy(f,(x-1)*3+1,3);
delete(f,(x-1)*3+1,3);
end;
val(z,m);
end.
WHY? -
02009-05-24 18:24:01@
编译通过...
├ 测试数据 01:答案正确... 0ms
├ 测试数据 02:答案正确... 0ms
├ 测试数据 03:答案正确... 0ms
├ 测试数据 04:答案正确... 0ms
├ 测试数据 05:答案正确... 0ms
├ 测试数据 06:答案正确... 0ms
├ 测试数据 07:答案正确... 0ms
├ 测试数据 08:答案正确... 0ms
├ 测试数据 09:答案正确... 0ms
├ 测试数据 10:答案正确... 0ms
---|---|---|---|---|---|---|---|-
Accepted 有效得分:100 有效耗时:0msprogram p1078;
var a:array[1..200] of string[3];
n,m,i,c,j,q:integer; b:longint;
begin
readln(n);
readln(m); c:=1;
for i:=1 to n do
str(i,a[i]);
for i:=1 to m-1 do
begin
b:=((i*i*i)mod 5 )+1;
if (c+b) -
02009-04-28 17:35:14@
var
n,m,p,a,i,k:longint;
r:array[1..220] of longint;
begin
readln(n,m);
for p:=1 to n do r[p]:=p;
a:=1;
for p:=1 to m do begin
k:=(p*p*p) mod 5+1;
if a+k>n then a:=1;
a:=a+k;
if pm then begin
for i:=a to n-1 do
r[i]:=r;
n:=n-1;
end;
end;
writeln(r[a]);
readln;
end. -
02009-04-28 17:33:30@
var
n,m,p,j,i,k:longint;
r:array[1..220] of longint;
begin
readln(n,m);
for p:=1 to n do r[p]:=p;
b:=1;
for p:=1 to m do begin
k:=(p*p*p) mod 5+1;
if j+k>n then j:=1;
j:=j+k;
if pm then begin
for i:=j to n-1 do
r[i]:=r;
n:=n-1;
end;
end;
writeln(r[j]);
readln;
end. -
02009-04-28 17:30:38@
var m,n,i,x,y,k:longint;
r:array[1..100] of longint;
begin
read(m,n);
for i:=1 to n do r[i]:=i;
y:=1;
for i:=1 to m do begin
x:=(i*i*i)mod 5+1;
if x+y>n then x:=1;
x:=x+y;
if im then begin
for k:=x to n-1 do
r[k]:=r[k+1];
n:=n-1;
end;end;
write(r[x]);
end. -
02009-04-26 21:17:39@
program ex1;
var
n,m:longint;
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|--
procedure work;
var
i,start,pos,step:longint;
vis:array[1..1000]of boolean;
begin
for i:=1 to n do
vis[i]:=true;
start:=1;
for i:=1 to m do
begin
step:=(i*i*i mod 5)+1;
pos:=start+step;
if vis[pos] then
begin
vis[pos]:=false;
dec(n);
start:=pos+1;
end
else
begin
start:=1;
pos:=start+step;
if vis[pos] then
begin
vis[pos]:=false;
dec(n);
start:=pos+1;
end;
end;
end;
writeln(pos);
end;
---|---|---|---|---|---|---|---|---|---|---|---|---|-
begin
readln(n);
readln(m);
work;
end.
不知道对不对……唉 -
02009-04-16 16:46:55@
题题题题题题题题题题题题题题题题题题题题题题题题题题题题题题题题题题题题题
题题题题题题题题题题题题题题题题题题题题题题题题题题题题水水水水题题题题题
题题题题题题题题题题题题题题题题题题题题题题题题水水水水水水水水水题题题题
题题题题题题题题题题题题题题题题题题水水水水水水水水水水水水水水水题题题题
题题题题题题题题题题题题题题题题水水水水水水水水水水水水水水水题题题题题题
题题题题题题题题题题题水水水水题水水水水水水水水水水水题题题题题题题题题题
题题题题题题题题水水水水水水水题水水水题题水水水水水题题题题题题题题题题题
题题题水水水水水水水水水水水水题题题题题题水水水水题题题题题题题题题题题题
题水水水水水水水水水水水水水水题题题题题题水水水水题题题题题题题题题题题题
题水水水水水水水水水水水水题题题题题题题水水水水水水水水水水水题题题题题题
题水水水水水水水水水水水水题题题题题题水水水水水水水水水水水水水水题题题题
题题水水水水水水水水水水题题题题题水水水水水水题题题水水水水水水水题题题题
题题题题题题题题水水水水题题题题题水水水水题题题题题题水水水水水题题题题题
题题题题题题题题水水水水题题题题水水水水题题水水题题题水水水水水题题题题题
题题题题题题题题水水水水题题题题水水水水题题水水水水题水水水水水题题题题题
题题题题题题题题水水水水题题题题水水水水题题水水水水题水水水水水题题题题题
题题题题题题题题水水水水题题题题水水水水题题水水水题题水水水水水题题题题题
题题题题题题题题水水水水题题题题水水水水题题水水水题题水水水水水题题题题题
题题题题题题题题水水水水题题题题水水水水题水水水水题题水水水水水题题题题题
题题题题题题题题水水水水题题题题水水水水题水水水水题题水水水水水题题题题题
题题题题题题题题水水水水题题题题水水水水题水水水水题题水水水水水题题题题题
题题题题题题题题水水水水题题题题水水水水题水水水水题题水水水水水题题题题题
题题题题题题题题水水水水题题题题水水水题题水水水水题题水水水水水题题题题题
题题水水题题题水水水水水题题题题水水水题题水水水题题题水水水水水题题题题题
题题水水水水水水水水水水题题题题题水水题题水水题题题题水水水水水题题题题题
题题题水水水水水水水水水题题题题题题题题水水水题题题题水水水水题题题题题题
题题题题题水水水水水水水题题题题题题题题水水水题水水水水题题题题题题题题题
题题题题题题水水水水水水题题题题题题题水水水水题题水水水水题题题题题题题题
题题题题题题题题题水水水题题题题题题水水水水水题题题水水水水水水水题题题题
题题题题题题题题题题题题题题题题水水水水水水题题题题题水水水水水水题题题题
题题题题题题题题题题题题题题题水水水水水水题题题题题题水水水水水水水题题题
题题题题题题题题题题题题题题水水水水水题题题题题题题题题水水水水水水题题题
题题题题题题题题题题题题题水水水水水题题题题题题题题题题题水水水水题题题题
题题题题题题题题题题题题水水水题题题题题题题题题题题题题题题水水水题题题题
题题题题题题题题题题题题题题题题题题题题题题题题题题题题题题题题题题题题题( 2008-12-17 12:33:36 )