結果

問題 No.557 点対称
ユーザー whogohwhogoh
提出日時 2017-08-21 20:22:13
言語 C++14
(gcc 13.2.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 641 bytes
コンパイル時間 668 ms
コンパイル使用メモリ 78,900 KB
実行使用メモリ 8,756 KB
最終ジャッジ日時 2023-08-05 03:05:07
合計ジャッジ時間 4,346 ms
ジャッジサーバーID
(参考情報)
judge14 / judge13
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
8,756 KB
testcase_01 WA -
testcase_02 AC 1 ms
4,380 KB
testcase_03 WA -
testcase_04 WA -
testcase_05 AC 2 ms
4,376 KB
testcase_06 AC 2 ms
4,376 KB
testcase_07 WA -
testcase_08 TLE -
testcase_09 -- -
testcase_10 -- -
testcase_11 -- -
testcase_12 -- -
testcase_13 -- -
testcase_14 -- -
testcase_15 -- -
testcase_16 -- -
testcase_17 -- -
testcase_18 -- -
testcase_19 -- -
testcase_20 -- -
testcase_21 -- -
testcase_22 -- -
testcase_23 -- -
testcase_24 -- -
testcase_25 -- -
testcase_26 -- -
testcase_27 -- -
testcase_28 -- -
testcase_29 -- -
権限があれば一括ダウンロードができます

ソースコード

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