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

E. Infiltration

스페셜 저지 — 출력을 사용자 정의 프로그램으로 검사하므로 여러 정답이 인정될 수 있습니다.
Unrated 레이팅 미적용
난이도
3s
시간 제한
1024MB
메모리 제한
0
맞았습니다!!
0
제출 수
0.0%
정답률
레이팅

의견: 0

설명

Good morning, agent \(W-12\). Your mission, should you choose to accept it, is as follows. We are infiltrating the ever so insidious Association of Chaos and Mischief (ACM) in order to take down their command structure. Unfortunately, they appear to be prepared for such an eventuality, and have given their command structure an annoyingly complex design which makes our infiltration quite difficult. The ACM command structure is divided into several cells. For each pair of cells A and B, either A controls B or B controls A. But this “control” relation can be cyclic, so it could happen that A controls B and B controls C and C controls A. We can send in agents to infiltrate any particular cell, which gives us control over that cell and the cells that it controls, but not any other cells. So in the example above, infiltrating A would give us control over A and B, but not C. For a successful infiltration of the ACM, we must obtain control over all of its cells, otherwise the cells that are out of our control will discover us and start causing some of their trademark chaos and mischief. As you know, we’re on a tight spending leash from higher authority these days, so we need to execute this mission as efficiently as possible. Your mission is to figure out the minimum number of cells we need to infiltrate in order to succeed. This mission briefing will se\(lf-de\)struct in five hours. Good luck!

제약
입력 형식

The first line of a test case contains the number \(n\) of cells the ACM has (\(1 \le n \le 75\)). Each of the next \(n\) lines contains a binary string of length \(n\) where the \(i^{th}\) character of the \(j^{th}\) line is 1 if cell \(j\) controls cell \(i\), and 0 otherwise (\(1 \le i\), \(j \le n\)). The \(i^{th}\) character of the \(i^{th}\) line is 0 and for \(i\)̸ = \(j\), either the \(i^{th}\) character of the \(j^{th}\) line is 1 or the \(j^{th}\) character of the \(i^{th}\) line is 1, but not both.

출력 형식

For each test case, display its case number followed by the minimum number \(m\) of cells that must be infiltrated to obtain complete control of the ACM. Then display \(m\) numbers \(c_{1}\), . . . , \(c_{m}\) in any order, indicating the list of cells to infiltrate (cells are numbered from 1 to \(n\)). If more than one set of \(m\) cells gives complete control, any one will be accepted.

예제 1
입력
2
00
10
3
010
001
100
5
01000
00011
11001
10100
10010
출력
Case 1: 1 2
Case 2: 2 1 2
Case 3: 2 2 3
문제 정보

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

출처 ICPC World Finals 2012

평가 및 의견

E. Infiltration

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

Log in to rate problems.

개별 의견

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

풀이 제출

E. Infiltration

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