結果

問題 No.1237 EXP Multiple!
ユーザー bonKotsubonKotsu
提出日時 2020-12-16 18:00:34
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 549 bytes
コンパイル時間 1,592 ms
コンパイル使用メモリ 166,532 KB
実行使用メモリ 4,348 KB
最終ジャッジ日時 2023-10-20 09:43:22
合計ジャッジ時間 2,841 ms
ジャッジサーバーID
(参考情報)
judge14 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
4,348 KB
testcase_01 AC 2 ms
4,348 KB
testcase_02 AC 2 ms
4,348 KB
testcase_03 AC 2 ms
4,348 KB
testcase_04 AC 1 ms
4,348 KB
testcase_05 WA -
testcase_06 AC 1 ms
4,348 KB
testcase_07 WA -
testcase_08 AC 31 ms
4,348 KB
testcase_09 WA -
testcase_10 WA -
testcase_11 AC 2 ms
4,348 KB
testcase_12 AC 27 ms
4,348 KB
testcase_13 AC 32 ms
4,348 KB
testcase_14 AC 31 ms
4,348 KB
testcase_15 AC 31 ms
4,348 KB
testcase_16 AC 31 ms
4,348 KB
testcase_17 AC 31 ms
4,348 KB
testcase_18 AC 32 ms
4,348 KB
testcase_19 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;

#define ll long long
#define rep(i, n) for (int i = 0; i < (n); i++)
#define P pair<int, int>

ll memo[4] = {0, 1, 4, 729};

const ll MOD = 10e8 + 7;
int main() {
  ll n;
  cin >> n;

  ll ans = 1;

  rep(i, n) {
    int a;
    cin >> a;

    if (a >= 4) {
      cout << MOD << endl;
      return 0;
    } 

    if (a == 0) {
      cout << 0 << endl;
      return 0;
    }

    ans *= memo[a];

    if (ans >= MOD) {
      cout << MOD << endl;
      return 0;
    }
  }

  cout << MOD % ans << endl;

}
0