Submission #11700160


Source Code Expand

#include<bits/stdc++.h>
using namespace std;
#define step(i, s, n, d) for(int i=s; i<n; i+=d)
#define FOR(i,s,n) step(i,s,n,1)
#define rep(i,n) FOR(i,0,n)
#define ll long long
typedef pair<int, int> P;

int main(){
  int N, M;
  cin >> N >> M;
  double A[N];
  rep(i, N) {
    cin >> A[i];
  }
  sort(A, A+N, std::greater<int>());
  double sum = accumulate(A, A+N, 0);
  double target = A[M-1];
  if ((target / sum) < (1.0/ (4.0 * M))) {
    cout << "No" << "\n";
  } else {
    cout << "Yes" << "\n";
  }
}

Submission Info

Submission Time
Task B - Popular Vote
User KeitaKishida0811
Language C++14 (GCC 5.4.1)
Score 200
Code Size 532 Byte
Status AC
Exec Time 1 ms
Memory 256 KiB

Judge Result

Set Name Sample All
Score / Max Score 0 / 0 200 / 200
Status
AC × 3
AC × 16
Set Name Test Cases
Sample sample_01, sample_02, sample_03
All hand_01, hand_02, hand_03, hand_04, hand_05, hand_06, max_01, max_02, random_01, random_02, random_03, random_04, random_05, sample_01, sample_02, sample_03
Case Name Status Exec Time Memory
hand_01 AC 1 ms 256 KiB
hand_02 AC 1 ms 256 KiB
hand_03 AC 1 ms 256 KiB
hand_04 AC 1 ms 256 KiB
hand_05 AC 1 ms 256 KiB
hand_06 AC 1 ms 256 KiB
max_01 AC 1 ms 256 KiB
max_02 AC 1 ms 256 KiB
random_01 AC 1 ms 256 KiB
random_02 AC 1 ms 256 KiB
random_03 AC 1 ms 256 KiB
random_04 AC 1 ms 256 KiB
random_05 AC 1 ms 256 KiB
sample_01 AC 1 ms 256 KiB
sample_02 AC 1 ms 256 KiB
sample_03 AC 1 ms 256 KiB