Logo
(追記) (追記ここまで)

30949번 - Equal Schedules 다국어

시간 제한메모리 제한제출정답맞힌 사람정답 비율
1 초 (추가 시간 없음) 1024 MB154807051.471%

문제

You are one of the people on-call for a high-availability service that offers users to solve programming tasks. As an organized team, you have an on-call schedule specifying who is responsible for the service at which time. A colleague sends you a new schedule, and you want to make sure that everyone has the same amount of on-call time as before, or print any differences.

The on-call schedule is specified with lines of form $s_ie_it_i,ドル where $s_i$ and $e_i$ represent the start and end offsets of the on-call shift for a teammate $t_i$ from some start hour.

Given a sample schedule

0 7 jan
7 14 tomaz
14 20 jure
20 24 jan
24 25 tomaz
25 26 jure

we can see that jan is on-call for the first 7 hours (hour 0, 1, 2, 3, 4, 5, and 6), tomaz for next 7, ... In total, jan is on-call for 11 hours, tomaz for 8 and jure for 7.

입력

The input contains two schedules separated by a horizontal line ------. Each schedule contains one or more lines of form $s_ie_i t_i,ドル where integers $s_i$ and $e_i$ specify that teammate $t_i$ is on-call for hours from $s_i$ up to and excluding $e_i$. A final line ====== is printed after the second schedule.

출력

Output the differences between two schedules, in form $t_i \pm\! d_i,ドル where $d_i$ is the difference between the second and the first schedule for the teammate $t_i$. The output should be sorted alphabetically by teammates' names and teammates with no differences should be omitted, otherwise the difference should be printed with a + or a - sign. If no differences are found, print "No differences found." (without the quotes).

제한

For each schedule, the following holds:

  • $s_1 = 0$
  • $s_i < e_i$
  • $s_{i+1} = e_i$
  • $e_i \leq 1000$
  • Name $t_i$ will consist of lowercase letters from the English alphabet.
  • 3ドル \leq |t_i| \leq 20$

예제 입력 1

0 7 jan
7 14 tomaz
14 20 jure
20 24 jan
24 25 tomaz
25 26 jure
------
0 9 tomaz
9 20 jan
20 26 jure
======

예제 출력 1

jure -1
tomaz +1

예제 입력 2

0 7 nino
7 14 bgs
14 21 ines
------
0 7 ines
7 14 nino
14 21 bgs
======

예제 출력 2

No differences found.

예제 입력 3

0 3 vid
3 6 maks
6 9 janez
------
0 1 vid
1 2 vid
2 3 vid
3 4 maks
4 5 maks
5 6 maks
6 7 janez
7 8 janez
======

예제 출력 3

janez -1

힌트

출처

ICPC > Regionals > Europe > Central European Regional Contest > CERC 2023 E번

(追記) (追記ここまで)

출처

대학교 대회

  • 사업자 등록 번호: 541-88-00682
  • 대표자명: 최백준
  • 주소: 서울시 서초구 서초대로74길 29 서초파라곤 412호
  • 전화번호: 02-521-0487 (이메일로 연락 주세요)
  • 이메일: contacts@startlink.io
  • 통신판매신고번호: 제 2017-서울서초-2193 호

AltStyle によって変換されたページ (->オリジナル) /