結果
問題 |
No.1682 Unfair Game
|
ユーザー |
![]() |
提出日時 | 2021-12-07 20:12:48 |
言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 607 bytes |
コンパイル時間 | 1,807 ms |
コンパイル使用メモリ | 194,124 KB |
最終ジャッジ日時 | 2025-01-26 06:35:17 |
ジャッジサーバーID (参考情報) |
judge4 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 2 |
other | AC * 13 WA * 7 |
ソースコード
#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; return 0; } cout << modpow(2,cnt-1)*modpow(2,n-cnt)%mod << endl; }