Croatian Open Competition in Informatics

The 1st Croatian Open Competition in Informatics results (Indonesian contestants) :

| Rank | Position | Score | Name |
5 7 186 Brian Marshal
15 21 96 Timotius Nugroho Chandra
22 34 71 Anggakara Hendra
25 41 65 Ricky Winata
26 45 62 James Edward
28 47 59 Aldrian Obaja -> OSN 2007 math gold medalist
28 47 59 Kristanto S
30 52 53 Reinardus Surya P. -> Retry for 123
31 53 50 Muhammad Irfan Alfarabbi
40 74 20 Sam Aryasa
41 89 8 Felix Halim -> Disappointed with the tasks (too easy).
42 90 0 Angelina Veni -> Retry  for 61

There were only 9 contestants among they who will go to the 1st national training camp, why? And I’m a little bit disappointed with the result. Well, hoping better performance later…

November 1, 2007

9 responses to Croatian Open Competition in Informatics

  1. vN said:

    beuh jadi malu kak :( left it in the middle of the competition, too exhausted after CC@G :( anyway, i’ve made it yesterday w/out trial and error, i scored 61. not really good though, but not 0 :)

  2. Reinardus said:

    hmm… sebenernya, gw srednji uda slese, tapi pas tinggal 12 DETIK… Ga sempet submit. Gw coba di analysis, trnyata bener skali tembak… Jadi harusnya 53+70 = 123… Eh, trnyata srednji itu O(n) ya?

  3. admin said:

    Well, it’s great Reinardus (you got the gold in OSN 2007, right?)…
    Yes, you can solve “srednji” at linear time, judge’s solution and mine were same. Here’s my Pascal code:

    Program srednji;
    var hasil,tmp,h,l,i,n,b:longint;
    data:array[1..100001]of longint;
    xa,xb:array[-100001..100001]of longint;

    begin
    readln(n,b);
    for i:=1 to n do
    begin
    read(data[i]);
    if data[i]=b then tmp:=i;
    end;
    fillchar(xa,sizeof(xa),0);
    fillchar(xb,sizeof(xb),0);
    xa[0]:=1;h:=0;l:=0;
    for i:=tmp-1 downto 1 do
    begin
    if (data[i]>b) then inc(h) else inc(l);
    inc(xa[h-l]);
    end;
    xb[0]:=1;h:=0;l:=0;
    for i:=tmp+1 to n do
    begin
    if (data[i]>b) then inc(h) else inc(l);
    inc(xb[h-l]);
    end;
    hasil:=0;
    for i:=-100001 to 100001 do hasil:=hasil+xa[i]*xb[-i];
    writeln(hasil);
    end.

  4. Reinardus said:

    Duh salah

    var
    ar:array[0..100001]of longint;
    bnyk:array[-100001..100001]of longint;
    tot,n,m,i,z,y:longint;
    med:boolean;

    begin
    readln(n,m);
    med:=false;
    z:=0;
    for i:=1 to n do
    begin
    read(ar[i]);
    if ar[i]=m then
    begin
    y:=i;
    med:=true;
    end;
    if med then
    begin
    if ar[i]>m then inc(z);
    if ar[i]m then dec(z);
    if ar[i]<m then inc(z);
    tot:=tot+bnyk[z];
    end;
    writeln(tot);
    end.

  5. admin said:

    Good, such a smart code…
    Well, it’s ok to post a long comment here.

  6. Reinardus said:

    hmm… koq agak sulit ya menulis potongan kode…

    Pokoknya gini
    1. baca dulu smua, sambil baca, yg ada di sbelah kanan median dikasi nilai (klo lbh dari +1, klo kurang -1)…
    2. diliat dari median downto 1, trus dikasi nilai (kebalikannya dari yg prtama, klo lbh dari -1, klo kurang +1). Trus panggil nilai di array indeks ke sekian

    nilai2 ar[z] (ar[-100001..100001] itu menyimpan ad berapa banyak kasus yg (bnyk angka yg > median – bnyk angka yg < median)=z

    yah, kira2 gitu deh… T_T

    Oh, admin itu kk Brian ya?

  7. Reinardus said:

    coba lagi ya? terakhir deh nih…

    [code]
    var
    ar:array[0..100001]of longint;
    bnyk:array[-100001..100001]of longint;
    tot,n,m,i,z,y:longint;
    med:boolean;

    begin
    readln(n,m);
    med:=false;
    z:=0;
    for i:=1 to n do
    begin
    read(ar[i]);
    if ar[i]=m then
    begin
    y:=i;
    med:=true;
    end;
    if med then
    begin
    if ar[i]>m then inc(z);
    if ar[i]m then dec(z);
    if ar[i]<m then inc(z);
    tot:=tot+bnyk[z];
    end;
    writeln(tot);
    end.
    [/code]

  8. admin said:

    Yes, I am the admin here…

  9. Reinardus said:

    Well I must say that you are playing a nice host… You really know how to welcome people warmly. Such an interactive blog you we have here…

Leave a Reply

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>