Tento dokument obsahuje oficiálne pravidlá súťaže v rýchlostnom programovaní v rámci IIT.SRC, ktorej usporiadateľom je Fakulta informatiky a informačných technológií Slovenskej technickej univerzity v Bratislave (FIIT STU). Súťaž je určená pre študentov FIIT STU.
1 Všeobecné ustanovenia
Súťaž v rýchlostnom programovaní v rámci IIT.SRC je určená pre študentov dennej formy štúdia na FIIT STU. Pravidlá tejto súťaže vznikli na základe pravidiel medzinárodnej programátorskej súťaže ACM.
2 Kto sa môže súťaže zúčastniť
Súťaž v rámci IIT.SRC je súťaž jednotlivcov spomedzi študentov dennej formy štúdia na FIIT STU.
3 Registrácia
Súťaže sa môžu zúčastniť len zaregistrovaní účastníci. Účastníci, ktorí spĺňajú podmienky súťaže sa môžu zaregistrovať v elektronickom systéme pre organizáciu súťaže iba v čase podľa harmonogramu súťaže. Počet jednočlenných tímov, ktoré sa môžu zaregistrovať, je obmedzený.
4 Priebeh súťaže
Súťaž bude prebiehať na určenom mieste v priestoroch fakulty a bude trvať 2 hodiny. Na riešenie budú 4 problémy. Riešenia problémov možno odovzdať iba od začiatku súťaže do termínu ukončenia súťaže podľa harmonogramu.
Cieľom súťaže bude vytvoriť počítačové programy ako správne riešenia čo najväčšieho počtu problémov a prostredníctvom systému ich odovzdať v čo najkratšom čase. Ako riešenie sa odovzdáva zdrojový súbor programu napísaný v programovacom jazyku Pascal, C alebo C++. Program nemôže závisieť od prítomnosti žiadneho externého súboru a ani nemôže žiadny takýto súbor vytvárať. Vstup sa načítava zo štandardného vstupu (klávesnica) a výstup sa vypisuje na štandardný výstup (obrazovka), pozri časť 6. Každé riešenie môže byť zapísané v ľubovoľnom z uvedených programovacích jazykov bez ohľadu na predošlé odovzdané riešenia.
Odovzdané programy sa v systéme automaticky skompilujú, vykonajú a otestuje sa ich vstupno-výstupné správanie. Každé odoslané riešenie sa potom buď prijme ako vyhovujúce alebo sa zamietne. Ak bude riešenie zamietnuté, je možné odovzdať ďalšie riešenie. Za nevyhovujúce riešenia je súťažiaci penalizovaný. Celú túto činnosť automaticky bez zásahu človeka (avšak pod dozorom rozhodcov) vykoná a výsledok otestovania odovzdaného riešenia bude súťažiacim prezentovať elektronický systém pre organizáciu súťaže formou správy. Zoznam všetkých správ systému a spôsob hodnotenia je uvedený v časti Hodnotenie riešení.
Na priebeh súťaže a automatické vyhodnocovanie riešení dozerajú rozhodcovia. Rozhodcami sú členovia akademickej obce FIIT (študenti aj zamestnanci). Rozhodcovia majú konečnú právomoc rozhodovať, či sú uvedené riešenia správne, alebo nie. Proti rozhodnutiu rozhodcov sa nie je možné odvolať.
V prípade problémov s porozumením zadaní alebo so systémom, sa môžu súťažiaci opýtať rozhodcov prostredníctvom elektronickej nástenky. Pokiaľ rozhodcovia uznajú, že nejasnosť v zadaní skutočne existuje, budú o nej informovaní všetci súťažiaci.
Celkové priebežné výsledky súťaže budú zverejňované na v systéme pre organizovanie súťaží počas celej súťaže okrem posledných 40 minút.
Súťažiaci môžu používať všetku dostupnú literatúru a vytlačené materiály.
5 Programovacie jazyky
Všetky programy budú testované pod operačným systémom FreeBSD 5.2-RC1.
Programy v Pascale budú kompilované pomocou Free Pascal Compiler verzia 1.0.6.
Programy v C a C++ budú kompilované pomocou gcc verzia 3.3.3, ktoré vyžaduje štandardy:
- C: ANSI "C89" = ISO "C90" (podľa normy ANSI X3.159-1989, ISO/IEC 9899:1990)
- C++: ISO/IEC 14882:1998
6 Povolené a zakázané funkcie
Súťažiaci majú povolené používať len obmedzenú podmnožinu funkcií poskytovaných programovacími jazykmi. Vo všeobecnosti je možné používať všetky funkcie, ktoré sú používané pre štandardný vstup (napr. pre C: scanf, sscanf, getchar, gets, pre Pascal: read, readln), vytváranie štandardného výstupu (napr. pre C: printf, putchar, pre Pascal: write, writeln - bez súboru), prácu s pamäťou (napr. pre C: malloc, free, pre Pascal: new, dispose) a matematickými výpočtami (napr. sqrt, qsort) a prácu s reťazcami (napr. strcmp, strcpy).
Nie je povolené:
- otvárať súbor iný ako štandardný vstup a štandardný výstup (napr. pre C: open, fopen, pre Pascal: append, reset)
- používať viac ako jeden proces (napr. pre C: signal, fork)
- používať akékoľvek sieťové prostriedky (napr. pre C: socket).
Zoznam povolených hlavičkových súborov a zakázaných funkcíí bude uvedený v systéme pre organizovanie súťaží ("Informácie o súťaži", "Program. jazyky" a klik na ikonku "Zakázané funkcie a povolené knižnice").
7 Hodnotenie riešení
Výsledok testovania odovzdaného riešenia má podobu práve jednej správy z:
Správa | Význam |
Chyba pri kompilovaní | Nepodarilo sa preložiť zaslaný zdrojový kód. |
Chyba pri behu programu | Program bol úspešne preložený, ale počas výpočtu sa zrútil (napríklad kvôli deleniu nulou, zlému prístupu do pamäte, minutie zásobníku pri rekurzii, apod.). |
Vypršanie časového limitu | Program bol úspešne preložený a spustený, ale neskončil počas požadovaného časového limitu. Buď sa v ňom vyskytol nekonečný cyklus, alebo bol použitý málo efektívny algoritmus. |
Zlá odpoveď | Program sa začal vykonávať, skončil a vytvoril nejaké (poprípade aj žiadne) výsledky, ale tieto výsledky nie sú správne. |
Prezentačná chyba | Program skončil a vypísal nejaké výsledky, ktoré sa zdajú byť v poriadku. Ich tvar však nie je presne taký, ako bol požadovaný v zadaní. Často ide o preklep, vynechanú medzeru vo výstupe a podobne. Takisto môže ísť v skutočnosti o zlú odpoveď - jednoducho je výstup programu podobný korektnému (napr. namiesto "DA SA" vypísal "NEDA SA" - je to nesprávne, ale z pohľadu vyhodnocovača podobné). |
Akceptovaný | Program je uznaný za správny. Daný problém sa považuje za úspešne vyriešený. |
Volanie nepovolenej funkcie | Súťažiaci sa pokúsil použiť niektorú z nepovolených funkcií programovacieho jazyka. |
Porušenie pravidiel | Táto odpoveď sa použije, keď rozhodcovia zistia nejaké iné porušenie pravidiel alebo nesplnenie zadania. |
Iba správa Akceptovaný znamená, že sa riešenie prijalo ako vyhovujúce. Všetky ostatné správy znamenajú zamietnutie riešenia. Pre každý problém, ktorý bude nakoniec Akceptovaný, sa počíta čas v sekundách od začiatku súťaže po okamih, kedy bol úspešne odovzdaný. Za každé (predchádzajúce) nesprávne odovzdanie riešenia problému sa do celkového času pre tento problém pripočítava penalizácia 10 minút.
8 Hodnotenie súťaže
Súťažiaci sú hodnotení podľa počtu odovzdaných správnych riešení. Teda vo výslednom rebríčku sú súťažiaci zoradení podľa počtu vyriešených problémov (čím viac vyriešených problémov, tým lepšie umiestnenie). V prípade, že viac súťažiacich vyrieši rovnaký počet problémov, títo sa zoradia podľa súčtu celkových časov pre správne vyriešené problémy vrátane penalizácií za odovzdané nesprávne riešenia (čím kratší čas, tým lepšie umiestnenie). Za problémy, ktoré neboli nakoniec správne odovzdané, sa penalizácie nepripočítavajú.
9 Fair-play
Súťažiaci sa pri registrácii zaväzujú dodržiavať pravidlá súťaže. V prípade zistenia akéhokoľvek porušenia pravidiel bude súťažiaci diskvalifikovaný.