結果

問題 No.1682 Unfair Game
コンテスト
ユーザー umezo
提出日時 2021-09-17 23:21:52
言語 C++17
(gcc 15.2.0 + boost 1.90.0)
コンパイル:
g++-15 -O2 -lm -std=c++17 -Wuninitialized -DONLINE_JUDGE -o a.out _filename_
実行:
./a.out
結果
WA  
実行時間 -
コード長 573 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 1,304 ms
コンパイル使用メモリ 212,664 KB
実行使用メモリ 7,972 KB
最終ジャッジ日時 2026-06-23 05:20:33
合計ジャッジ時間 2,698 ms
ジャッジサーバーID
(参考情報)
judge3_0 / judge1_1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 13 WA * 7
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

#define rep(i,n) for(int i=0;i<(int)(n);i++)
#define ALL(v) v.begin(),v.end()
typedef long long ll;
 
#include<bits/stdc++.h>
using namespace std;

const int MOD=1e9+7;

ll modpow(ll x,ll n){
  ll ans=1;
  while(n){
    if(n&1) ans=ans*x%MOD;
    x=x*x%MOD;
    n/=2;
  }
  return ans;
}
 
int main(){
  ios::sync_with_stdio(false);
  std::cin.tie(nullptr);
  
  int n;
  cin>>n;
  vector<ll> P(n);
  rep(i,n) cin>>P[i];
  
  ll cnt=0;
  rep(i,n){
    if(P[i]>50) cnt++;
  }
  if(cnt==0) cout<<0<<endl;
  else cout<<modpow(2,cnt-1)*modpow(2,n-cnt)%MOD<<endl;

  return 0;
}
0