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

Desni klik

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

의견: 0

설명

NFP \(is\) the future!, this is something all Noa’s friends can expect him to say when
finance topics come up.
NFP is one of the cryptocurrencies. The value of NFP over the course of \(s\) days
can be represented with a matrix with \(r\) rows and \(s\) columns, consisting only
of characters . and #. The character # in the \(i-th\) column represents the value
of NFP on the \(i-th\) day, with the value being the number of the row, counted
bott\(om-up\).
....##.

..#...

.##....
......#
The value \(of\) NFP from the second example over the course \(of\) 7 days was: 3, 2, 2, 3, 4, 4, 1.
The insecurity \(of\) this NFP \(is\) 3.
The insecurity of NFP is defined as the difference between the maximum and minimum value it achieves
over the course of \(s\) days.
Noa wants to determine the insecurity for \(n\) NFPs, whose values are represented by matrices with \(r\) rows
and \(s\) columns.
Help him determine the insecurity of each of the \(n\) NFPs.

제약

Subtask 1 (5 points): \(r = s = 2\)

Subtask 2 (15 points): \(n = 1\)

Subtask 3 (30 points): No additional constraints.

입력 형식

The first line contains integers \(n\), \(r\) and \(s\) (\(1 \le n \le 20\), \(2 \le r\), \(s \le 50\)), the number of NFPs, and the
number of rows and colums of the matrices.
\(n\) matrices follows, one below another, each with \(r\) rows and \(s\) columns, representing NFP values. Each
column consists only of characters ., except for exactly one character #.

출력 형식

Print \(n\) lines. In the \(i-th\) of \(n\) lines print the insecurity od the \(i-th\) NFP.

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

1

5점

\(r = s = 2\)

2

15점

\(n = 1\)

3

30점

No additional constraints.

예제 1
입력
4 2 2
##
..
..
##
#.
.#
.#
#.
출력
0
0
1
1
예제 2
입력
1 5 8
.....#.#
...#..#.
..#.#...
.#......
#.......
출력
4
예제 3
입력
2 3 3
...
##.
..#
.#.
#..
..#
출력
1
2
Note: For clarity’s sake, in the examples there are blank lines between matrices. In the test cases there
will not be blank lines between matrices.
설명

Clarification of the first example:
The values of the first and the second NFP do not change over the days, so their insecurities are equal to
0. The value of the third NFP decreases by 1 on the second day, so the insecurity is equal to 1. The value
of the fourth NFP increases by 1 on the second day, so the insecurity is equal to 1.
Clarification of the second example:
The maximum value NFP has is 5 (on days 6 and 8), and the minimum value is 1 (on day 1). Therefore,
the insecurity is equal to 5 −1 = 4.

문제 정보

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

출처 COCI 2022/2023 Contest 1

평가 및 의견

Desni klik

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

Log in to rate problems.

개별 의견

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

풀이 제출

Desni klik

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