- 连续数之和
- 2016-07-14 16:14:52 @
数据太TM**可怕**了
居然必须要**int64**
不然还会**RUNTIMEERROR**
有毒啊!!
```pascal
program adding;
var n,k,i,t,ans:longint;
num:int64;
b:array[0..100000]of longint;
begin
readln(n,k);
num:=0;
fillchar(b,sizeof(b),0);
for i:=1 to n do
begin
readln(t);
inc(num,t);
inc(b[num mod k]);
end;
num:=b[0];
for i:=0 to k-1 do
num:=(num+(b[i]*(b[i]-1)) shr 1)mod 1234567;
writeln(num);
end.
1 条评论
-
刘锦钰是超神.. LV 8 @ 2016-11-16 15:12:57
请不要将题解发到讨论区
请发到题解区
- 1