結果
| 問題 | No.557 点対称 |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2017-08-11 22:44:26 |
| 言語 | C++11 (gcc 15.2.0 + boost 1.89.0) |
| 結果 |
AC
|
| 実行時間 | 2 ms / 2,000 ms |
| コード長 | 450 bytes |
| 記録 | |
| コンパイル時間 | 1,436 ms |
| コンパイル使用メモリ | 174,124 KB |
| 実行使用メモリ | 6,400 KB |
| 最終ジャッジ日時 | 2026-04-30 01:17:44 |
| 合計ジャッジ時間 | 1,990 ms |
|
ジャッジサーバーID (参考情報) |
judge3_0 / judge1_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 30 |
ソースコード
#include <bits/stdc++.h>
#define MOD 1000000007LL
using namespace std;
typedef long long ll;
typedef pair<int,int> P;
ll mod_pow(ll x,ll n){
ll res=1;
while(n>0){
if(n&1)res=res*x%MOD;
x=x*x%MOD;
n>>=1;
}
return res;
}
int main(void){
ll n;
scanf("%lld",&n);
ll res=1;
if(n%2==1){
if(n==1)res=res*2LL%MOD;
else res=res*3LL%MOD;
}
res=res*mod_pow(5,n/2-1)%MOD;
if(n>=2){
res=res*4LL%MOD;
}
printf("%lld\n",res);
return 0;
}