結果
問題 |
No.1237 EXP Multiple!
|
ユーザー |
![]() |
提出日時 | 2022-08-17 12:13:02 |
言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 538 bytes |
コンパイル時間 | 2,152 ms |
コンパイル使用メモリ | 200,212 KB |
最終ジャッジ日時 | 2025-01-30 23:25:37 |
ジャッジサーバーID (参考情報) |
judge3 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 1 |
other | AC * 17 WA * 2 |
ソースコード
#include <bits/stdc++.h> using namespace std; #define int long long signed main(){ int N; cin>>N; vector<int> S(N); for(int i=0;i<N;i++) cin>>S[i]; sort(S.rbegin(),S.rend()); if(S[0] >= 4){ cout<<1000000007<<endl; return 0; } vector<int> A={0,1,4,729}; int ans = 1; for(int i=0;i<N;i++){ if(S[i] == 0){ cout<<-1<<endl; return 0; } ans *= A[S[i]]; if(ans > 1e9+7){ cout<<1000000007<<endl; return 0; } } cout<<1000000007%ans<<endl; }