提出 #11508322
ソースコード 拡げる
#include<bits/stdc++.h>
using namespace std;
#define ll long long int
#define pi pair<ll,ll>
void solve(){
int n, m; cin >> n >> m;
int ans = 0;
vector<ll> v(n);
for (int i = 0; i < n; i += 1) {
cin >> v[i];
}
ll sum = accumulate(v.begin(), v.end(), 0LL);
for (int i = 0; i < n; i += 1) {
if (v[i]*4*m >= sum)
ans += 1;
}
if (ans >= m)
cout << "Yes\n";
else
cout << "No\n";
}
int main(){
ios_base::sync_with_stdio(false);
cin.tie(0); cout.tie(0);
int test = 1;
// cin >> test;
while(test--)
solve();
return 0;
}
提出情報
| 提出日時 | |
|---|---|
| 問題 | B - Popular Vote |
| ユーザ | harshraj22 |
| 言語 | C++14 (GCC 5.4.1) |
| 得点 | 200 |
| コード長 | 675 Byte |
| 結果 | AC |
| 実行時間 | 1 ms |
| メモリ | 256 KiB |
ジャッジ結果
| セット名 | Sample | All | ||||
|---|---|---|---|---|---|---|
| 得点 / 配点 | 0 / 0 | 200 / 200 | ||||
| 結果 |
|
|
| セット名 | テストケース |
|---|---|
| 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 |
| ケース名 | 結果 | 実行時間 | メモリ |
|---|---|---|---|
| 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 |