結果

問題 No.412 花火大会
ユーザー Hank
提出日時 2017-07-19 13:10:35
言語 C++11(廃止可能性あり)
(gcc 13.3.0)
結果
AC  
実行時間 2 ms / 2,000 ms
コード長 901 bytes
コンパイル時間 914 ms
コンパイル使用メモリ 69,624 KB
実行使用メモリ 5,248 KB
最終ジャッジ日時 2024-10-08 14:16:32
合計ジャッジ時間 1,611 ms
ジャッジサーバーID
(参考情報)
judge2 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 4
other AC * 18
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>
#include <vector>
#include <algorithm>
#include <math.h>
using namespace std;

#define ll long long

ll B,C,D;
ll N;
vector<ll>E;

void sortinput(){
  vector<ll> s;
  s.push_back(B);
  s.push_back(C);
  s.push_back(D);

  sort(s.begin(),s.end());
  B=s[0];
  C=s[1];
  D=s[2];
}

ll judge(ll b, ll c, ll d){
  if(((b>=B)&&(c>=C))&&(d>=D)){
    return 1;
  }
  return 0;
}


ll pl(ll i){
  if(i<=0) return 1;
  else return pow(2,i);
}

int main(){

  ll inp;
  ll compare,count;
  ll result =0;
  ll outp;
  
  cin >> B >> C >> D;
  cin >> N;

  for(ll i =0;i<N;i++){
    cin >>inp;
    E.push_back(inp);
  }
  sort(E.begin(),E.end());
  sortinput();

    
  if(N<3){
    cout << "0" << endl;
    return 0;
  }
  for(ll i =0;i<N;i++){
    for(ll j=i+1;j<N;j++){
      for(ll k=j+1;k<N;k++){
	result+=judge(E[i],E[j],E[k])*pl(i);
      }
    }
  }

  
  cout << result << endl;
  
}
0