NCTU PCCA Winter Camp Contest 2020
===
## Contest Information
### Contest Rules
Contestants who fail to abide the rules will be disqualified.
1. A team shall consist of at most three (3) contestants.
2. No machine-readable materials (e.g., source codes, templates, etc.) are allowed. However, paper-based materials, such as textbooks, dictionaries, printed notes, etc., are allowed.
3. Contestants are only allowed to contact their teammates during the contest. Contestants shall not discuss with their coach and other teams.
4. Contestants shall only access the internet for downloading the problem description, submitting source codes, requesting problem clarification and checking the scoreboard. Any other type of internet access is prohibited.
5. A team shall not simultaneously use more than one computer to write programs during the contest. Contestant shall not use any other type of electronic devices, except extra monitors and printers.
6. All malicious actions interfering the contest are prohibited.
### Judge Environment
You may only submit in `C`, `C++`, `Java`, or `Python3`. Other programming languages are NOT accepted. The following are compiler options provided for each language.
| Language | Options |
| -------- | -------- |
| `C` | Compile: `gcc -x c -Wall -O2 -static -pipe -o "$DEST" "$@" -lm` <br> Run: `exec "$@" < "$TESTIN" > "$PROGOUT"` |
| `C++` | Compile: `g++ -std=c++14 -Wall -O2 -static -pipe -o "$DEST" "$@"` <br> Run: `exec "$@" < "$TESTIN" > "$PROGOUT"` |
| `Java` | Compile: `javac -encoding UTF-8 -sourcepath . -d . "$@"` <br> Run: `exec java -Dfile.encoding=UTF-8 -XX:+UseSerialGC -Xss${MEMSTACK}k -Xms${MEMLIMITJAVA}k -Xmx${MEMLIMITJAVA}k '$MAINCLASS' "\$@"` |
| `Python3` | Compile: `python3 -m py_compile "$@"` <br> Run: `exec python3 "$MAINSOURCE" "\$@"` |
Teams must submit their solutions via DOMjudge. Each submission will be given an ID and a timestamp of its submission time. It is guaranteed that a submission with greater ID is submitted later. The judge system will only response to submissions that is submitted within the contest duration (180 minutes). The following are some common responses from the DOMjudge.
| Judge Response | Explanation | Gives Penalty |
| -------- | -------- |---|
| `CORRECT` | The judge accepts your code. | No |
| `COMPILER-ERROR` | Your code cannot be successfully compiled. | No|
| `TIMELIMIT` | Your program consumes too much time. | Yes |
| `RUN-ERROR` | Your program terminates with an non-zero return code, which often means your program is terminated by the operating system. | Yes |
| `WRONG-ANSWER` | The judge rejects the output of your program. | Yes |
| `NO-OUTPUT` | Your program does not generate any output. | Yes |
### Scoring Rules
This contest uses the standard ICPC rules.
1. A team will get a problem solved when the judge system responds `CORRECT` to the problem's submission for the first time.
2. The time consumed for a solved problem is the time elapsed from the beginning of the contest to the submittal of the accepted run plus 20 penalty minutes for every rejected run for that problem regardless of submittal time. There is no time consumed for a problem that is not solved.
3. The time consumed for a team is the sum of the time consumed of all solved problem.
### Ranking Rules
1. Teams are ranked by the number of problem solved.
2. If there are multiple teams with the same number of problems solved, the team with less time consumed is the winner.
3. If there are multiple teams have the same number of problems and time consumed, the team with the less last run id for the submissions, which get a problem solved, is the winner.
---
### 競賽規則
違反下列規則,將導致參賽者失去參賽資格。
1. 一個隊伍最多三位參賽者。
2. 不得使用任何機器可讀的資料,如預先寫好存於電腦中的程式碼。但可以使用紙本資料,如教科書、字典、筆記以及列印好的紙本程式碼,不限頁數。
3. 在比賽過程中,參賽者只能與隊友討論。競賽期間與其他隊伍聯繫均屬於違規行為。
4. 賽者只能透過網路下載題目敘述、上傳解答程式碼、提問澄清疑點與查看計分板。使用網路存取其他資訊均屬違規行為。
5. 每個隊伍僅可使用一台電腦撰寫程式與上傳程式碼,不得使用任何其他電子裝置。
6. 不得做出任何意圖妨礙比賽進行及影響比賽公平性之惡意行為。
### 裁判系統環境
本次競賽僅提供`C`、`C++`、`Java`、`Python3`,不接受其他程式語言, 以下為各個語言所提供的編譯參數。
| 語言 | 編譯參數 |
| -------- | -------- |
| `C` | 編譯: `gcc -x c -Wall -O2 -static -pipe -o "$DEST" "$@" -lm` <br> 執行: `exec "$@" < "$TESTIN" > "$PROGOUT"` |
| `C++` | 編譯: `g++ -std=c++14 -Wall -O2 -static -pipe -o "$DEST" "$@"` <br> 執行: `exec "$@" < "$TESTIN" > "$PROGOUT"` |
| `Java` | 編譯: `javac -encoding UTF-8 -sourcepath . -d . "$@"` <br> 執行: `exec java -Dfile.encoding=UTF-8 -XX:+UseSerialGC -Xss${MEMSTACK}k -Xms${MEMLIMITJAVA}k -Xmx${MEMLIMITJAVA}k '$MAINCLASS' "\$@"` |
| `Python3` | 編譯: `python3 -m py_compile "$@"` <br> 執行: `exec python3 "$MAINSOURCE" "\$@"` |
隊伍必須透過DOMjudge上傳自己的程式碼, 裁判系統對於每次提交會給予一個編號和時間戳記, 可以保證比較大的編號代表比較晚的提交。裁判系統只會回應在比賽時間內(180分鐘)所提交的程式碼。以下為裁判系統常見的回應。
| 裁判系統回應 | 解釋 | 罰時|
| -------- | -------- |-- |
| `CORRECT` | 裁判系統接受程式 |否|
| `COMPILER-ERROR` | 程式無法被成功編譯 |否|
| `TIMELIMIT` | 程式花費過多時間 |是|
| `RUN-ERROR` | 程式結束的`return code`為非零值, 通常為執行時被作業系統所中止 |是|
| `WRONG-ANSWER` | 程式輸出不符合裁判系統要求 |是|
| `NO-OUTPUT` | 程式沒有任何輸出 |是|
### 計分規則
本次競賽採用國際大學程式競賽(ICPC)計分規則
1. 隊伍在某題第一次獲得裁判系統回應`CORRECT`時增加一個解題數。
2. 當隊伍增加一個解題數時會計算解該題所消耗的時間, 該題的消耗時間計算方式為比賽開始至解出該題所消耗的分鐘數, 若解出該題前有答錯時,每答錯一次增加`20`分鐘的罰時, `COMPILER-ERROR`不計罰時。
3. 一個隊伍的總消耗時間為所有獲得裁判系統回應`CORRECT`的題目各別消耗的時間加總。
### 排名規則
1. 解題數量比較多的排名較前。
2. 相同解題數時, 總消耗時間較小的排名較前。
3. 相同題目, 相同總消耗時間時, 則依據每隊最後一次獲得解題數時該程式碼的`Run ID`決定, `Run ID`較小的排名在前。