問題一覧 > 通常問題

No.344 Power of a Certain Irrational Number

レベル : / AI推定難易度 : 1300 / 実行時間制限 : 1ケース 2.000秒 / メモリ制限 : 512 MB / 標準ジャッジ問題
タグ : (AC するまで非表示) / 解いたユーザー数 80
作問者 : FF256grhy
お気に入りにしたユーザー ProblemId : 857 / 自分の提出
問題文最終更新日: 2026-06-25 07:38:40
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 131 (順位表) の他の問題:

Problem Statement

For a given non-negative integer $n$, compute the remainder when the integer part of the $n$-th power of $1 + \sqrt{3}$ is divided by $1000$, that is,
\[ \left\lfloor \left( 1 + \sqrt{3} \, \right) ^ n \right\rfloor \bmod 1000 \]

Input

n

$n$ is an integer satisfying
$0 \leq n \leq 10^9$
.

Output

Output the value, followed by a newline.

Sample

Sample 1
Input
0
Output
1

$ \left\lfloor \left( 1 + \sqrt{3} \, \right) ^ 0 \right\rfloor = \left\lfloor 1 \right\rfloor = 1 $

Sample 2
Input
2
Output
7

$ \left\lfloor \left( 1 + \sqrt{3} \, \right) ^ 2 \right\rfloor = \left\lfloor 7.464 \cdots \right\rfloor = 7 $

Sample 3
Input
12
Output
927

Sample 4
Input
123456789
Output
920

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