結果

問題 No.557 点対称
ユーザー char134217728char134217728
提出日時 2017-08-16 06:59:01
言語 C++11
(gcc 11.4.0)
結果
WA  
実行時間 -
コード長 640 bytes
コンパイル時間 1,285 ms
コンパイル使用メモリ 144,752 KB
実行使用メモリ 4,512 KB
最終ジャッジ日時 2023-08-03 14:55:05
合計ジャッジ時間 2,652 ms
ジャッジサーバーID
(参考情報)
judge11 / judge14
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
4,376 KB
testcase_01 WA -
testcase_02 AC 1 ms
4,380 KB
testcase_03 WA -
testcase_04 WA -
testcase_05 AC 2 ms
4,380 KB
testcase_06 AC 1 ms
4,380 KB
testcase_07 WA -
testcase_08 AC 1 ms
4,380 KB
testcase_09 AC 2 ms
4,376 KB
testcase_10 WA -
testcase_11 AC 2 ms
4,376 KB
testcase_12 AC 1 ms
4,380 KB
testcase_13 AC 2 ms
4,380 KB
testcase_14 AC 2 ms
4,380 KB
testcase_15 AC 1 ms
4,376 KB
testcase_16 WA -
testcase_17 AC 1 ms
4,380 KB
testcase_18 AC 2 ms
4,376 KB
testcase_19 WA -
testcase_20 WA -
testcase_21 WA -
testcase_22 AC 2 ms
4,380 KB
testcase_23 WA -
testcase_24 WA -
testcase_25 AC 2 ms
4,376 KB
testcase_26 AC 2 ms
4,376 KB
testcase_27 AC 1 ms
4,376 KB
testcase_28 AC 1 ms
4,376 KB
testcase_29 AC 2 ms
4,376 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
main.cpp:24:6: warning: ISO C++ forbids declaration of ‘main’ with no type [-Wreturn-type]
 main(){
      ^

ソースコード

diff #

#include <bits/stdc++.h>
#define FOR(i,a,b) for (int i=(a);i<(b);i++)
#define FORR(i,a,b) for (int i=(a);i>=(b);i--)
#define pb push_back

using namespace std;
typedef long long ll;
typedef pair<int,int> pii;
typedef vector<int> vi;
typedef set<int> si;
const int inf = 1e9;
const int mod = 1e9+7;

ll powMod(ll a, ll n, ll m){
  ll p = 1;
  while(n > 0){
    if(n & 1) p = p * a % m;
    a = a * a % m;
    n >>= 1;
  }
  return p;
}
int n;
main(){
  cin.tie(0);
  ios::sync_with_stdio(false);
  cin >> n;
  if(n == 1){
    cout << 2 << endl;
    return 0;
  }
  cout << 4ll * powMod(5, n/2 - 1, mod) % mod * (n%2 ? 3 : 1) % mod << endl;
}
0