Online JudgeProblem SetAuthorsOnline ContestsUser
Web Board
Home Page
F.A.Qs
Statistical Charts
Problems
Submit Problem
Online Status
Prob.ID:
Register
Update your info
Authors ranklist
Current Contest
Past Contests
Scheduled Contests
Award Contest
User ID:
Password:
  Register

PASCAL!

Posted by 875319120 at 2012-09-09 08:59:13 on Problem 3427
var
  n,l,i,min,min2,j,now:longint;
  a:array[1..30000]of longint;
begin
  readln(n,l);
  min:=maxlongint;
  for i:=1 to n do
  read(a[i]);
  for i:=1 to l do
    begin
      now:=0;
      for j:=1 to n do begin now:=now+a[j] mod l; inc(a[j]); end;
      if min>now then begin min:=now; min2:=i; end;
    end;
  writeln(min2-1);
end.

Followed by:

Post your reply here:
User ID:
Password:
Title:

Content:

Home Page   Go Back  To top


All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator