結果
問題 |
No.1682 Unfair Game
|
ユーザー |
|
提出日時 | 2021-11-17 12:11:51 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 2 ms / 2,000 ms |
コード長 | 849 bytes |
コンパイル時間 | 767 ms |
コンパイル使用メモリ | 82,164 KB |
実行使用メモリ | 5,248 KB |
最終ジャッジ日時 | 2024-12-23 09:12:31 |
合計ジャッジ時間 | 1,537 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 2 |
other | AC * 20 |
ソースコード
#include<iostream> #include<string> #include<iomanip> #include<cmath> #include<vector> #include<algorithm> #include<utility> using namespace std; #define int long long #define endl "\n" constexpr long long INF = 1e18; constexpr long long MOD = 1000000007; struct fast_io { fast_io(){ std::cin.tie(nullptr); std::ios::sync_with_stdio(false); cout<<fixed<<setprecision(10); }; } fio; int power(int n, int k){ int res = 1; while(k) { if(k&1) res *= n; k >>= 1; n *= n; res %= MOD; n %= MOD; } return res; } signed main(){ int N, a = 0, b = 0; vector<int> P; cin>>N; P.resize(N); for(int i = 0; i < N; i++){ cin>>P[i]; if(P[i] < 50) a++; else if(P[i] > 50) b++; } if(b) cout<<power(2, a + b - 1)<<endl; else cout<<0<<endl; return 0; }