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

J3. Harp Tuning

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

의견: 0

설명

The CCC harp is a stringed instrument with strings labelled A,B,...,T. Like other instruments, it
can be out of tune.

A musically inclined computer science student has written a clever
computer program to help tune the harp. The program analyzes the sounds
produced by the harp and provides instructions to fix each string that
is out of tune. Each instruction includes a group of strings, whether
they should be tightened or loosened, and by how many turns.

Unfortunately, the output of the program is not very user friendly.
It outputs all the tuning instructions on a single line. For example,
the single line AFB+8HC-4 actually contains
two tuning instructions: AFB+8 and
HC-4. The first instruction indicates that
harp strings A, F, and B should be tightened 8 turns, and the
second instruction indicates that harp strings H and C should be loosened 4 turns.

Your job is to take a single line of tuning instructions and make
them easier to read.

제약

Marks

The following table shows how the available 15 marks are
distributed.

Marks Awarded Maximum Input Values Example Input
Number of Instructions Number of Letters in an Instruction Number of Turns
5 marks 1 20
5 marks 20 1
3 marks 20 20
2 marks 20 20
입력 형식

There will be one line of input which is a sequence of tuning
instructions. Each tuning instruction will be a sequence of uppercase
letters, followed by a plus sign (+) or minus
sign (-), followed by a positive integer.
There will be at least one instruction and at least one letter per
instruction. Also, each uppercase letter will appear at most once.

출력 형식

There will be one line of output for each tuning instruction. Each
line of output will consist of three parts, each separated by a single
space: the uppercase letters referring to the strings,
tighten if the instruction contained a plus
sign or loosen if the instruction contained a
minus sign, and the number of turns.

예제 1
입력
AFB+8HC-4
출력
AFB tighten
8 HC loosen 4
설명

The input contains two tuning instructions:
AFB+8 and HC-4.

예제 2
입력
AFB+8SC-4H-2GDPE+9
출력
AFB tighten 8
SC loosen 4
H loosen 2
GDPE tighten 9
설명

The input contains four tuning instructions:
AFB+8, SC-4,
H-2, and GDPE+9.

문제 정보

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

출처 CCC 2022 Junior

평가 및 의견

J3. Harp Tuning

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

Log in to rate problems.

개별 의견

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

풀이 제출

J3. Harp Tuning

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