結果
| 問題 |
No.557 点対称
|
| ユーザー |
|
| 提出日時 | 2017-08-11 22:54:07 |
| 言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
AC
|
| 実行時間 | 2 ms / 2,000 ms |
| コード長 | 463 bytes |
| コンパイル時間 | 1,593 ms |
| コンパイル使用メモリ | 165,644 KB |
| 実行使用メモリ | 5,248 KB |
| 最終ジャッジ日時 | 2024-10-12 21:36:12 |
| 合計ジャッジ時間 | 2,533 ms |
|
ジャッジサーバーID (参考情報) |
judge2 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 30 |
ソースコード
#include<bits/stdc++.h>
#define MOD 1000000007
#define rep(i,n)for(int i=0;i<(n);i++)
using namespace std;
typedef long long ll;
ll ppow(ll a,ll b){
ll res=1;
while(b){
if(b&1)res=(res*a)%MOD;
a=(a*a)%MOD;
b>>=1;
}
return res;
}
int main() {
ll n;scanf("%lld",&n);
if(n==1){
puts("2");return 0;
}
if(n==2){
puts("4");return 0;
}
if(n%2==1){
printf("%lld\n",(4*ppow(5,n/2-1)*3)%MOD);
}
else{
printf("%lld\n",(4*ppow(5,n/2-1))%MOD);
}
}