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

Ratar

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

의견: 0

설명

\(1^{st}\) round, September \(28^{th}\), 2013

After Mirko's failed stint as a coach and a passing obsession with Croatian meat delicacies, his weight
problems have motivated him to work hard as a farmer. He has moved to a village where his friend
Slavko lives. Farmers in the village share a large common plot of land in the shape of a \(N \times N\) square,
divided into N2 unit squares. A unit square at coordinates^{2} (i, j) brings in the income of A_{ij}, which can
be negative (for example, if the square has to be maintained but is not cultivated). The farmers always
divide the common land into smaller rectangular fields with edges parallel to the common land
edges.
Slavko is skeptical of Mirko since his failure as a coach, so he insists that both of them are assigned
land with the same total income, but also thet the two plots share exactly one common corner so
that the two friends can keep an eye on each other (Slavko knows that Mirko is prone to mischief). The
common corner must be the only point where the two plots meet, in order to prevent bord\(er-re\)lated
arguments.
You are given a description of the common land plot. Find the total number of plot pairs that satisfy
Slavko's criteria.

제약

In test data worth at least 40% of total points, N will be at most 10.

입력 형식

The first line of input contains the positive integer N (\(1 \le N \le 50\)), the dimensions of the common
land plot.
Each of the following N lines contains N spa\(ce-se\)parated numbers A_{ij}(-\(1000 < A_{ij}< 1000\)), the income
provided by the respective cell.

출력 형식

The first and only line of output must contain the totl number of plot pairs satisfying the given
condition.

예제 1
입력
3
1 2 3
2 3 4
3 4 8
출력
7
예제 2
입력
4
-1 -1 -1 -1
1 2 3 4
1 2 3 4
1 2 3 4
출력
10
예제 3
입력
5
-1 -1 -1 -1 -1
-2 -2 -2 -2 -2
-3 -3 -3 -3 -3
-4 -4 -4 -4 -4
-5 -5 -5 -5 -5
출력
36
설명

Clarification of the first example: The possible rectangle pairs are:
(0,0)-(1,1) and (2,2)-(2,2), (1,0)-(1,0) and (0,1)-(0,1), (2,0)-(2,0) and (1,1)-(1,1), (1,1)-(1,1) and (0,2)-(0,2),
(2,1)-(2,1) and (1,2)-(1,2), (2,0)-(2,1) and (0,2)-(1,2), (1,0)-(2,0) and (0,1)-(0,2).

2

The first number in the parenthesis denotes the row, and the second number denotes the column

문제 정보

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

출처 COCI 2013/2014 Contest 1

평가 및 의견

Ratar

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

Log in to rate problems.

개별 의견

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

풀이 제출

Ratar

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