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

32556번 - Hotfix 다국어

시간 제한메모리 제한제출정답맞힌 사람정답 비율
8 초 1024 MB215525.000%

문제

In an earlier contest, contestants had to solve a simple problem. They were given a string and had to print each unique substring of it, along with the number of occurrences it had in the original string. For example AB would print A 1 B 1 AB 1 and AAA would print A 3 AA 2 AAA 1.

When copying over this problem for reuse in this contest, several mistakes were made. The input constraints were changed significantly, making the problem absolutely impossible! Luckily this was partially cancelled out by the output validator being mangled as well. Now instead of checking for absolute correctness it only requires the number of occurrences of each character in the output to be correct. With a quick hotfix of applying run length encoding to the output, the problem was finally solvable again and the contest could continue on as planned. Right?

입력

The input contains a single string of length at least 1ドル$ and at most 10ドル^6$. It contains only ASCII upper and lower case characters. This string is then followed by a single newline character.

출력

For each non-whitespace character that appears a non-zero number of times in the output of the problem described above, print it along with its number of occurrences on a single line, separated by a space. Print the lines ordered by ascending values of the ASCII characters.

제한

예제 입력 1

ABC

예제 출력 1

1 6
A 3
B 4
C 3

예제 입력 2

aaaab

예제 출력 2

1 6
2 1
3 1
4 1
a 20
b 5

힌트

출처

ICPC > Regionals > Europe > Northwestern European Regional Contest > Nordic Collegiate Programming Contest > NCPC 2024 H번

  • 문제를 만든 사람: Atli Fannar Franklín
(追記) (追記ここまで)

출처

대학교 대회

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

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