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

S3. Arithmetic Square

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

의견: 0

설명

You are given a \(3\times 3\) grid
which contains integers.

Some of the 9 elements in the grid will have a value already, and the
remaining elements will be unspecified.

Your task is to determine values for the unspecified elements such
that each row, when read from left-to-right is an arithmetic sequence,
and that each column, when read from the top-down, is an arithmetic
sequence.

Recall that an arithmetic sequence of length
three is a sequence of integers of the form
$$ a, a+d, a+2d $$
for integer values of \(a\) and \(d\). Note that \(d\) may be any integer, including zero or a
negative integer.

Possible Output for Sample Input 2

14 20 26
18 18 18
22 16 10
제약
입력 형식

The input will be 3 lines long. Each line will have three
space-separated values. Each value will either be an integer in the
range from \(-1\ 000\ 000\) to \(1\ 000\ 000\), inclusive, or the symbol
X.

For 4 of the 15 marks available, there will be at most 3
X symbols in the input.

For an additional 3 of the 15 marks available, all integer values in
the input will be between -10 and 10, inclusive.

For an additional 4 of the 15 marks available, there will be at least
7 X symbols in the input.

For an additional 2 of the 15 marks available, all integer values in
the input will be even numbers.

출력 형식

The output will be 3 lines long. Each line will have three
space-separated integers. All integers that were given in the input must
be in their same position (i.e., same row and same column as in the
input). All rows and columns must form arithmetic sequences. All
integers in the output must be between -1 000 000 000 and 1 000 000 000,
inclusive.

If there is more than one solution, output any solution. There is
guaranteed to be at least one solution.

예제 1
입력
8 9 10
16 X 20
24 X 30
출력
8 9 10
16 18 20
24 27 30
설명

Notice that the second element of the second row must be \(16+t\) and since \(20=16+2t\), then \(t=2\), and thus, this unspecified element
must be 18. A similar argument applies to the second element of the
third row.

문제 정보

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

출처 CCC 2019 Senior

평가 및 의견

S3. Arithmetic Square

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

Log in to rate problems.

개별 의견

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

풀이 제출

S3. Arithmetic Square

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