結果

問題 No.1682 Unfair Game
ユーザー SSRS
提出日時 2021-09-17 21:46:57
言語 C++14
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 3 ms / 2,000 ms
コード長 518 bytes
コンパイル時間 1,498 ms
コンパイル使用メモリ 169,388 KB
実行使用メモリ 6,944 KB
最終ジャッジ日時 2024-06-29 20:11:05
合計ジャッジ時間 2,256 ms
ジャッジサーバーID
(参考情報)
judge1 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 20
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;
const long long MOD = 1000000007;
int main(){
  int N;
  cin >> N;
  vector<int> P(N);
  for (int i = 0; i < N; i++){
    cin >> P[i];
  }
  int cnt1 = 0, cnt2 = 0;
  for (int i = 0; i < N; i++){
    if (P[i] < 50){
      cnt1++;
    }
    if (P[i] > 50){
      cnt2++;
    }
  }
  if (cnt2 == 0){
    cout << 0 << endl;
  } else {
    long long ans = 1;
    for (int i = 0; i < cnt1 + cnt2 - 1; i++){
      ans *= 2;
      ans %= MOD;
    }
    cout << ans << endl;
  }
}
0