codevs1059

来源:互联网 发布:什么是谷歌seo 编辑:程序博客网 时间:2024/04/30 00:35

题目地址: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.

0 0
原创粉丝点击