結果
| 問題 | No.557 点対称 |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2026-02-21 15:49:23 |
| 言語 | C++17 (gcc 15.2.0 + boost 1.89.0) |
| 結果 |
TLE
|
| 実行時間 | - |
| コード長 | 525 bytes |
| 記録 | |
| コンパイル時間 | 613 ms |
| コンパイル使用メモリ | 80,764 KB |
| 実行使用メモリ | 11,424 KB |
| 最終ジャッジ日時 | 2026-02-21 15:49:28 |
| 合計ジャッジ時間 | 5,275 ms |
|
ジャッジサーバーID (参考情報) |
judge5 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 29 TLE * 1 |
ソースコード
#include <iostream>
#include <cstdio>
using namespace std;
typedef long long LL;
const int MOD = 1000000007;
LL n, ans;
int QMI(int a, LL k) {
int ret = 1 % MOD;
while (k) {
if (k & 1) ret = 1LL * ret * a % MOD;
a = 1LL * a * a % MOD;
k >>= 1;
}
return ret;
}
int main() {
scanf("%lld", &n);
ans = n % 2 ? 3LL : 1LL;
if (n % 2) --n;
n /= 2;
if (n > 0) ans = ans * 4 % MOD;
--n;
ans = ans * QMI(5, n) % MOD;
printf("%lld\n", ans);
return 0;
}