結果
| 問題 | No.557 点対称 |
| コンテスト | |
| ユーザー |
ats5515
|
| 提出日時 | 2017-08-11 23:32:53 |
| 言語 | C++11 (gcc 15.3.0 + boost 1.92.0) |
| 結果 |
AC
不安定
|
| 実行時間 | 1 ms / 2,000 ms |
| + 369µs | |
| コード長 | 538 bytes |
| 記録 | |
| コンパイル時間 | 346 ms |
| コンパイル使用メモリ | 86,644 KB |
| 実行使用メモリ | 6,528 KB |
| 最終ジャッジ日時 | 2026-09-15 03:44:10 |
| 合計ジャッジ時間 | 2,611 ms |
|
ジャッジサーバーID (参考情報) |
judge3_0 / judge2_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 30 |
ソースコード
#include <algorithm>
#include <cstdlib>
#include <iostream>
#include <vector>
#include <math.h>
using namespace std;
#define int long long
int MOD = 1000000007;
int pow5(int n) {
if (n == 0) {
return 1;
}
int res = pow5(n / 2);
res= (res*res) % MOD;
if (n % 2 == 1) {
res = (res * 5) % MOD;
}
return res;
}
signed main() {
int N;
cin >> N;
int res = 4;
if (N == 1) {
res = 2;
}
else {
res = (res * pow5((N / 2) - 1)) % MOD;
if (N % 2 == 1) {
res = (res * 3) % MOD;
}
}
cout << res << endl;
return 0;
}
ats5515