結果
問題 |
No.1682 Unfair Game
|
ユーザー |
![]() |
提出日時 | 2021-12-07 20:12:27 |
言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 589 bytes |
コンパイル時間 | 2,093 ms |
コンパイル使用メモリ | 194,380 KB |
最終ジャッジ日時 | 2025-01-26 06:35:09 |
ジャッジサーバーID (参考情報) |
judge5 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 1 WA * 1 |
other | AC * 5 WA * 15 |
ソースコード
#include <bits/stdc++.h> using namespace std; constexpr int mod = 1000000007; long long modpow(long long a,long long b) { long long ans = 1; while(b) { if(b & 1) { (ans *= a) %= mod; } (a *= a) %= mod; b /= 2; } return ans; } int main() { int n; cin >> n; vector<int>p(n); int cnt = 0; for(int i = 0; i < n; i++) { cin >> p[i]; if(p[i] > 50) { cnt++; } } if(cnt == 0) { cout << 0 << endl; } cout << modpow(2,cnt-1)*modpow(2,n-cnt)%mod << endl; }