Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
11
Task/Equilibrium-index/XPL0/equilibrium-index.xpl0
Normal file
11
Task/Equilibrium-index/XPL0/equilibrium-index.xpl0
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
code Ran=1, ChOut=8, IntOut=11;
|
||||
def Size = 1_000_000;
|
||||
int I, S, A(Size), Hi(Size), Lo(Size);
|
||||
[for I:= 0 to Size-1 do A(I):= Ran(100) - 50;
|
||||
S:= 0;
|
||||
for I:= 0 to Size-1 do [S:= S+A(I); Lo(I):= S];
|
||||
S:= 0;
|
||||
for I:= Size-1 downto 0 do [S:= S+A(I); Hi(I):= S];
|
||||
for I:= 0 to Size-1 do
|
||||
if Lo(I) = Hi(I) then [IntOut(0, I); ChOut(0, ^ )];
|
||||
]
|
||||
Loading…
Add table
Add a link
Reference in a new issue