-
Notifications
You must be signed in to change notification settings - Fork 12
Contest
There are three scoring modes to choose from, which determines how the scores and rankings on the dashboard is calculated:
- IOI style: The users are ranked by their total score across all problems. The score of a problem is determined by selecting the highest score among all submissions. Only the scores matter, and the verdicts are not considered.
- New IOI style: Same as IOI style, but the score of a problem is calculated by summing the subtask scores, where the score of a subtask is also determined by selecting the highest score among all submissions. In other words, it takes the "union" of the highest-scoring submissions by subtasks.
- ACM style: The users are ranked by (number of solved problems, -penalty, -time of the first AC in the last accepted problem). The penalty is calculated by the sum of (floor(duration after the contest start of the first AC submission in minutes) + 20 * number of non-CE submissions before the first AC submission) among each solved problems. Only the verdicts matter, and the scores are not considered.
The scoring mode can be changed at any time and the dashboard will update accordingly. No rejudge is needed.
In TIOJ, each contest has a normal contest page and a Single Contest page. To access the Single Contest page, click the Go to Single Contest page button on the contest's index page. The Single Contest page differs from the normal contest page in several ways:
- Each Single Contest page uses independent user sessions. That is, the login status within the current Single Contest page remains unaffected by any login/logout activities on the main website or on other Single Contest pages.
- Only registered users and contest users (contest-specific batch-generated users that cannot login to the main website) of the contest can login.
- If the name of a contest user clashes with a registered user, the registered user won't be able to log in to the Single Contest page. A warning will be displayed next to the user's profile on the Users & Registrations page.
The Single Contest page is designed to be easily reverse-proxied by a webserver such as NGINX or Apache, allowing one to easily setup a standalone website for any given contest. This can be useful in competition settings, where the primary website can serve as an internal platform (and can be protected by a firewall), and the reverse-proxied Single Contest page can be made public for contestants' access.
Here is an example NGINX configuration to reverse-proxy the Single Contest page of contest #42 to http://localhost:30080
:
server {
listen 30080;
server_name localhost;
location ~ ^/(assets|fonts|images|static|robots.txt) {
# static files required for the website to work
# if other assets is used in the contest, modify the pattern above accordingly
root /home/tioj/tioj/public; # modify according to the installation path of the website
}
location / { # proxy
# assuming the main website is http://127.0.0.1
proxy_pass http://127.0.0.1/single_contest/42/; # contest ID
proxy_redirect ~/single_contest/42/(.*)$ /$1; # contest ID
proxy_redirect ~/single_contest/42$ /; # contest ID
proxy_set_header Host $http_host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto http;
}
location /mathjax { # MathJax is served through Rails
proxy_pass http://127.0.0.1;
}
location /cable { # ActionCable
proxy_pass http://127.0.0.1;
proxy_http_version 1.1;
proxy_set_header Host $host;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "Upgrade";
proxy_set_header SINGLECONTESTID "42"; # contest ID
}
}
One should change the 42
to the real contest ID in the lines marked # contest ID
. The contest ID can be obtained from the URL (http://example.com/contest/42
).
The root /home/tioj/tioj/public;
line should be updated according to the installation path. If Docker is used, the default directory is /srv/tioj/public
.