Last active
June 22, 2020 16:44
-
-
Save drygdryg/b7cb8a941c2964de682203725d12d646 to your computer and use it in GitHub Desktop.
Codeforces task solution. https://i.imgur.com/iLLPRBq.jpg
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from strutils import parseInt, split, join | |
let n = uint8(parseInt(readLine(stdin))) | |
var x_roads_asphalted: seq[uint8] | |
var y_roads_asphalted: seq[uint8] | |
var days: seq[uint8] | |
var counter: uint8 = 1 | |
for i in uint8(1)..(n * n): | |
let t = split(readLine(stdin), ' ') | |
var x_road = uint8(parseInt(t[0])) | |
var y_road = uint8(parseInt(t[1])) | |
if not (x_road in x_roads_asphalted) and not (y_road in y_roads_asphalted): | |
x_roads_asphalted.add(x_road) | |
y_roads_asphalted.add(y_road) | |
days.add(counter) | |
counter += 1 | |
echo(days.join(" ")) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment