Saratov State University :: Online Contester


::Go
- home
- news
- register
- update personal info
- problemset archive
- submit
- status online
- standing
- contests
- virtual contests
- forum
- statistic
- FAQ
- links
- projects

::Poll
Are you registered on Codeforces?
Yes
No
What is it???

[results]

::webboard

Why Runtime Error on test 19
Author: logistic111
ID: 053132
Problem: 230
Contest: 0
Date: 2012-07-25 16:34:13

var
c,rty:array[0..100,0..100]of longint;
st,q:array[0..1000000]of byte;
g,st1:array[0..100]of byte;
f:array[0..100]of boolean;
str,q2,q1,mini,d,n,m,a,b,i,j,k,min,stn:longint;
begin
{ assign(input,'a.in');
reset(input);
assign(output,'a.out');
rewrite(output); }
readln(n,m);
stn:=0;
fillchar(c,sizeof(c),63);
fillchar(rty,sizeof(rty),63);
for i:=1 to n do c[0,i]:=1;
for i:=1 to m do
begin
readln(b,a);
c[a,b]:=1;
rty[a,b]:=1;
end;
for k:=1 to n do
for i:=1 to n do
for j:=1 to n do if (rty[i,j])>(rty[i,k]+rty[k,j]) then
rty[i,j]:=rty[i,k]+rty[k,j];
for i:=1 to n do for j:=1 to n do
if (rty[i,j]<1000000000)and(rty[j,i]<1000000000) then
begin
writeln('No solution');
halt;
end;
q2:=0;
q1:=0;
while 0=0 do
begin
if q2>q1 then break;
for j:=1 to n do if c[q[q2],j]=1 then
begin
inc(stn);
st[stn]:=j;
inc(q1);
q[q1]:=j;
end;
inc(q2);
end;
str:=n;
for i:=stn downto 1 do if f[st[i]]=false then
begin
st1[str]:=st[i];
f[st[i]]:=true;
dec(str);
end;
for i:=1 to n do g[st1[i]]:=n-i+1;
for i:=1 to n do write(g[i],' ');
end.

see sub-tree reply to that message


::Login
Forgot password?

::News
22.10.12 - The problems from the Southern Subregional Programming Contest 2012 added to the problemset archive (542 - 553).
22.10.12 - After the start of the contest the statements in PDF will be available by the link.
23.10.11 - The problems from the Southern Subregional Programming Contest 2011 added to the problemset archive (530 - 541).

::Counter

Server time: 2017-09-21 11:03:13Online Contester Team © 2002 - 2016. All rights reserved.