結果
問題 |
No.1238 選抜クラス
|
ユーザー |
![]() |
提出日時 | 2020-09-08 00:15:00 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 513 bytes |
コンパイル時間 | 1,389 ms |
コンパイル使用メモリ | 168,832 KB |
実行使用メモリ | 6,824 KB |
最終ジャッジ日時 | 2024-11-29 11:36:02 |
合計ジャッジ時間 | 2,344 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 17 WA * 19 |
ソースコード
#include <bits/stdc++.h> #define rep(i,n) for(int i=0; i<(int)(n); i++) using namespace std; using LL = long long; const LL mod = 1e9 + 7; const int Max_N = 100; const int Max_K = 100; const int Max_A = 100; int main(){ int N, K; cin >> N >> K; vector<int> A(N); rep(i,N) cin >> A[i]; if(N > 20){ cout << 0 << endl; return 0; } int ans = 0; rep(bit,1<<N){ int num = 0, res = 0; rep(i,N) if(bit & (1<<i)) num++, res += A[i]; if(res >= num * K) ans++; } cout << ans - 1 << endl; return 0; }