您的位置:首页 > 其它

codevs1059

2015-07-22 14:35 363 查看
题目地址:http://codevs.cn/problem/1059/

分析:

模拟

代码:

var

t,t1:boolean;

n,i,j,c:longint;

a,b:array[1..1000] of longint;

begin

readln(n);

for i:=1 to n do read(a[i]);

for i:=n+1 to 2*n do a[i]:=a[i-n];

for i:=1 to n do read(b[i]);

for i:=n+1 to 2*n do b[i]:=b[i-n];

for i:=1 to n do

begin

c:=0;

t:=true;

for j:=i to n+i-1 do

if a[j]+c<b[j] then begin t:=false; break end

else c:=a[j]+c-b[j];

if t then begin t1:=true; write(i,' '); end;

end;

if not t1 then write('No Result!');

end.
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: