結果
| 問題 | No.1237 EXP Multiple! |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2020-09-25 23:58:00 |
| 言語 | C++17(clang) (17.0.6 + boost 1.89.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 673 bytes |
| 記録 | |
| コンパイル時間 | 1,547 ms |
| コンパイル使用メモリ | 138,016 KB |
| 実行使用メモリ | 6,948 KB |
| 最終ジャッジ日時 | 2024-06-28 08:25:10 |
| 合計ジャッジ時間 | 2,770 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 1 |
| other | AC * 11 WA * 8 |
ソースコード
#include <algorithm>
#include <cmath>
#include <cstdio>
#include <functional>
#include <iostream>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <vector>
using namespace std;
using ll = long long;
int main() {
ll limit = 1000000007;
int n;
cin >> n;
ll num = 1;
for(int i = 0; i < n; i++) {
ll tmp, a;
cin >> a;
if(a < 2) {
continue;
}
tmp = a;
while(tmp--) {
for(int j = 0; j < tmp + 1; j++) {
num *= a;
if(num > limit) {
cout << limit << '\n';
return 0;
}
}
}
}
cout << limit % num << '\n';
return 0;
}