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

Prozor

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

의견: 0

설명

\(7^{th}\) round, March \(5^{th}\) 2016

제약
입력 형식
출력 형식
예제 1
입력
{abc,ono,sto}
{}
{znakovi}
{a,b,{c,d},e,{}}
출력
output
output
output
{
abc,
ono,
sto
}
{
}
{
znakovi
}
{
a,
b,
{
c,
d
},
e,
{
}
}
설명

Clarification of the fourth example: In the beginning, there is no indentation, it is 0. After the first curly
bracket, there is a new line and the indentation increases by 2 spaces.
After that, the word „a“ is printed, as well as the comma right after it, then the new line with the same
indentation of 2 spaces. The same procedure is repeated for the word „b“.
The third value in the array is a new array (let’s call it array X). It begins with a curly bracket, so we need to
print a new line and increase the indentation for 2 spaces. The indentation is now a total of 4 spaces. Using
that indentation, we print the words „c“ and „d“ each in its own line. After the word „d“, there is no comma
because it is the last value in the array X.
Before we print the curly bracket that denotes the end of array X, we need to decrease the indentation for 2.
After the curly bracket, we print the comma and a new line and the continue printing the values from the main
array.

Young Marin, now already a respectable star of Croatian cinematography, spends his free time looking
out the window. Unfortunately for him, the same activity is also taken up by a few flies that have
landed on his window and are looking into the distance. Marin immediately hurried to get his square
racket for killing flies. At the same time, he wondered how many flies it is possible to kill in one shot.
After trying to scare away the flies unsuccessfully for a few hours, he decided to ask for your help.
Marin has sent you a picture of his window, the dimensions being R × S pixels and has also told you
the length of the side of the racket he uses to kill the flies, in pixels. Your task is to determine the
maximal amount of flies that Marin could have killed in a single shot and mark one such shot in the
picture.

예제 2
입력
The first line of input contains three integers R, S and K (3 ⩽K ⩽R, S ⩽100) that denote the
dimensions of Marin’s picture and the length of the side of the racket.
Each of the following R lines contains S characters that describe Marin’s picture. The picture’s pixels
marked with ’*’ denote the position of a fly, whereas all the other pixels are marked with ’.’ and denote
empty space. On his window, there is at least one fly that Marin can kill with his racket.
출력
The first line of output must contain the maximal number of flies Marin can kill in a single shot.
The folllowing R lines must contain Marin’s picture, on it clearly marked a position of the racket that
will ensure Marin kills as many flies as possible. The horizontal sides of the racket are denoted with a
series of characters ’-’ and the vertical ones with ’|’, whereas angles are denoted with ’+’. For a more
detailed explanation, consult the sample tests.
Please note: Marin’s racket will affect only the flies located strictly inside the racket, and the racket
must be located inside the window with all its parts. In other words, it is assumed that the flies located
at the sides of the racket will have enough time to fly away.
SCORING
In test cases worth 50% of all points, it is sufficient to only have the first line of output correct.
SAMPLE TESTS
예제 3
입력
3 5 3
.....
.*.*.
.....
7 6 4
......
.*.*.*
......
.*.*..
..*...
..*...
*....*
9 9 6
***......
......*.*
.*....*..
..*...*..
..*.*....
..*....*.
.....*...
.*...***.
.........
출력
output
output
1
+-+..
|*|*.
+-+..
2
......
.*.*.*
+--+..
|*.|..
|.*|..
+--+..
*....*
6
***......
......*.*
.*....*..
..*+----+
..*|*...|
..*|...*|
...|.*..|
.*.|.***|
...+----+
문제 정보

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

출처 COCI 2015/2016 Contest 7

평가 및 의견

Prozor

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

Log in to rate problems.

개별 의견

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

풀이 제출

Prozor

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