結果
問題 |
No.1336 Union on Blackboard
|
ユーザー |
|
提出日時 | 2021-01-17 17:27:10 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 760 bytes |
コンパイル時間 | 1,638 ms |
コンパイル使用メモリ | 167,160 KB |
実行使用メモリ | 6,824 KB |
最終ジャッジ日時 | 2024-11-29 21:30:00 |
合計ジャッジ時間 | 3,003 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | WA * 1 |
other | WA * 31 |
ソースコード
#include<bits/stdc++.h> // #include<atcoder/all> using namespace std; // using namespace atcoder; using lint = long long; #define endl '\n' lint const mod = 1e9+7; //long const mod = 998244353; lint inv_mod(lint x, lint p){ lint ans = 1; lint tmp = x; for(lint i=1;i<=(p-2);i *= 2){ if(i & (p-2)){ ans *= tmp; } ans %= p; tmp = tmp*tmp; tmp %= p; } return ans; } void solve(){ int n; cin >> n; int a[n]; lint ans = 1; for(int i=0;i<n;i++){ cin >> a[i]; ans *= a[i]; ans %= mod; } ans--; if(ans < 0)ans+=mod; cout << ans << endl; } int main(){ int t; cin >> t; for(int i=0;i<t;i++){ solve(); } }