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

Chuck

스페셜 저지 — 출력을 사용자 정의 프로그램으로 검사하므로 여러 정답이 인정될 수 있습니다.
Diamond IV 다이아몬드 IV
난이도
1s
시간 제한
32MB
메모리 제한
0
맞았습니다!!
0
제출 수
0.0%
정답률
레이팅

의견: 0

설명

You are given a matrix of \(R\) rows and \(C\) columns. All elements of the matrix are by their absolute value smaller than or equal to \(10^4\).

You may perform the following operations:

  • rotR i k — Rotate the \(i\)-th row of the matrix \(k\) elements right.
  • rotS j k — Rotate the \(j\)-th column of the matrix \(k\) elements down.
  • negR i — Multiply all elements in the \(i\)-th row by \(-1\), if and only if none of them were multiplied before.
  • negS j — Multiply all elements in the \(j\)-th column by \(-1\), if and only if none of them were multiplied before.

Using a limited number of these operations, you need to maximize the sum of all the elements of the matrix.

제약

• If the obtained sum is not maximal, one of the elements was multiplied
more than once or the sequence of operations printed does not lead to
the sum, 0 points are awarded.
• Otherwise, the number of points depends on the number of operations
used
◦For T
5
\(R\)
\(C\), you are awarded 100% of points allocated to that
test case
◦For 5
\(R\)
\(C < T\)
100 000, you are awarded 50% of points
allocated to that test case
◦For \(T > 100\,000\), you are awarded 0 points for that test case
SAMPLE TEST CASES
Input:
3 4
\(1 -2 5\,200\)
-\(8\ 0 -4 -10\)
11 4 0 100
Input:
3 3
\(8 -2\ 7\)
\(1\ 0 -3\)
-\(4 -8\ 3\)
Output:
Output:
345 2
rotS 2 1
negR 2
34 4
rotR 1 1
rotS 3 1
negR 2
negR 3

입력 형식

The first line of input contains two integers \(R\) and \(C\) (\(1 \le R, C \le 100\)), the number of rows and columns.

The next \(R\) lines contain \(C\) integers each. All integers are by their absolute value smaller than \(10^4\).

출력 형식

The first line of output should contain two integers, the maximal sum obtainable and the number of operations used. We shall call this number \(T\).

The next \(T\) lines should contain any sequence of operations leading to the sum. Each operation should follow the notation defined above.

Scoring:

  • If the obtained sum is not maximal, one of the elements was multiplied more than once, or the sequence of operations printed does not lead to the sum, \(0\) points are awarded.
  • Otherwise, for \(T \le 5 \cdot R \cdot C\) you are awarded \(100\%\) of the points allocated to that test case; for \(5 \cdot R \cdot C < T \le 100\,000\) you are awarded \(50\%\); for \(T > 100\,000\) you are awarded \(0\) points.
서브태스크
서브태스크점수설명

Test 1

10점

None

Test 2

10점

None

Test 3

10점

None

Test 4

10점

None

Test 5

10점

None

Test 6

10점

None

Test 7

10점

None

Test 8

10점

None

Test 9

10점

None

Test 10

10점

None

예제 1
입력
3 4
1 -2 5 200
-8 0 -4 -10
11 4 0 100
출력
345 2
rotS 2 1
negR 2
예제 2
입력
3 3
8 -2 7
1 0 -3
-4 -8 3
출력
34 4
rotR 1 1
rotS 3 1
negR 2
negR 3
문제 정보

riseoj 작성

출처 COCI 2009/2010 Contest 5

평가 및 의견

Chuck

개요
출제자 난이도 Diamond IV 다이아몬드 IV 의견 0 / 50 공개 집계 (커뮤니티 난이도, 주요 주제, 품질)는 의견이 충분히 모이면 공개됩니다.

Log in to rate problems.

개별 의견

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

풀이 제출

Chuck

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