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

Crtanje

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

의견: 0

설명

Josip used to code in Logo. He loved to draw pictures, but those days are sadly
over. Nostalgic, he decided to draw a line that represents the net worth of his
company over a period of \(n\) days.
For each of the \(n\) days, he knows if the net worth of his company increased by one
unit (represented by ’+’), decreased by one unit (represented by ’-’), or remained
the same (represented by ’=’) during that day. Before the first day, the net worth
was equal to zero.
Josip will draw the line in a big infinite matrix of characters. Indices of matrix rows grow upwards, and
indices of columns grow to the right. For the \(i-th\) day he will draw some character in the \(i-th\) column.
The character and the index of the row are decided by the following rules:
• If the net worth increased during the \(i-th\) day, he will draw ’/’ in the row with index equal to the
net worth at the beginning of the day.
• If the net worth decreased during the \(i-th\) day, he will draw ’\’ in the row with index equal to the
net worth at the end of the day.
• If the net worth didn’t change during the \(i-th\) day, he will draw ’’ in the row with index equal to
the net worth during the day.
All other cells are filled with ’.’.
Your task is to output the minimal matrix that contains the whole line, i.e. contains all characters ’/’,
’\’ and ’
’ that Josip drew.

제약

In test cases worth 20 points the input won’t contain the character ’-’.

입력 형식

The first line contains an integer \(n\) (\(1 \le n \le 100\)), the number of days.
The second line contains a string of \(n\) characters ’+’, ’-’ and ’=’ that represents how the company’s net
worth changed over the given period.

출력 형식

Output the described matrix.

예제 1
입력
7
++---==
출력
./\....
/..\...
....\__
예제 2
입력
5
+=+=+
출력
..._/
._/..
/....
예제 3
입력
4
--=+
출력
\...
.\_/
문제 정보

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

출처 COCI 2020/2021 Contest 2

평가 및 의견

Crtanje

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

Log in to rate problems.

개별 의견

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

풀이 제출

Crtanje

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