結果

問題 No.557 点対称
ユーザー whogoh
提出日時 2017-08-21 20:22:13
言語 C++14
(gcc 13.3.0 + boost 1.87.0)
結果
WA  
実行時間 -
コード長 641 bytes
コンパイル時間 708 ms
コンパイル使用メモリ 79,048 KB
実行使用メモリ 10,496 KB
最終ジャッジ日時 2024-10-15 00:52:20
合計ジャッジ時間 4,261 ms
ジャッジサーバーID
(参考情報)
judge3 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 4 WA * 4 TLE * 1 -- * 21
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>
#include <iomanip>
#include <vector>
#include <algorithm>
#include <string>
#include <map>
#include <stdio.h>
#include <stdlib.h>
using namespace std;

static const double pi = 3.14159265358979323846;

long long mod = 1000000007;


int main(){
  int N;
  cin >> N;

  if(N==1) {cout << 2 << endl; return 0;}

  bool even = N%2 == 0;

  long long ret = 1;
  for(int i=0; i<(N+1)/2; i++){
    if(i==0) {ret *= 4; ret %= mod;}
    else if (i==((N+1)/2-1)){
      if(even) {ret *= 5; ret %= mod;}
      else {ret *= 3; ret %= mod;}
    }
    else{
      ret *= 5; ret %= mod;
    }
  }

  cout << ret << endl;

  return 0;
}
0