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

J3. Product Codes

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

의견: 0

설명

A store has hired the Code Cleaning Crew to help it update all of its
product codes.

The original product codes are sequences of letters, positive
integers, and negative integers. For example, cG23mH-9s is
a product code that contains two uppercase letters, three lowercase
letters, one positive integer, and one negative integer.

The new product codes are made by removing all lowercase letters,
keeping all uppercase letters in order, and adding all the integers to
form one new integer which is placed at the end of the code. For
example, the new product code for cG23mH-9s is
GH14.

Your job is to take a list of original product codes and determine
the new product codes.

제약
입력 형식

The first line of input contains a positive integer, \(N\), representing the number of original
product codes that need to be updated. The following \(N\) lines each contain one original product
code.

Each original product code contains at least one uppercase letter, at
least one lowercase letter, and at least one integer. Also, a positive
integer never immediately follows another integer. This means, for
example, that 23 is the integer \(23\) instead of the integer \(2\) followed by the integer \(3\).

출력 형식

Output the \(N\) new product codes,
one per line.

서브태스크
서브태스크점수설명

1

13점

All the integers are positive and single-digit.

2

13점

All the integers are single-digit.

3

47점

Any positive integer may be multi-digit.

4

27점

Any integer may be multi-digit.

예제 1
입력
1
AbC3c2Cd9
출력
ACC14
설명

For the single original product code, the uppercase letters
A, C, and C are kept in order and
the sum of the integers is \(3+2+9=14\).

예제 2
입력
3
Ahkiy-6ebvXCV1
393hhhUHkbs5gh6QpS-9-8
PL12N-2G1234Duytrty8-86tyaYySsDdEe
출력
AXCV-5
UHQS387
PLNGDYSDE1166
설명

For the first original product code, the uppercase letters
A, X, C, and V are
kept in order and the sum of the integers is \(-6+1=-5\).

For the second and third original product codes, their uppercase
letters are also kept in order and the sums of the integers are \(393+5+6-9-8=387\) and \(12-2+1234+8-86=1166\) respectively.

문제 정보

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

출처 CCC 2025 Junior

평가 및 의견

J3. Product Codes

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

Log in to rate problems.

개별 의견

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

풀이 제출

J3. Product Codes

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