- 求和
- 2016-08-01 12:34:06 @
// input code here
```var
m,n,i,x,y,z,ans:longint;
a,c:array[1..100000] of longint;
begin
readln(n,m);
for i:=1 to n do read(a[i]);
readln;
for i:=1 to n do read(c[i]);
for x:=1 to n-2 do
for y:=x+1 to n-1 do
begin
z:=2*y-x;
if (z<=n) and (c[x]=c[z]) then ans:=(ans+(a[x]+a[z])*(x+z)) mod 10007;
end;
writeln(ans);
end.
3 条评论
-
方晨羽 LV 9 @ 2016-08-08 14:39:51
呵呵
-
2016-08-03 16:01:40@
复杂度不行~
-
2016-08-03 16:01:38@
复杂度不行~
- 1
信息
- ID
- 1976
- 难度
- 8
- 分类
- (无)
- 标签
- 递交数
- 3003
- 已通过
- 400
- 通过率
- 13%
- 被复制
- 16
- 上传者