結果

問題 No.412 花火大会
ユーザー srup٩(๑`н´๑)۶srup٩(๑`н´๑)۶
提出日時 2016-08-13 20:09:17
言語 C++11
(gcc 11.4.0)
結果
AC  
実行時間 2 ms / 2,000 ms
コード長 800 bytes
コンパイル時間 617 ms
コンパイル使用メモリ 69,504 KB
実行使用メモリ 5,376 KB
最終ジャッジ日時 2024-04-25 06:29:22
合計ジャッジ時間 1,365 ms
ジャッジサーバーID
(参考情報)
judge2 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
5,248 KB
testcase_01 AC 2 ms
5,376 KB
testcase_02 AC 2 ms
5,376 KB
testcase_03 AC 2 ms
5,376 KB
testcase_04 AC 2 ms
5,376 KB
testcase_05 AC 2 ms
5,376 KB
testcase_06 AC 1 ms
5,376 KB
testcase_07 AC 2 ms
5,376 KB
testcase_08 AC 2 ms
5,376 KB
testcase_09 AC 2 ms
5,376 KB
testcase_10 AC 2 ms
5,376 KB
testcase_11 AC 1 ms
5,376 KB
testcase_12 AC 2 ms
5,376 KB
testcase_13 AC 2 ms
5,376 KB
testcase_14 AC 2 ms
5,376 KB
testcase_15 AC 2 ms
5,376 KB
testcase_16 AC 2 ms
5,376 KB
testcase_17 AC 1 ms
5,376 KB
testcase_18 AC 2 ms
5,376 KB
testcase_19 AC 2 ms
5,376 KB
testcase_20 AC 2 ms
5,376 KB
testcase_21 AC 2 ms
5,376 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>
#include <algorithm>
#include <vector>
#include <cstdio>
#include <cmath>
using namespace std;
#define rep(i,n) for(int i=0;i<(n);i++)
#define reps(i,k,n) for(int i=k;i<(n);i++)


int n;
int syou, tyuu, dai;
vector<int> e;

int main(void){
	int b, c, d; cin >> b >> c >> d;
	syou = min(b, min(c, d));
	dai = max(b, max(c, d));
	tyuu = b + c + d - dai - syou;

	cin >> n;
	rep(i, n){
		int tmp; cin >> tmp;
		e.push_back(tmp);
	}
	sort(e.begin(), e.end());
	long long ans = 0;
	rep(i, n){
		reps(j, i + 1, n){
			reps(k, j + 1, n){
				if(e[i] >= syou && e[j] >= tyuu & e[k] >= dai){
					ans += pow(2, i);//上記の3つ以外で条件を満たすものは使う使わないの2通りの方法を選ぶことができる
				}
			}
		}
	}
	printf("%lld\n", ans);
	return 0;
}
0