Pagini recente » Monitorul de evaluare | Atasamentele paginii Titlu sugestiv | Diferente pentru algoritmiada-2016/runda-1/juniori intre reviziile 2 si 3 | Diferente pentru problema/petic intre reviziile 4 si 9 | Diferente pentru problema/ucl intre reviziile 2 si 6
Diferente pentru
problema/ucl intre reviziile
#2 si
#6
Nu exista diferente intre titluri.
Diferente intre continut:
== include(page="template/taskheader" task_id="ucl") ==
Poveste şi cerinţă...
h2. Date de intrare
Stefan is a big football fan and he's also interested in various statistics related to his favorite sport. Today he read about some past football competitions which involved group stage events and he's now stuck with trying to solve this problem:
Given the final results of a round robin round (each team plays against each team twice), help Stefan find whether there is a unique way of assigning the results for each match such that we end up having the final standings given in the input. Since the data can be faulty, there can also be a chance of having invalid group stages, so you will also have to help Stefan find them out.
Since Stefan is ambitious, he wants you to find the results for $t$ such final tables.
h2. Date de intrare
Input file $ucl.out$ contains on the first line $t$, the number of test cases.
On the first line of the input for each test you will have $n$, the number of teams playing.
On the next $n$ lines you will have $3$ integers, representing the number of wins, the number of draws and the number of losses the team got. The integers are *NOT* separated by spaces.
h2. Date de ieşire
În fişierul de ieşire $ucl.out$ ...
Output file $ucl.out$ will contain $t$ lines, each of them containing the answer corresponding to that test case.
h2. Restricţii
* $... ≤ ... ≤ ...$
* $1 ≤ t ≤ 10^5$
* $2 ≤ n ≤ 4$
* For tests worth $10$ points, $n = 2$
* For tests worth $20$ more points, $2 ≤ n ≤ 3$
* For tests worth $10$ more points, $1 ≤ t ≤ 10$
* For tests worth $10$ more points, there are only valid group tables.
h2. Exemplu
table(example). |_. ucl.in |_. ucl.out |
| This is some
text written on
multiple lines.
| This is another
text written on
multiple lines.
| 2
4
600
402
204
006
4
402
402
402
006
| Unique
Not unique
|
h3. Explicaţie
...
For the first testcase, the results are unique because we can uniquely determine that the first team won all the games against all other teams, the second team won all the games except for the ones lost against the first team and the third team won all the games against the fourth team.
For the second testcase, while we can uniquely determine that the fourth team lost twice against each other team, there are at least two ways of assigning game results such that each of the first three teams won twice and lost twice against the other two teams.
== include(page="template/taskfooter" task_id="ucl") ==
Nu exista diferente intre securitate.
Topicul de forum nu a fost schimbat.