본문 바로가기
알고리즘

[BAEKJOON] 32905 RACI

by mAlfred 2025. 8. 23.
반응형

문제

Nikolai assigned students the task of creating a RACI matrix for a project during management lectures. This is a responsibility assignment matrix that lists all stakeholders of the project and their levels of involvement in different tasks. The levels are denoted by the letters "R", "A", "C", and "I". If there is no involvement, "-" is used. The levels of involvement have the following meaning:

  • R (Responsible): performs the task (if they are absent, then Accountable performs the whole task)
  • A (Accountable): accepts the task from Responsible; for each task, there must be exactly one instance of this level of involvement, unlike the other levels, of which there can be any number
  • C (Consulted): provides consultation during the execution of the task
  • I (Informed): receives information about the progress of the task

Help the students verify the correctness of the matrix.

입력

The first line contains two integers  and : the number of rows and columns of the RACI matrix ().

Next,  rows are listed, each containing  elements separated by spaces.

Each row represents a task, and each column corresponds to a stakeholder.

Each element of the matrix can be either an uppercase letter "R", "A", "C", or "I", or a minus sign, "-", indicating that the given stakeholder has no level of involvement in this task.

출력

Print "Yes" if the matrix is correct, or "No" otherwise.

예제 입력 1 

3 5
C C A - I
A R - C I
A R I C -

예제 출력 1 

Yes

예제 입력 2 

3 3
A - C
R C I
- A I

예제 출력 2 

No

 

 

영어는 너무 어려워...

아무튼 최종 승인자가 A인데 A의 유무를 파악하고 1명인지를 파악하면 되는 문제

 

n, m = map(int, input().split())

for _ in range(n):
    l = list(input().split())
    if l.count('A') != 1:
        print('No')
        break
else:
    print('Yes')

 

반응형

'알고리즘' 카테고리의 다른 글

[BAEKJOON] 32951 AI 선도대학  (0) 2025.09.02
[BAEKJOON] 28691 정보보호학부 동아리 소개  (0) 2025.08.28
[BAEKJOON] 31450 Everyone is a winner  (0) 2025.08.20
[BAEKJOON] 27855 Cornhole  (0) 2025.07.22
[BAEKJOON] 14935 FA  (0) 2025.07.16