RiseOJ는 solved.ac와 제휴 관계가 없습니다. 티어 아이콘 © solved.ac. solved.ac
포럼
COCI00474

Karte

Unrated 레이팅 미적용
난이도
1s
시간 제한
256MB
메모리 제한
0
맞았습니다!!
0
제출 수
0.0%
정답률
레이팅

의견: 0

설명

1 \(s / 64\) \(MB / 120\) points

... Take these cards, \(I\) tell ya, \(my\) cousin from Sweden sent them when the hunger for war

was at its peak, and we stayed playing rummy in the trenches.

Daniel: “Are we playin’ rummy, eh?”
Domagoj: “Well ok then.”
Daniel: “Watch this now. You have a deck of \(N\) cards, where the \(i\) ^{th} card has a claim written

on it in the form of ‘At least \(a\) _{i} cards beneath this one contain a false claim.’ You have to

shuffle them so that exactly \(K\) cards contain a false claim.”
Domagoj: “You destroy me in this game every time, where did you get these cards, son?!”
Daniel: “Ah, my old man organizes card tournaments, so each day he gives me free cards,

ten bucks per deck.”

Your task is to help Domagoj solve Daniel’s task. Output the order in which Domagoj must

place the cards. It is also possible that this is a bad joke on Daniel’s part, and that there is no

possible order to place the cards in. In that case, outp\(ut -1\).

제약

In test cases worth 30% of total points, it will hold \(N\) ≤ 16.
In additional test cases worth 40% of total points, it will hold \(N\) ≤ 2000.

1 \(s / 64\) \(MB / 120\) points

입력 형식

The first line contains integers \(N\) and \(K\) (1 ≤ \(N\)\(5 \cdot 10\) {5}{ }, 0 ≤ \(K\)\(N\) ).
The \(i\) {th}{ } of the following \(N\) lines contains an integer \(a\) {i}{ } (0 ≤ \(a\) {i}{ } ≤ \(5 \cdot 10\) {5}{ }).

출력 형식

If the required order does not exist, outp\(ut -1\).
Otherwise, in a single line, output \(N\) integers separated by spaces, the numbers on the cards
in the order from the top to the bottom of the deck. If there are multiple solutions, output
any.

예제 1
입력
4 2
1
2
2
3
출력
2 3 1 2
예제 2
입력
5 3
2
1
3
0
3
출력
3 3 0 1 2
예제 3
입력
6 4
0
2
5
2
0
1
출력
-1
문제 정보

생성자가 기록되지 않았습니다.

출처 COCI 2017/2018 Contest 5

평가 및 의견

Karte

개요
출제자 난이도 Unrated 레이팅 미적용 의견 0 / 50 공개 집계 (커뮤니티 난이도, 주요 주제, 품질)는 의견이 충분히 모이면 공개됩니다.

Log in to rate problems.

개별 의견

아직 의견이 없습니다. 자격이 된다면 위 양식에서 가장 먼저 평가해 보세요.

풀이 제출

Karte

게스트로 둘러보고 있습니다. 로그인하면 풀이를 제출하고 진행 상황을 확인할 수 있습니다. 로그인하고 제출하기
공개
C++20 Tab 들여쓰기 · Ctrl+/ 주석 토글 · Enter 자동 들여쓰기
1 1 1 0 공백: 4 · UTF-8