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

Acm

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

의견: 0

설명

An ancient programming competition is getting near and it is organized by none other
than ACM (Aeronautic Centre \(of\) Metković). Exactly \(N\) teams will compete for the
grand prize and among them is a golden Croatian trio: Paula, Marin and Josip. The
contest format is standard, while the pilot is performing aerobatic maneuvers, the
\(co-pi\)lot reads the problem statements and attempts to transmit the solutions to the
code monkey main programmer who is securely taped to the aircraft’s exterior.
The contest consists of \(M\) different tasks and the teams are (n\(on-in\)creasingly) ordered
by the number of solved tasks.
The teams that have the same number of solved tasks are ordered (n\(on-de\)creasingly)
by \(so-ca\)lled penalty time. Penalty time of a certain team is the sum of penalty time
they achieved on each of their correctly solved tasks. Penalty time of a correctly solved task equals to the
time it took for the team to solve that task (from the beginning of the contest) increased by additional
20 minutes for each of the wrongly submitted solutions for that task. No teams will attempt to submit
a solution for a problem that they have already solved and the maximum number of submissions for a
certain task is 9 for each team. If some teams have the same number of solved problems and the same
penalty time, they will be ordered alphabetically in the final standings.
The competition lasts for five hours. During the first four hours the standings are available to all teams
and contain information about the status of each task for each team (number of submissions, whether it
was solved and when). During those four hours, the order of the teams will be automatically updated
after each submission. In the last hour though, the standings become frozen, i.e., the order of the teams is
not updated after a new submission is judged. During that time, each team knows the judgement of their
own submissions, but they don’t know the judgement of submissions made by other teams. They only
know which tasks were submitted by other teams, how many times were they submitted and when was
the last submission for each task.
The contest is over and the standings should be unfrozen soon. Our heroes, team named NijeZivotJedanACM
need your help. They want to know what is the worst possible position on the scoreboard they could end
up in after the standings become unfrozen. Help them!

제약

In test cases worth a total of 20 points, the input won’t contain the ‘?’ character.

입력 형식

The first line contains integers \(N\) (\(1 \le N \le 1000\)) and \(M\) (\(1 \le M \le 15\)) from the task description.
The next \(N\) lines represent the frozen standings. Each line begins by a team name (string made up of
lowercase and uppercase English letters which consists of at most 20 characters, names of all teams will be
different) which is separated by a space from \(M\) (also spa\(ce-se\)parated) strings that hold the information
about the status of each task for that team.
Those strings are of the form \(SX/V\), where:
• S represents the status of the task – ‘+’ means the task is solved correctly, ‘-’ means it is solved
incorrectly and ‘?’ means that the last submission was sent when the standings were already frozen.
• X represents the number of submissions that were sent by that team for this specific task. It is
omitted if no submissions were made for that task.
• V represents the time when the last submission was sent by that team for this specific task. It is
given in the format HH:MM:SS (with leading zeroes) and is less than 5 hours. The who\(le /V\) part is
omitted if the task is not solved correctly (status ’-’)
The last line contains the unfrozen standings of our heroes, team named NijeZivotJedanACM.

출력 형식

In the first and only line you should output the worst possible position in the standings where our heroes
might end up in after the standings become unfrozen.

예제 1
입력
2 1
NijeZivotJedanACM -
ZivotJESTJedanACM -
NijeZivotJedanACM -
출력
1
예제 2
입력
3 2
StoJeZivot ?1/04:00:00 +1/02:04:06
JeLiZivotJedanACM ?1/04:59:59 -
NijeZivotJedanACM ?1/04:42:43 -
NijeZivotJedanACM +1/04:42:43 -
출력
2
예제 3
입력
7 4
NisamSadaNistaDonio +1/03:59:59 +3/03:42:02 +2/00:14:59 ?1/04:56:12
JeLiMojKockaSeUmio ?4/04:00:00 -3 +1/00:10:01 +9/03:04:42
OstaviDobroJe ?4/04:59:59 -1 +2/00:24:15 +8/03:24:45
DobroJeOstavi +1/01:42:53 - ?9/04:58:23 ?1/04:34:43
NijeZivotJedanACM ?2/04:50:05 ?4/04:32:12 +2/01:32:45 ?1/04:59:59
KoSeToSeta ?1/04:23:32 - +9/01:00:00 -9
SipSipSipSipSipSip - - - ?9/04:00:00
NijeZivotJedanACM -2 +4/04:32:12 +2/01:32:45 +1/04:59:59
출력
3
설명

Clarification of the fist example:
Nothing will change after the standings our unfrozen. Therefore, our heroes will remain in the first place!
Clarification of the second example
In the worst case our heroes will only lose from the team StoJeZivot, thereby finishing in second place.
Clarification of the third example
In the worst case our heroes will lose from teams U najgorem će slučaju naš trojac NisamSadaNistaDonio
and JeLiMojKockaSeUmio, thereby finishing in third place.

문제 정보

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

출처 COCI 2019/2020 Contest 2

평가 및 의견

Acm

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

Log in to rate problems.

개별 의견

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

풀이 제출

Acm

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