포럼
문제 ICPC00168

I. Indoorienteering

설명

Luk\'as really likes orienteering, a sport that requires locating control points in rough terrain. To entertain the NWERC participants Luk\'as wants to organize an orienteering race. However, it would be too harsh for the participants to be outdoors in this cold Swedish November weather, so he decided to jump on the new trend of indoor races, and set the race inside the B building of Linköping University.

Luk\'as has already decided on the locations of the control points. He has also decided on the exact length of the race, so the only thing remaining is to decide in which order the control points should be visited such that the length of the total race is as he wishes. Because this is not always possible, he asks you to write a program to help him.

Note from the organizer: the NWERC indoorienteering race for this year has been cancelled since we neglected to apply for an orienteering permit in time from the university administration. (We still need you to solve the problem so that we can organize it for next year.)

제약
입력 형식

The input consists of:
- one line with two integers \(n\) (\(2\leq n \leq 14\)) and \(L\) (\(1 \leq L \leq 10^{15}\)), the number of control points and the desired length of the race, respectively;
- \(n\) lines with \(n\) integers each. The \(j\)th integer on the \(i\)th line, \(d_{ij}\), denotes the distance between control point \(i\) and \(j\) (\(1\leq d_{ij} \leq L\) for \(i \not= j\), and \(d_{ii} = 0\)). For all \(1 \leq i,j,k \leq N\) it is the case that \(d_{ij} = d_{ji}\) and \(d_{ij} \leq d_{ik} + d_{kj}\).

출력 형식

Output one line with "possible" if it is possible to visit all control points once in some order and directly return to the first one such that the total distance is exactly \(L\), and "impossible" otherwise.

예제 1
입력
4 10
0 3 2 1
3 0 1 3
2 1 0 2
1 3 2 0
출력
possible
예제 2
입력
3 5
0 1 2
1 0 3
2 3 0
출력
impossible
문제 정보

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

출처 ICPC NWERC 2014

평가 및 의견

I. Indoorienteering

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

Log in to rate problems.

개별 의견

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

풀이 제출

I. Indoorienteering

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