-
-
Save dniku/faf3321b9d272a7dfe8d to your computer and use it in GitHub Desktop.
Problem I from VK wild-card round #1. The language is Picat. This solution fails with WA #18.
This file contains hidden or 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
import cp. | |
read_list=List => | |
L=[], | |
Len=read_int(), | |
foreach(I in 1..Len) | |
V := read_int(), | |
L := [V|L] | |
end, | |
List=L. | |
main => | |
N = read_int(), | |
K = read_int(), | |
V = new_list(N), | |
V :: 1..N, | |
V[1] #= 1, | |
foreach(I in 1..K) | |
L := read_list(), | |
all_different([$V[Ind] : Ind in L]) | |
end, | |
solve([$min(max(V))], V), | |
foreach(Q in V) | |
printf("%d ", Q) | |
end. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment