問題一覧 > 通常問題

No.1837 Same but Different

レベル : / AI推定難易度 : 1650 / 実行時間制限 : 1ケース 2.000秒 / メモリ制限 : 512 MB / スペシャルジャッジ問題 (複数の解が存在する可能性があります)
タグ : (AC するまで非表示) / 解いたユーザー数 57
作問者 : Sumitacchan / テスター : 👑 hitonanode ygussany
お気に入りにしたユーザー ProblemId : 7101 / 自分の提出
問題文最終更新日: 2022-01-16 17:03:15
This statement was translated by AI (claude-opus-5-5, effort medium) and may contain errors or differ in nuance from the original. The original statement takes precedence. Back to the original
yukicoder contest 331 (順位表) の他の問題:

Problem Statement

You are given an integer $N$ between $3$ and $3000$, inclusive.

Find $1$ pair of $2$ non-negative integer sequences of length $N$, $A=(A_1,A_2,\dots,A_N),B=(B_1,B_2,\dots,B_N)$, that satisfies all of the following conditions.

  • $0\le A_1 < A_2 < \dots < A_N \le 10000$
  • $0\le B_1 < B_2 < \dots < B_N \le 10000$
  • $A_1+A_2+\dots +A_N=B_1+B_2+\dots +B_N$
  • For any tuple of integers $i,j,k,l$ between $1$ and $N$, inclusive, $A_i+A_j \ne B_k+B_l$
    (Note: $i,j,k,l$ are not necessarily distinct.)

It can be shown that $A,B$ satisfying the conditions always exist under the given constraints.

Input

$N$

  • $3\le N\le 3000$
  • All inputs are integers.

Output

Output in the following format.

$A_1\ \ A_2\ \ \cdots\ \ A_N$
$B_1\ \ B_2\ \ \cdots\ \ B_N$
If there are multiple answers, any of them will be accepted.

Sample

Sample 1
Input
3
Output
99 824 4353
0 1 5275

In this sample output, $A_1+A_2+A_3=B_1+B_2+B_3\ (=5276)$ holds.
Also, there are $3^4$ tuples of integers $i,j,k,l$ between $1$ and $3$, inclusive, and $A_i+A_j \ne B_k+B_l$ holds for all of them.

提出するには、Twitter 、GitHub、 Googleもしくは右上の雲マークをクリックしてアカウントを作成してください。