buggy_code stringlengths 11 625k | fixed_code stringlengths 17 625k | bug_type stringlengths 2 4.45k | language int64 0 8 | token_count int64 5 200k |
|---|---|---|---|---|
#include <stdio.h>
int main(void) {
int N, M, i, ans = 0, cnt = 0;
int a[1000];
scanf("%d %d", &N, &M);
for (i = 0; i < N; i++) {
scanf("%d\n", &a[i]);
}
for (i = 0; i < N; i++) {
ans = ans + a[i];
}
for (i = 0; i < N; i++) {
if (a[i] >= ans / (4 * M)) {
cnt = cnt + 1;
}
}
... | #include <stdio.h>
int main(void) {
int N, M, i, ans = 0, cnt = 0;
int a[1000];
scanf("%d %d", &N, &M);
for (i = 0; i < N; i++) {
scanf("%d", &a[i]);
}
for (i = 0; i < N; i++) {
ans = ans + a[i];
}
for (i = 0; i < N; i++) {
if (a[i] >= ans / (4.0 * M)) {
cnt = cnt + 1;
}
}
... | [["-", 0, 1, 0, 2, 3, 4, 0, 5, 0, 44], ["-", 0, 16, 12, 16, 12, 23, 0, 16, 31, 13], ["+", 0, 16, 12, 16, 12, 23, 0, 16, 31, 13]] | 0 | 161 |
n,m=map(int,input().split());a=sorted(map(int,input().split()),reverse=True)
print('NYOE S'[all([1 if a[i]>=sum(a)/(4*m) else 0 for i in range(m)])::2]) | n,m=map(int,input().split());a=sorted(map(int,input().split()),reverse=True)
print('NYoe s'[all([1 if a[i]>=sum(a)/(4*m) else 0 for i in range(m)])::2]) | [["-", 0, 652, 3, 4, 0, 206, 51, 557, 0, 6], ["+", 0, 652, 3, 4, 0, 206, 51, 557, 0, 6]] | 5 | 80 |
// #pragma GCC target("avx2")
// #pragma GCC optimize("O3")
// #pragma GCC optimize("unroll-loops")
// #pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
#include <bits/stdc++.h>
using namespace std;
// for loop関係
#define rep(i, a, n) for (int i = (a); i < (n); ++i)
#define repe(i, a, n) fo... | // #pragma GCC target("avx2")
// #pragma GCC optimize("O3")
// #pragma GCC optimize("unroll-loops")
// #pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
#include <bits/stdc++.h>
using namespace std;
// for loop関係
#define rep(i, a, n) for (int i = (a); i < (n); ++i)
#define repe(i, a, n) fo... | [["-", 15, 339, 51, 16, 12, 74, 39, 77, 39, 40], ["-", 0, 57, 15, 339, 51, 16, 12, 74, 0, 25], ["+", 0, 16, 31, 23, 0, 74, 39, 77, 39, 40], ["+", 12, 23, 0, 16, 31, 23, 0, 74, 0, 25]] | 1 | 415 |
N, M = map(int, input().split())
A = list(map(int, input().split()))
cnt = 0
th = sum(A)/(4*M)
for i in range(len(A)):
if A[i] > th:
cnt += 1
ans = 'Yes' if cnt >= M else 'No'
print(ans) | N, M = map(int, input().split())
A = list(map(int, input().split()))
cnt = 0
th = sum(A)/(4*M)
for i in range(len(A)):
if A[i] >= th:
cnt += 1
ans = 'Yes' if cnt >= M else 'No'
print(ans) | [["-", 0, 7, 8, 196, 0, 57, 15, 666, 667, 47], ["+", 0, 7, 8, 196, 0, 57, 15, 666, 667, 20]] | 5 | 87 |
n,m = map(int,input().split())
a = list(map(int,input().split()))
sorted(a,reverse=True)
count = 0
for i in a:
if i >=sum(a)//(4*m):
count += 1
else:
pass
print(['No','Yes'][count >= m])
| n,m = map(int,input().split())
a = list(map(int,input().split()))
sorted(a,reverse=True)
count = 0
for i in a:
if i >=sum(a)/(4*m):
count += 1
else:
pass
print(['No','Yes'][count >= m])
| [["-", 8, 196, 0, 57, 15, 666, 0, 657, 17, 676], ["+", 8, 196, 0, 57, 15, 666, 0, 657, 17, 85]] | 5 | 86 |
#include <bits/stdc++.h>
using namespace std;
int main() {
int N, M, sum = 0;
cin >> N >> M;
vector<int> A(N);
for (int i = 0; i < N; i++) {
cin >> A.at(i);
sum += A.at(i);
}
sum /= 4 * M;
int cnt = 0;
for (int i = 0; i < N; i++) {
if (A.at(i) >= sum) {
cnt++;
}
}
cout << (cnt... | #include <bits/stdc++.h>
using namespace std;
int main() {
int N, M;
double sum = 0.0;
cin >> N >> M;
vector<int> A(N);
for (int i = 0; i < N; i++) {
cin >> A.at(i);
sum += A.at(i);
}
sum /= (4 * M);
int cnt = 0;
for (int i = 0; i < N; i++) {
if (A.at(i) >= sum) {
cnt++;
}
}
... | [["-", 0, 30, 0, 14, 8, 9, 0, 43, 0, 21], ["+", 0, 30, 0, 14, 8, 9, 0, 43, 0, 35], ["+", 0, 30, 0, 14, 8, 9, 0, 43, 39, 40], ["-", 0, 14, 8, 9, 0, 43, 49, 50, 51, 13], ["+", 0, 14, 8, 9, 0, 43, 49, 50, 51, 13], ["+", 8, 9, 0, 1, 0, 11, 12, 23, 0, 24], ["+", 8, 9, 0, 1, 0, 11, 12, 23, 0, 25]] | 1 | 131 |
#include <stdio.h>
#include <stdlib.h>
int main() {
int n = 0;
int m;
scanf("%d", &n);
scanf("%d", &m);
int *a;
a = malloc(sizeof(int) * n);
for (int i = 0; i < n; i++) {
scanf("%d", &a[i]);
}
int s = 0;
for (int i = 0; i < n; i++) {
s += a[i];
}
s = s / (4 * m);
int count = 0;
fo... | #include <stdio.h>
#include <stdlib.h>
int main() {
int n = 0;
int m;
scanf("%d", &n);
scanf("%d", &m);
int *a;
a = malloc(sizeof(int) * n);
for (int i = 0; i < n; i++) {
scanf("%d", &a[i]);
}
double s = 0;
for (int i = 0; i < n; i++) {
s += a[i];
}
s = s / (4 * m);
int count = 0;
... | [["-", 0, 30, 0, 14, 8, 9, 0, 43, 39, 40], ["+", 0, 30, 0, 14, 8, 9, 0, 43, 39, 40]] | 0 | 183 |
n,m = list(map(int,input().split()))
A = list(map(int,input().split()))
sum_A = sum(A) / 4
cnt = 0
for i in A:
if i >= sum_A:
cnt += 1
if cnt >= m:
print('Yes')
else:
print('No')
| n,m = list(map(int,input().split()))
A = list(map(int,input().split()))
sum_A = sum(A) / 4 / m
cnt = 0
for i in A:
if i >= sum_A:
cnt += 1
if cnt >= m:
print('Yes')
else:
print('No')
| [["+", 0, 656, 0, 1, 0, 662, 12, 657, 17, 85], ["+", 0, 656, 0, 1, 0, 662, 12, 657, 12, 22]] | 5 | 79 |
#include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (n); ++i)
using namespace std;
using ll = long long;
using P = pair<int, int>;
int main() {
int n, m;
cin >> n >> m;
vector<int> a(n);
rep(i, n) cin >> a[i];
int cnt = 0;
int th = (accumulate(a.begin(), a.end(), 0) + 4 * m - 1) / (4 * m);
rep... | #include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (n); ++i)
using namespace std;
using ll = long long;
using P = pair<int, int>;
int main() {
int n, m;
cin >> n >> m;
vector<int> a(n);
rep(i, n) cin >> a[i];
int cnt = 0;
int th = (accumulate(a.begin(), a.end(), 0) + 4 * m - 1) / (4 * m);
rep... | [["-", 8, 9, 0, 57, 15, 339, 51, 16, 17, 47], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 17, 20]] | 1 | 159 |
N,M=map(int,input().split())
A=list(map(int,input().split()))
a=0
for i in A:
a+=i
b=a/(4*M)
c=0
for n in range(0,N):
if A[n]>b:
c+=1
if c>=M:
print('Yes')
else:
print('No')
| N,M=map(int,input().split())
A=list(map(int,input().split()))
a=0
for i in A:
a+=i
b=a/(4*M)
c=0
for n in range(0,N):
if A[n]>=b:
c+=1
if c>=M:
print('Yes')
else:
print('No')
| [["-", 0, 7, 8, 196, 0, 57, 15, 666, 667, 47], ["+", 0, 7, 8, 196, 0, 57, 15, 666, 667, 20]] | 5 | 96 |
#include <algorithm>
#include <assert.h>
#include <bitset>
#include <cassert>
#include <cctype>
#include <cfloat>
#include <climits>
#include <cmath>
#include <complex>
#include <cstdint>
#include <cstdio>
#include <ctime>
#include <deque>
#include <fstream>
#include <functional>
#include <iomanip>
#include <iostream>
... | #include <algorithm>
#include <assert.h>
#include <bitset>
#include <cassert>
#include <cctype>
#include <cfloat>
#include <climits>
#include <cmath>
#include <complex>
#include <cstdint>
#include <cstdio>
#include <ctime>
#include <deque>
#include <fstream>
#include <functional>
#include <iomanip>
#include <iostream>
... | [["-", 0, 30, 0, 14, 8, 9, 0, 43, 39, 40], ["+", 0, 14, 8, 9, 0, 43, 39, 86, 0, 96], ["+", 0, 14, 8, 9, 0, 43, 39, 86, 39, 40]] | 1 | 381 |
n, m = list(map(int, input().split()))
a = list(map(int, input().split()))
cnt = 0
ttl = sum(a)
for i in a:
if i >= ttl // (4 * m):
cnt += 1
print("Yes") if cnt >= m else print("No")
| n, m = list(map(int, input().split()))
a = list(map(int, input().split()))
cnt = 0
ttl = sum(a)
for i in a:
if i >= ttl / (4 * m):
cnt += 1
print("Yes") if cnt >= m else print("No")
| [["-", 8, 196, 0, 57, 15, 666, 0, 657, 17, 676], ["+", 8, 196, 0, 57, 15, 666, 0, 657, 17, 85]] | 5 | 81 |
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double ld;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
#define IOS \
ios_base::sync_with_stdio(false); \
cin.tie(0)... | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double ld;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
#define IOS \
ios_base::sync_with_stdio(false); \
cin.tie(0)... | [["-", 0, 14, 8, 9, 0, 1, 0, 2, 63, 22], ["+", 0, 14, 8, 9, 0, 1, 0, 2, 63, 22]] | 1 | 176 |
n,m = map(int, input().split())
a = list(map(int, input().split()))
s = 0
total = sum(a)
for i in a:
if total*1/4*m <= i:
s += 1
if s >= m:
print('Yes')
else:
print('No') | n,m = map(int, input().split())
a = list(map(int, input().split()))
s = 0
total = sum(a)
for i in a:
if total/(4*m) <= i:
s += 1
if s >= m:
print('Yes')
else:
print('No') | [["-", 15, 666, 0, 657, 31, 657, 31, 657, 17, 48], ["-", 15, 666, 0, 657, 31, 657, 31, 657, 12, 612], ["+", 0, 57, 15, 666, 0, 657, 12, 23, 0, 24], ["+", 0, 57, 15, 666, 0, 657, 12, 23, 0, 25]] | 5 | 80 |
#include <stdio.h>
int main(void) {
int A[1000];
int n, m, i;
int low;
int gou = 0;
int count = 0;
scanf("%d", &n);
scanf("%d", &m);
for (i = 0; i < n; i++) {
scanf("%d", &A[i]);
gou = gou + A[i];
}
low = gou / (4 * m);
for (i = 0; i < n; i++) {
if (A[i] >= low)
count += 1;
... | #include <stdio.h>
int main(void) {
int A[1000];
int n, m, i;
double low;
double gou = 0;
int count = 0;
scanf("%d", &n);
scanf("%d", &m);
for (i = 0; i < n; i++) {
scanf("%d", &A[i]);
gou = gou + A[i];
}
low = gou / (4 * m);
for (i = 0; i < n; i++) {
if (A[i] >= low)
count +=... | [["-", 0, 30, 0, 14, 8, 9, 0, 43, 39, 40], ["+", 0, 30, 0, 14, 8, 9, 0, 43, 39, 40], ["-", 0, 14, 8, 9, 0, 57, 64, 9, 0, 45], ["-", 0, 14, 8, 9, 0, 57, 64, 9, 0, 46]] | 0 | 156 |
#include <stdio.h>
int main(void) {
int n, m, i;
int x = 0;
int y = 0;
int a[1000];
scanf("%d%d", &n, &m);
for (i = 0; i < n; i++) {
scanf("%d", &a[i]);
x += a[i];
}
x = x / (4 * m);
for (i = 0; i < n; i++) {
if (a[i] >= x)
y++;
}
if (y >= m)
printf("Yes");
else
printf(... | #include <stdio.h>
int main(void) {
int n, m, i;
double x = 0;
int y = 0;
int a[1000];
scanf("%d%d", &n, &m);
for (i = 0; i < n; i++) {
scanf("%d", &a[i]);
x += a[i];
}
x = x / (4 * m);
for (i = 0; i < n; i++) {
if (a[i] >= x)
y++;
}
if (y >= m)
printf("Yes");
else
prin... | [["-", 0, 30, 0, 14, 8, 9, 0, 43, 39, 40], ["+", 0, 30, 0, 14, 8, 9, 0, 43, 39, 40]] | 0 | 141 |
#include <stdio.h>
int main(void) {
int n, m, sum = 0, count = 0;
scanf("%d %d", &n, &m);
int a[1000];
for (int i = 0; i < n; i++) {
scanf("%d", &a[i]);
sum += a[i];
}
for (int i = 0; i < n; i++) {
if (a[i] >= sum / (4 * m))
count++;
}
if (count >= m) {
puts("Yes");
} else {
... | #include <stdio.h>
int main(void) {
int n, m, sum = 0, count = 0;
scanf("%d %d", &n, &m);
int a[1000];
for (int i = 0; i < n; i++) {
scanf("%d", &a[i]);
sum += a[i];
}
for (int i = 0; i < n; i++) {
if (a[i] >= (double)sum / (4 * m))
count++;
}
if (count >= m) {
puts("Yes");
}... | [["+", 15, 23, 0, 16, 12, 16, 31, 74, 0, 24], ["+", 0, 16, 12, 16, 31, 74, 39, 77, 39, 40], ["+", 15, 23, 0, 16, 12, 16, 31, 74, 0, 25]] | 0 | 139 |
#include <stdio.h>
int main(void) {
int n, m;
scanf("%d", &n);
scanf("%d", &m);
int a[n], i, j = 0, sum = 0;
for (i = 0; i < n; i++) {
scanf("%d", &a[i]);
sum = sum + a[i];
}
m = m * 4;
for (i = 0; i < n; i++) {
if (a[i] >= sum / m)
j++;
}
if (j >= m / 4)
printf("Yes\n");
els... | #include <stdio.h>
int main(void) {
int n, m;
scanf("%d", &n);
scanf("%d", &m);
int a[n], i, j = 0;
double sum = 0;
for (i = 0; i < n; i++) {
scanf("%d", &a[i]);
sum = sum + a[i];
}
m = m * 4;
for (i = 0; i < n; i++) {
if (a[i] >= sum / m)
j++;
}
if (j >= m / 4)
printf("Yes\n... | [["-", 0, 30, 0, 14, 8, 9, 0, 43, 0, 21], ["+", 0, 30, 0, 14, 8, 9, 0, 43, 0, 35], ["+", 0, 30, 0, 14, 8, 9, 0, 43, 39, 40]] | 0 | 150 |
#include <stdio.h>
int main() {
int n, m, sum = 0;
int i, flag = 0;
int k;
scanf("%d", &n);
scanf("%d", &m);
int a[n];
for (i = 0; i < n; i++) {
scanf("%d", &a[i]);
sum += a[i];
}
k = sum / (4 * m);
for (i = 0; i < n; i++) {
if (a[i] >= k) {
flag++;
}
}
if (flag >= m) {
... | #include <stdio.h>
int main() {
int n, m, sum = 0;
int i, flag = 0;
double k;
scanf("%d", &n);
scanf("%d", &m);
int a[n];
for (i = 0; i < n; i++) {
scanf("%d", &a[i]);
sum += a[i];
}
k = (double)sum / (4 * m);
for (i = 0; i < n; i++) {
if (a[i] >= k) {
flag++;
}
}
if (fla... | [["-", 0, 30, 0, 14, 8, 9, 0, 43, 39, 40], ["+", 0, 30, 0, 14, 8, 9, 0, 43, 39, 40], ["+", 0, 1, 0, 11, 12, 16, 31, 74, 0, 24], ["+", 0, 11, 12, 16, 31, 74, 39, 77, 39, 40], ["+", 0, 1, 0, 11, 12, 16, 31, 74, 0, 25]] | 0 | 157 |
#include <stdio.h>
int main(void) {
int n, m;
int i, j;
int acc = 0;
int sum = 0;
int pum;
int num[99];
scanf("%d", &n);
scanf("%d", &m);
for (i = 0; i < n; i++) {
scanf("%d", &num[i]);
sum = sum + num[i];
}
pum = sum / (m * 4);
for (j = 0; j < n; j++) {
if (num[j] >= pum) {
ac... | #include <stdio.h>
int main(void) {
int n, m;
int i, j;
int acc = 0;
int sum = 0;
double pum;
int num[99];
scanf("%d", &n);
scanf("%d", &m);
for (i = 0; i < n; i++) {
scanf("%d", &num[i]);
sum = sum + num[i];
}
pum = (double)sum / (m * 4);
for (j = 0; j < n; j++) {
if (num[j] >= pum)... | [["-", 0, 30, 0, 14, 8, 9, 0, 43, 39, 40], ["+", 0, 30, 0, 14, 8, 9, 0, 43, 39, 40], ["+", 0, 1, 0, 11, 12, 16, 31, 74, 0, 24], ["+", 0, 11, 12, 16, 31, 74, 39, 77, 39, 40], ["+", 0, 1, 0, 11, 12, 16, 31, 74, 0, 25]] | 0 | 160 |
#include <stdio.h>
int main() {
int i;
int n, m;
int count = 0, sum = 0;
int popular;
int a[1000];
scanf("%d%d", &n, &m);
for (i = 0; i < n; i++) {
scanf("%d", &a[i]);
sum += a[i];
}
popular = sum / 4 / m;
for (i = 0; i < n; i++) {
if (a[i] >= popular) {
count++;
}
}
... | #include <stdio.h>
int main() {
int i;
int n, m;
int count = 0, sum = 0;
float popular;
int a[1000];
scanf("%d%d", &n, &m);
for (i = 0; i < n; i++) {
scanf("%d", &a[i]);
sum += a[i];
}
popular = (float)sum / 4 / m;
for (i = 0; i < n; i++) {
if (a[i] >= popular) {
count++;
... | [["-", 0, 30, 0, 14, 8, 9, 0, 43, 39, 40], ["+", 0, 30, 0, 14, 8, 9, 0, 43, 39, 40], ["+", 0, 11, 12, 16, 31, 16, 31, 74, 0, 24], ["+", 12, 16, 31, 16, 31, 74, 39, 77, 39, 40], ["+", 0, 11, 12, 16, 31, 16, 31, 74, 0, 25]] | 0 | 145 |
#include <stdio.h>
int main() {
int n, i, j, m;
double w, sum = 0;
scanf("%d%f", &n, &m);
int a[n];
for (i = 0; i < n; i++) {
scanf("%d", &a[i]);
sum = sum + a[i];
}
//降順ソート
for (i = 0; i < n; i++) {
for (j = i + 1; j < n; j++) {
if (a[i] < a[j]) {
int temp = a[i];
a[i]... | #include <stdio.h>
int main() {
int n, i, j, m;
double w, sum = 0;
scanf("%d%d", &n, &m);
int a[n];
for (i = 0; i < n; i++) {
scanf("%d", &a[i]);
sum = sum + a[i];
}
//降順ソート
for (i = 0; i < n; i++) {
for (j = i + 1; j < n; j++) {
if (a[i] < a[j]) {
int temp = a[i];
a[i]... | [["-", 0, 1, 0, 2, 3, 4, 0, 5, 0, 6], ["+", 0, 1, 0, 2, 3, 4, 0, 5, 0, 6]] | 0 | 191 |
#include <algorithm>
#include <assert.h>
#include <bitset>
#include <cassert>
#include <cctype>
#include <cfloat>
#include <climits>
#include <cmath>
#include <complex>
#include <cstdint>
#include <cstdio>
#include <ctime>
#include <deque>
#include <fstream>
#include <functional>
#include <iomanip>
#include <iostream>
... | #include <algorithm>
#include <assert.h>
#include <bitset>
#include <cassert>
#include <cctype>
#include <cfloat>
#include <climits>
#include <cmath>
#include <complex>
#include <cstdint>
#include <cstdio>
#include <ctime>
#include <deque>
#include <fstream>
#include <functional>
#include <iomanip>
#include <iostream>
... | [["-", 0, 30, 0, 14, 8, 9, 0, 43, 39, 40], ["+", 0, 30, 0, 14, 8, 9, 0, 43, 39, 40]] | 1 | 217 |
n, m = list(map(int, input().split()))
A = list(map(int, input().split()))
sum = sum(A)
for a in A:
if a * 4 * m < sum:
cnt += 1
if cnt >= m:
print("Yes")
else:
print("No")
| n, m = list(map(int, input().split()))
A = list(map(int, input().split()))
sum = sum(A)
cnt = 0
for a in A:
if a * 4 * m >= sum:
cnt += 1
if cnt >= m:
print("Yes")
else:
print("No")
| [["+", 36, 36, 0, 656, 0, 1, 0, 662, 31, 22], ["+", 36, 36, 0, 656, 0, 1, 0, 662, 0, 32], ["+", 36, 36, 0, 656, 0, 1, 0, 662, 12, 612], ["-", 0, 7, 8, 196, 0, 57, 15, 666, 667, 18], ["+", 0, 7, 8, 196, 0, 57, 15, 666, 667, 20]] | 5 | 78 |
N,M=map(int,input().split())
A=list(map(int,input().split()))
A.sort(reverse=True)
total=0
for i in range(N):
total+=A[i]
if A[M]>=total/(4*M):
print("Yes")
else:
print("No")
| N,M=map(int,input().split())
A=list(map(int,input().split()))
A.sort(reverse=True)
total=0
for i in range(N):
total+=A[i]
if A[M-1]>=total/(4*M):
print("Yes")
else:
print("No")
| [["+", 0, 57, 15, 666, 0, 206, 206, 657, 17, 33], ["+", 0, 57, 15, 666, 0, 206, 206, 657, 12, 612]] | 5 | 86 |
n,m = map(int,input().split())
li = list(map(int,input().split()))
sum_vote = sum(li)
kijun = sum_vote // (4 * m)
sum_above = len([i for i in li if i >= kijun])
if sum_above >= m:
print("Yes")
else:
print("No")
| n,m = map(int,input().split())
li = list(map(int,input().split()))
sum_vote = sum(li)
kijun = sum_vote / (4 * m)
sum_above = len([i for i in li if i >= kijun])
if sum_above >= m:
print("Yes")
else:
print("No")
| [["-", 0, 656, 0, 1, 0, 662, 12, 657, 17, 676], ["+", 0, 656, 0, 1, 0, 662, 12, 657, 17, 85]] | 5 | 83 |
#include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (n); i++)
using namespace std;
using ll = long long;
using P = pair<int, int>;
int main() {
int N, M;
cin >> N >> M;
vector<int> A(N);
int sum;
rep(i, N) {
cin >> A.at(i);
sum += A.at(i);
}
sort(A.begin(), A.end());
if (A.at(N - M) ... | #include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (n); i++)
using namespace std;
using ll = long long;
using P = pair<int, int>;
int main() {
int N, M;
cin >> N >> M;
vector<int> A(N);
int sum = 0;
rep(i, N) {
cin >> A.at(i);
sum += A.at(i);
}
sort(A.begin(), A.end());
if (A.at(N -... | [["+", 0, 14, 8, 9, 0, 43, 49, 50, 0, 32], ["+", 0, 14, 8, 9, 0, 43, 49, 50, 51, 13], ["-", 0, 1, 0, 16, 31, 16, 12, 5, 0, 6], ["+", 0, 1, 0, 16, 31, 16, 12, 5, 0, 6]] | 1 | 138 |
n, m = map(int,input().split())
a = list(map(int,input().split()))
ans = 0
vote = sum(a)
for i in a:
if i >= vote/4/m:
ans +=1
if ans >m:
print("Yes")
else:
print("No") | n, m = map(int,input().split())
a = list(map(int,input().split()))
ans = 0
vote = sum(a)
for i in a:
if i >= vote/4/m:
ans +=1
if ans >=m:
print("Yes")
else:
print("No") | [["-", 36, 36, 0, 656, 0, 57, 15, 666, 667, 47], ["+", 36, 36, 0, 656, 0, 57, 15, 666, 667, 20]] | 5 | 78 |
/*
Author : Nishant Gupta 2.0
*/
#include <bits/stdc++.h>
#define LL long long int
#define getcx getchar_unlocked
#define X first
#define Y second
#define PB push_back
#define MP make_pair
#define MAX 100005
#define LOG_MAX 20
#define MOD 1000000007
#define INF 0x3f3f3f3f
#define INFL (LL(1e18))
#define chk(a) cer... | /*
Author : Nishant Gupta 2.0
*/
#include <bits/stdc++.h>
#define LL long long int
#define getcx getchar_unlocked
#define X first
#define Y second
#define PB push_back
#define MP make_pair
#define MAX 100005
#define LOG_MAX 20
#define MOD 1000000007
#define INF 0x3f3f3f3f
#define INFL (LL(1e18))
#define chk(a) cer... | [["+", 15, 339, 51, 16, 12, 16, 31, 23, 0, 24], ["+", 51, 16, 12, 16, 31, 23, 0, 16, 17, 48], ["+", 51, 16, 12, 16, 31, 23, 0, 16, 12, 13], ["+", 15, 339, 51, 16, 12, 16, 31, 23, 0, 25]] | 1 | 472 |
#include <iostream>
using namespace std;
int main(void) {
int n, m, t, p;
int a[2000];
cin >> n >> m;
t = 0;
for (int i = 0; i < n; i++) {
cin >> a[i];
t += a[i];
}
p = 0;
for (int i = 0; i < n; i++) {
if (a[i] * 4 * m < t)
p++;
}
cout << (p >= m ? "Yes" : "No") << endl;
return... | #include <iostream>
using namespace std;
int main(void) {
int n, m, t, p;
int a[2000];
cin >> n >> m;
t = 0;
for (int i = 0; i < n; i++) {
cin >> a[i];
t += a[i];
}
p = 0;
for (int i = 0; i < n; i++) {
if (a[i] * 4 * m >= t)
p++;
}
// cout << p << endl;
cout << (p >= m ? "Yes" ... | [["-", 8, 9, 0, 57, 15, 339, 51, 16, 17, 18], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 17, 20]] | 1 | 125 |
n, m = map(int, input().split())
a = list(map(int, input().split()))
sum, c = 0, 0
for i in a:
sum += i
for i in a:
if sum / (m * 4) <= i:
c += 1
if c > m:
print("Yes")
else:
print("No") | n, m = map(int, input().split())
a = list(map(int, input().split()))
sum, c = 0, 0
for i in a:
sum += i
for i in a:
if sum / (m * 4) <= i:
c += 1
if c >= m:
print("Yes")
else:
print("No") | [["-", 36, 36, 0, 656, 0, 57, 15, 666, 667, 47], ["+", 36, 36, 0, 656, 0, 57, 15, 666, 667, 20]] | 5 | 86 |
#include <bits/stdc++.h>
#define rep(i, n) for (ll i = 0; i < (ll)(n); ++i)
#define rep2(i, s, n) for (ll i = s; i < (ll)(n); i++)
#define repr(i, n) for (ll i = n; i >= 0; i--)
#define pb push_back
#define COUT(x) cout << (x) << endl
#define COUTF(x) cout << setprecision(15) << (x) << endl
#define ENDL cout << endl
#d... | #include <bits/stdc++.h>
#define rep(i, n) for (ll i = 0; i < (ll)(n); ++i)
#define rep2(i, s, n) for (ll i = s; i < (ll)(n); i++)
#define repr(i, n) for (ll i = n; i >= 0; i--)
#define pb push_back
#define COUT(x) cout << (x) << endl
#define COUTF(x) cout << setprecision(15) << (x) << endl
#define ENDL cout << endl
#d... | [["+", 15, 339, 51, 16, 12, 16, 31, 2, 63, 40], ["+", 51, 16, 12, 16, 31, 2, 3, 4, 0, 24], ["+", 51, 16, 12, 16, 31, 2, 3, 4, 0, 25], ["+", 15, 339, 51, 16, 12, 16, 12, 2, 63, 40], ["+", 51, 16, 12, 16, 12, 2, 3, 4, 0, 24], ["+", 12, 16, 12, 2, 3, 4, 0, 23, 0, 25]] | 1 | 487 |
#include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (n); ++i)
using namespace std;
using ll = long long;
using P = pair<int, int>;
#define PI 3.14159265358979323846264338327950
int main() {
int n, m;
cin >> n >> m;
vector<int> vec(n);
int tounter = 0;
rep(i, n) { cin >> vec[i]; }
int total = 0;
... | #include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (n); ++i)
using namespace std;
using ll = long long;
using P = pair<int, int>;
#define PI 3.14159265358979323846264338327950
int main() {
int n;
double m;
cin >> n >> m;
vector<double> vec(n);
int tounter = 0;
rep(i, n) { cin >> vec[i]; }
int ... | [["-", 0, 30, 0, 14, 8, 9, 0, 43, 0, 21], ["+", 0, 30, 0, 14, 8, 9, 0, 43, 0, 35], ["+", 0, 30, 0, 14, 8, 9, 0, 43, 39, 40], ["-", 0, 43, 39, 344, 3, 347, 0, 77, 39, 40], ["+", 0, 43, 39, 344, 3, 347, 0, 77, 39, 40]] | 1 | 159 |
#include <algorithm>
#include <iostream>
using namespace std;
int main() {
int n, m;
int A[1000];
cin >> n >> m;
int asum = 0;
for (int i = 0; i < n; i++) {
cin >> A[i];
asum += A[i];
}
sort(A, A + n);
bool ok = true;
double th = asum / (m * 4);
for (int i = 0; i < m; i++) {
if (A[n... | #include <algorithm>
#include <iostream>
using namespace std;
int main() {
int n, m;
int A[1000];
cin >> n >> m;
double asum = 0;
for (int i = 0; i < n; i++) {
cin >> A[i];
asum += A[i];
}
sort(A, A + n);
bool ok = true;
double th = asum / (m * 4);
for (int i = 0; i < m; i++) {
if ... | [["-", 0, 30, 0, 14, 8, 9, 0, 43, 39, 40], ["+", 0, 30, 0, 14, 8, 9, 0, 43, 39, 40]] | 1 | 152 |
import java.util.*;
class Main {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int n = sc.nextInt(), m = sc.nextInt();
int sum = 0;
int[] a = new int[n];
for (int i = 0; i < n; i++) {
a[i] = sc.nextInt();
sum += a[i];
}
int ans = 0;
for (int ... | import java.util.*;
class Main {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int n = sc.nextInt(), m = sc.nextInt();
int sum = 0;
int[] a = new int[n];
for (int i = 0; i < n; i++) {
a[i] = sc.nextInt();
sum += a[i];
}
int ans = 0;
for (int ... | [["+", 8, 196, 0, 57, 15, 15, 0, 91, 17, 111], ["+", 0, 57, 15, 15, 0, 91, 439, 23, 0, 24], ["+", 0, 57, 15, 15, 0, 91, 439, 23, 0, 25]] | 3 | 159 |
#include <bits/stdc++.h>
#define REP(i, n) for (int i = 0; i < n; i++)
#define REPR(i, n) for (int i = n; i >= 0; i--)
#define FOR(i, m, n) for (int i = m; i < n; i++)
#define ALL(v) v.begin(), v.end()
using namespace std;
typedef long long ll;
int main() {
int m, n;
cin >> n >> m;
vector<int> a(n);
ll total =... | #include <bits/stdc++.h>
#define REP(i, n) for (int i = 0; i < n; i++)
#define REPR(i, n) for (int i = n; i >= 0; i--)
#define FOR(i, m, n) for (int i = m; i < n; i++)
#define ALL(v) v.begin(), v.end()
using namespace std;
typedef long long ll;
int main() {
float m, n;
cin >> n >> m;
vector<int> a(110);
float ... | [["-", 0, 30, 0, 14, 8, 9, 0, 43, 39, 40], ["+", 0, 30, 0, 14, 8, 9, 0, 43, 39, 40], ["-", 0, 43, 49, 53, 54, 55, 0, 56, 39, 78], ["+", 8, 9, 0, 43, 49, 50, 51, 4, 0, 13], ["-", 0, 30, 0, 14, 8, 9, 0, 43, 39, 78], ["+", 15, 339, 51, 16, 12, 16, 12, 23, 0, 24], ["-", 0, 57, 15, 339, 51, 16, 12, 16, 17, 85], ["+", 51, 16... | 1 | 172 |
import java.util.Scanner;
public class Main {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int Type = sc.nextInt();
int Comd = sc.nextInt();
int sum = 0;
int cnt = 0;
int[] product = new int[Type];
for (int i = 0; i < Type; i++) {
product[i] = sc.ne... | import java.util.Scanner;
public class Main {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int Type = sc.nextInt();
int Comd = sc.nextInt();
double sum = 0;
int cnt = 0;
double[] product = new double[Type];
for (int i = 0; i < Type; i++) {
product[i... | [["-", 0, 195, 8, 196, 0, 503, 39, 506, 0, 507], ["+", 0, 195, 8, 196, 0, 503, 39, 511, 0, 512], ["-", 8, 196, 0, 503, 39, 224, 468, 506, 0, 507], ["+", 8, 196, 0, 503, 39, 224, 468, 511, 0, 512], ["-", 0, 503, 49, 200, 51, 227, 39, 506, 0, 507], ["+", 0, 503, 49, 200, 51, 227, 39, 511, 0, 512]] | 3 | 195 |
#include <stdio.h>
void sort(int *a, int n) {
int i, j, max, index;
for (i = 0; i < n; i++) {
max = a[i];
index = i;
for (j = i; j < n; j++) {
if (a[j] > max) {
max = a[j];
index = j;
}
}
a[index] = a[i];
a[i] = max;
}
return;
}
int main(void) {
int n, m, i... | #include <stdio.h>
void sort(int *a, int n) {
int i, j, max, index;
for (i = 0; i < n; i++) {
max = a[i];
index = i;
for (j = i; j < n; j++) {
if (a[j] > max) {
max = a[j];
index = j;
}
}
a[index] = a[i];
a[i] = max;
}
return;
}
int main(void) {
int n, m, i... | [["+", 15, 23, 0, 16, 12, 16, 31, 74, 0, 24], ["+", 0, 16, 12, 16, 31, 74, 39, 77, 39, 40], ["+", 15, 23, 0, 16, 12, 16, 31, 74, 0, 25]] | 0 | 247 |
N,M=[int(i) for i in input().split(" ")]
A=[int(i) for i in input().split(" ")]
print( "Yes" if len([i for i in A if sum(A)*(1/(4*M)) < i]) >= M else "No" )
| N,M=[int(i) for i in input().split(" ")]
A=[int(i) for i in input().split(" ")]
print( "Yes" if len([i for i in A if sum(A)*(1/(4*M)) <= i]) >= M else "No" )
| [["-", 3, 4, 0, 658, 0, 678, 0, 666, 667, 18], ["+", 3, 4, 0, 658, 0, 678, 0, 666, 667, 19]] | 5 | 84 |
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
int main() {
int n, m;
cin >> n >> m;
vector<int> A(n);
int t = 0;
for (int i = 0; i < n; i++) {
cin >> A.at(i);
t += A.at(i);
}
int ans = 0;
int c = (double)t / (4 * m) + 0.5;
for (auto x : A) {
if (x >= c)
ans++;
... | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
int main() {
int n, m;
cin >> n >> m;
vector<int> A(n);
int t = 0;
for (int i = 0; i < n; i++) {
cin >> A.at(i);
t += A.at(i);
}
int ans = 0;
double c = (double)t / (4 * m);
for (auto x : A) {
if (x >= c)
ans++;
}... | [["-", 0, 30, 0, 14, 8, 9, 0, 43, 39, 40], ["+", 0, 30, 0, 14, 8, 9, 0, 43, 39, 40], ["-", 8, 9, 0, 43, 49, 50, 51, 16, 17, 72], ["-", 8, 9, 0, 43, 49, 50, 51, 16, 12, 13]] | 1 | 139 |
#include <algorithm>
#include <iostream>
#include <numeric>
using namespace std;
int main() {
int n, m;
cin >> n >> m;
int a[n];
for (int i = 0; i < n; i++) {
cin >> a[i];
}
int sum = accumulate(a, a + sizeof(a) / sizeof(a[0]), 0);
stable_sort(a, a + sizeof(a) / sizeof(a[0]), greater<>());
if (a[m -... | #include <algorithm>
#include <iostream>
#include <numeric>
using namespace std;
int main() {
int n, m;
cin >> n >> m;
int a[n];
for (int i = 0; i < n; i++) {
cin >> a[i];
}
int sum = accumulate(a, a + sizeof(a) / sizeof(a[0]), 0);
stable_sort(a, a + sizeof(a) / sizeof(a[0]), greater<>());
if (a[m -... | [["+", 15, 339, 51, 16, 12, 16, 31, 74, 0, 24], ["+", 51, 16, 12, 16, 31, 74, 39, 77, 39, 40], ["+", 15, 339, 51, 16, 12, 16, 31, 74, 0, 25]] | 1 | 145 |
import itertools
from collections import deque,defaultdict,Counter
from itertools import accumulate
import bisect
from heapq import heappop,heappush,heapify
import math
from copy import deepcopy
import queue
import numpy as np
# sympy as syp(素因数分解とか)
Mod = 1000000007
def sieve_of_eratosthenes(n):
if not isinstance(... | import itertools
from collections import deque,defaultdict,Counter
from itertools import accumulate
import bisect
from heapq import heappop,heappush,heapify
import math
from copy import deepcopy
import queue
import numpy as np
# sympy as syp(素因数分解とか)
Mod = 1000000007
def sieve_of_eratosthenes(n):
if not isinstance(... | [["-", 8, 196, 0, 57, 15, 666, 0, 657, 17, 676], ["+", 8, 196, 0, 57, 15, 666, 0, 657, 17, 85]] | 5 | 436 |
N,M=map(int,input().split())
A=list(map(int,input().split()))
A.sort(reverse=True)
count=0
for i in A[0:N]:
if i>=(sum(A)/4*M):
count+=1
if count>=M:
print("Yes")
else:
print("No") | N,M=map(int,input().split())
A=list(map(int,input().split()))
A.sort(reverse=True)
count=0
for i in A[0:N]:
if i>=sum(A)/(4*M):
count+=1
if count>=M:
print("Yes")
else:
print("No") | [["-", 8, 196, 0, 57, 15, 666, 0, 23, 0, 24], ["+", 0, 57, 15, 666, 0, 657, 12, 23, 0, 24]] | 5 | 90 |
import sys
input = lambda: sys.stdin.readline().rstrip()
def solve():
N, M = map(int, input().split())
A = list(map(int, input().split()))
asum = sum(A)
count = 0
for i in range(N):
if A[i] * 4 * M > asum:
count += 1
if count >= M:
print('Yes')
else:
... | import sys
input = lambda: sys.stdin.readline().rstrip()
def solve():
N, M = map(int, input().split())
A = list(map(int, input().split()))
asum = sum(A)
count = 0
for i in range(N):
if A[i] * 4 * M >= asum:
count += 1
if count >= M:
print('Yes')
else:
... | [["-", 0, 7, 8, 196, 0, 57, 15, 666, 667, 47], ["+", 0, 7, 8, 196, 0, 57, 15, 666, 667, 20]] | 5 | 116 |
#include <algorithm>
#include <bitset>
#include <cassert>
#include <cfloat>
#include <cmath>
#include <cstdio>
#include <cstring>
#include <deque>
#include <fstream>
#include <functional>
#include <iomanip>
#include <iostream>
#include <limits.h>
#include <list>
#include <map>
#include <math.h>
#include <numeric>
#incl... | #include <algorithm>
#include <bitset>
#include <cassert>
#include <cfloat>
#include <cmath>
#include <cstdio>
#include <cstring>
#include <deque>
#include <fstream>
#include <functional>
#include <iomanip>
#include <iostream>
#include <limits.h>
#include <list>
#include <map>
#include <math.h>
#include <numeric>
#incl... | [["-", 8, 9, 0, 14, 8, 9, 0, 43, 39, 40], ["+", 8, 9, 0, 14, 8, 9, 0, 43, 39, 40]] | 1 | 1,923 |
#include <stdio.h>
main() {
int n, i, m, a[100], s, co;
float c;
s = 0;
co = 0;
scanf("%d %d", &n, &m);
for (i = 0; i < n; i++) {
scanf("%d", &a[i]);
s += a[i];
}
c = s / (4 * m);
for (i = 0; i < n; i++) {
if (a[i] >= c)
co++;
}
if (co >= m)
printf("Yes\n");
else
printf... | #include <stdio.h>
main() {
int n, i, m, a[100], s, co;
float c;
s = 0;
co = 0;
scanf("%d %d", &n, &m);
for (i = 0; i < n; i++) {
scanf("%d", &a[i]);
s += a[i];
}
c = s / (float)(4 * m);
for (i = 0; i < n; i++) {
if (a[i] >= c)
co++;
}
if (co >= m)
printf("Yes\n");
else
... | [["+", 0, 11, 12, 16, 12, 74, 39, 77, 39, 40], ["+", 0, 1, 0, 11, 12, 16, 12, 74, 0, 25], ["+", 0, 11, 12, 16, 12, 74, 51, 23, 0, 24]] | 0 | 143 |
#include <iostream>
using namespace std;
int main() {
int n, m, sum = 0;
cin >> n >> m;
int a[n];
for (int i = 0; i < n; i++) {
cin >> a[i];
sum += a[i];
}
int ans = 0;
for (int i = 0; i < n; i++)
if (a[i] > sum / m / 4.0)
ans++;
if (ans >= m)
cout << "Yes\n";
else
cout << "N... | #include <iostream>
using namespace std;
int main() {
int n, m, sum = 0;
cin >> n >> m;
int a[n];
for (int i = 0; i < n; i++) {
cin >> a[i];
sum += a[i];
}
int ans = 0;
for (int i = 0; i < n; i++)
if (a[i] >= (double)sum / m / 4.0)
ans++;
if (ans >= m)
cout << "Yes\n";
else
c... | [["-", 0, 7, 8, 57, 15, 339, 51, 16, 17, 47], ["+", 0, 7, 8, 57, 15, 339, 51, 16, 17, 20], ["+", 51, 16, 12, 16, 31, 16, 31, 74, 0, 24], ["+", 12, 16, 31, 16, 31, 74, 39, 77, 39, 40], ["+", 51, 16, 12, 16, 31, 16, 31, 74, 0, 25]] | 1 | 119 |
#include <algorithm>
#include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (n); ++i)
using namespace std;
int main() {
int n, m;
cin >> n >> m;
vector<int> a(n);
rep(i, n) { cin >> a.at(i); }
int total = 0;
rep(i, n) { total += a.at(i); }
std::sort(a.begin(), a.end(), std::greater<int>());
... | #include <algorithm>
#include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (n); ++i)
using namespace std;
int main() {
int n, m;
cin >> n >> m;
vector<int> a(n);
rep(i, n) { cin >> a.at(i); }
int total = 0;
rep(i, n) { total += a.at(i); }
std::sort(a.begin(), a.end(), std::greater<int>());
... | [["-", 8, 9, 0, 57, 15, 339, 51, 16, 17, 18], ["-", 0, 57, 15, 339, 51, 16, 12, 16, 31, 22], ["-", 0, 57, 15, 339, 51, 16, 12, 16, 17, 85], ["-", 15, 339, 51, 16, 12, 16, 12, 23, 0, 24], ["+", 15, 339, 51, 16, 31, 16, 31, 16, 17, 48], ["-", 15, 339, 51, 16, 12, 16, 12, 23, 0, 25], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 17... | 1 | 166 |
import java.util.Scanner;
public class Main {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
long N, M, sum = 0, cnt = 0;
N = sc.nextLong();
M = sc.nextLong();
long[] Arr = new long[(int)N];
for (int i = 0; i < N; i++) {
Arr[i] = sc.nextInt();
sum +=... | import java.util.Scanner;
public class Main {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
long N, M, sum = 0, cnt = 0;
N = sc.nextLong();
M = sc.nextLong();
long[] Arr = new long[(int)N];
for (int i = 0; i < N; i++) {
Arr[i] = sc.nextInt();
sum +=... | [["-", 15, 15, 0, 16, 12, 16, 31, 16, 12, 499], ["+", 15, 15, 0, 16, 12, 16, 31, 16, 12, 515]] | 3 | 165 |
N,M = map(int, input().split())
A = list(map(int, input().split()))
MAX = sum(A)
A = sorted(A,reverse=True)
M_count = 0
for i in A:
if i > MAX/(4*M):
M_count += 1
else:
break
if M_count >= M:
print('Yes')
else:
print('No') | N,M = map(int, input().split())
A = list(map(int, input().split()))
MAX = sum(A)
A = sorted(A,reverse=True)
M_count = 0
for i in A:
if i >= MAX/(4*M):
M_count += 1
else:
break
if M_count >= M:
print('Yes')
else:
print('No') | [["-", 0, 7, 8, 196, 0, 57, 15, 666, 667, 47], ["+", 0, 7, 8, 196, 0, 57, 15, 666, 667, 20]] | 5 | 93 |
#include <stdio.h>
//#include<stdlib.h>
// int sort(const int *a,const int*b){
// return *b-*a;
//}
int main(void) {
int n, m;
scanf("%d", &n, &m);
int a[n];
double sum = 0;
for (int i = 0; i < n; i++) {
scanf("%d", &a[i]);
sum += a[i];
}
// qsort(a,n,sizeof(int),sort);
int c = 0;
for (int i =... | #include <stdio.h>
//#include<stdlib.h>
// int sort(const int *a,const int*b){
// return *b-*a;
//}
int main(void) {
int n, m;
scanf("%d%d", &n, &m);
int a[n];
double sum = 0;
for (int i = 0; i < n; i++) {
scanf("%d", &a[i]);
sum += a[i];
// printf("%lf\n",sum);
}
// qsort(a,n,sizeof(int),sort... | [["-", 0, 1, 0, 2, 3, 4, 0, 5, 0, 6], ["+", 0, 1, 0, 2, 3, 4, 0, 5, 0, 6]] | 0 | 140 |
#include <stdio.h>
int sort(int *a, int *b) { return *b - *a; }
int main(void) {
int n, m, sum = 0, count = 0;
scanf("%d%d", &n, &m);
int a[n];
for (int i = 0; i < n; i++) {
scanf("%d", &a[i]);
sum += a[i];
}
qsort(a, n, sizeof(a[0]), sort);
double x = (double)sum / 4 / m;
for (int i = 0; i < ... | #include <stdio.h>
int sort(int *a, int *b) { return *b - *a; }
int main(void) {
int n, m, sum = 0, count = 0;
scanf("%d%d", &n, &m);
int a[n];
for (int i = 0; i < n; i++) {
scanf("%d", &a[i]);
sum += a[i];
}
qsort(a, n, sizeof(a[0]), sort);
double x = (double)sum / 4 / m;
for (int i = 0; i < ... | [["-", 8, 9, 0, 57, 15, 23, 0, 16, 17, 47], ["+", 8, 9, 0, 57, 15, 23, 0, 16, 17, 20]] | 0 | 178 |
#define _GLIBCXX_DEBUG
#include <bits/stdc++.h>
using namespace std;
int main() {
int n, m;
cin >> n >> m;
vector<int> a(n);
int sum = 0;
int ans = 0;
for (int i = 0; i < n; i++) {
cin >> a[i];
sum += a[i];
}
for (int i = 0; i < n; i++) {
if (a[i] >= (double)(sum / (4 * m)))
ans++;
... | #define _GLIBCXX_DEBUG
#include <bits/stdc++.h>
using namespace std;
int main() {
int n, m;
cin >> n >> m;
vector<int> a(n);
int sum = 0;
int ans = 0;
for (int i = 0; i < n; i++) {
cin >> a[i];
sum += a[i];
}
for (int i = 0; i < n; i++) {
if (a[i] >= (double)(sum) / (4 * m))
ans++;
... | [["+", 51, 16, 12, 16, 31, 74, 51, 23, 0, 25], ["-", 12, 74, 51, 23, 0, 16, 12, 23, 0, 25]] | 1 | 132 |
#include <bits/stdc++.h>
using namespace std;
int main() {
int N, M;
cin >> N >> M;
std::vector<int> A;
long long total = 0;
for (int i = 0; i < N; ++i) {
int tmp;
cin >> tmp;
total += tmp;
A.push_back(tmp);
}
std::sort(A.begin(), A.end(), greater<int>());
int judge = (double)total /... | #include <bits/stdc++.h>
using namespace std;
int main() {
int N, M;
cin >> N >> M;
std::vector<int> A;
long long total = 0;
for (int i = 0; i < N; ++i) {
int tmp;
cin >> tmp;
total += tmp;
A.push_back(tmp);
}
std::sort(A.begin(), A.end(), greater<int>());
double judge = (double)tota... | [["-", 0, 30, 0, 14, 8, 9, 0, 43, 39, 40], ["+", 0, 30, 0, 14, 8, 9, 0, 43, 39, 40]] | 1 | 157 |
#include <bits/stdc++.h>
using namespace std;
int main() {
ios::sync_with_stdio(false);
cin.tie(nullptr);
int n, m;
cin >> n >> m;
vector<int> a(n);
int sum = 0;
for (auto &i : a) {
cin >> i;
sum += i;
}
sort(a.rbegin(), a.rend());
if (a[m - 1] >= sum * (1 / (4 * m))) {
cout << "Yes\n";... | #include <bits/stdc++.h>
using namespace std;
int main() {
ios::sync_with_stdio(false);
cin.tie(nullptr);
int n, m;
cin >> n >> m;
vector<int> a(n);
int sum = 0;
for (auto &i : a) {
cin >> i;
sum += i;
}
sort(a.rbegin(), a.rend());
if (a[m - 1] >= sum / (4.0 * m)) {
cout << "Yes\n";
}... | [["-", 0, 57, 15, 339, 51, 16, 12, 16, 17, 48], ["-", 15, 339, 51, 16, 12, 16, 12, 23, 0, 24], ["-", 51, 16, 12, 16, 12, 23, 0, 16, 31, 13], ["-", 12, 23, 0, 16, 12, 23, 0, 16, 31, 13], ["+", 51, 16, 12, 16, 12, 23, 0, 16, 31, 13], ["-", 12, 16, 12, 23, 0, 16, 12, 23, 0, 25]] | 1 | 124 |
#include <iostream>
#include <vector>
using namespace std;
int main() {
int n, m;
cin >> n >> m;
vector<int> a(n);
int sum = 0;
for (int i = 0; i < n; i++) {
cin >> a[i];
sum += a[i];
}
int th = sum / (4 * m);
int aviable = 0;
for (int i = 0; i < n; i++) {
if (a[i] >= th)
aviabl... | #include <iostream>
#include <vector>
using namespace std;
int main() {
int n, m;
cin >> n >> m;
vector<int> a(n);
int sum = 0;
for (int i = 0; i < n; i++) {
cin >> a[i];
sum += a[i];
}
int th = sum / (4 * m);
int aviable = 0;
for (int i = 0; i < n; i++) {
// if (a[i] >= th) aviable++... | [["+", 15, 339, 51, 16, 31, 16, 31, 16, 17, 48], ["+", 15, 339, 51, 16, 31, 16, 31, 16, 12, 13], ["+", 0, 57, 15, 339, 51, 16, 31, 16, 17, 48], ["+", 0, 57, 15, 339, 51, 16, 31, 16, 12, 22], ["-", 8, 9, 0, 57, 15, 339, 51, 16, 12, 22], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 12, 22]] | 1 | 139 |
#include <algorithm>
#include <bits/stdc++.h>
#include <string>
using namespace std;
typedef long long ll;
int main() {
int n, m;
cin >> n >> m;
vector<int> a(n);
int sum = 0;
bool ok = true;
for (int i = 0; i < n; ++i) {
cin >> a[i];
sum += a[i];
}
sort(a.begin(), a.end(), greater<int>());
fo... | #include <algorithm>
#include <bits/stdc++.h>
#include <string>
using namespace std;
typedef long long ll;
int main() {
double n, m;
cin >> n >> m;
vector<double> a(n);
double sum = 0;
bool ok = true;
for (int i = 0; i < n; ++i) {
cin >> a[i];
sum += a[i];
}
sort(a.begin(), a.end(), greater<int>... | [["-", 0, 30, 0, 14, 8, 9, 0, 43, 39, 40], ["+", 0, 30, 0, 14, 8, 9, 0, 43, 39, 40], ["-", 0, 43, 39, 344, 3, 347, 0, 77, 39, 40], ["+", 0, 43, 39, 344, 3, 347, 0, 77, 39, 40]] | 1 | 170 |
n, m = map(int, input().split())
a = list(map(int, input().split()))
t = sum(a) // (4*m)
cnt = 0
for i in a:
if i >= t:
cnt += 1
print("Yes" if cnt >= m else "No")
| n, m = map(int, input().split())
a = list(map(int, input().split()))
t = sum(a) / (4*m)
cnt = 0
for i in a:
if i >= t:
cnt += 1
print("Yes" if cnt >= m else "No")
| [["-", 0, 656, 0, 1, 0, 662, 12, 657, 17, 676], ["+", 0, 656, 0, 1, 0, 662, 12, 657, 17, 85]] | 5 | 75 |
#include <bits/stdc++.h>
#define st first
#define nd second
#define ll long long
#define ld long double
#define pb push_back
#define emp emplace_back
#define pii pair<int, int>
#define usg unsigned
#define sg signed
#define mp make_pair
using namespace std;
void setIO() {
ios::sync_with_stdio(0);
cin.tie(0);
c... | #include <bits/stdc++.h>
#define st first
#define nd second
#define ll long long
#define ld long double
#define pb push_back
#define emp emplace_back
#define pii pair<int, int>
#define usg unsigned
#define sg signed
#define mp make_pair
using namespace std;
void setIO() {
ios::sync_with_stdio(0);
cin.tie(0);
c... | [["-", 0, 30, 0, 14, 8, 9, 0, 43, 39, 40], ["+", 0, 30, 0, 14, 8, 9, 0, 43, 39, 40], ["+", 49, 50, 51, 16, 31, 16, 31, 74, 0, 24], ["+", 51, 16, 31, 16, 31, 74, 39, 77, 39, 40], ["+", 49, 50, 51, 16, 31, 16, 31, 74, 0, 25]] | 1 | 214 |
#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define all(x) (x).begin(), (x).end()
#define rep(i, n) for (ll i = 0; i < n; i++)
const ll INF = 100100100100;
ll combination(ll n, ll r) {
if (n < r)
return 0;
if (r == 0 || r == n)
return 1;
else if (r == 1)
return n;
return (com... | #include <bits/stdc++.h>
using namespace std;
#define ll long long
#define all(x) (x).begin(), (x).end()
#define rep(i, n) for (ll i = 0; i < n; i++)
const ll INF = 100100100100;
ll combination(ll n, ll r) {
if (n < r)
return 0;
if (r == 0 || r == n)
return 1;
else if (r == 1)
return n;
return (com... | [["-", 0, 57, 15, 339, 51, 16, 12, 23, 0, 24], ["-", 12, 23, 0, 16, 12, 23, 0, 16, 31, 13], ["+", 51, 16, 12, 16, 12, 23, 0, 16, 31, 13], ["-", 51, 16, 12, 23, 0, 16, 12, 23, 0, 25]] | 1 | 280 |
import numpy as np
import math
import collections
import fractions
import itertools
def mput(): return map(int, input().split())
def lput(): return list(map(int, input().split()))
def iput(): return int(input())
def solve():
n, m = mput()
a = lput()
line = sum(A) / (4 * m)
bit = 0
for i in a:
... | import numpy as np
import math
import collections
import fractions
import itertools
def mput(): return map(int, input().split())
def lput(): return list(map(int, input().split()))
def iput(): return int(input())
def solve():
n, m = mput()
a = lput()
line = sum(a) / (4 * m)
bit = 0
for i in a:
... | [["-", 0, 662, 12, 657, 31, 652, 3, 4, 0, 22], ["+", 0, 662, 12, 657, 31, 652, 3, 4, 0, 22]] | 5 | 139 |
#include <bits/stdc++.h>
// Gaurav Khairnar 2020
// codechef : gaurav_1620
// codeforces : gaurav1620
// email : gauravak007@gmail.com
// Linedin : https://www.linkedin.com/in/gaurav-khairnar-393100171/
// Github : www.github.com/gaurav1620
//
#define Ninja ... | #include <bits/stdc++.h>
// Gaurav Khairnar 2020
// codechef : gaurav_1620
// codeforces : gaurav1620
// email : gauravak007@gmail.com
// Linedin : https://www.linkedin.com/in/gaurav-khairnar-393100171/
// Github : www.github.com/gaurav1620
//
#define Ninja ... | [["+", 15, 339, 51, 16, 31, 16, 31, 16, 17, 48], ["+", 15, 339, 51, 16, 31, 16, 31, 16, 12, 13], ["+", 0, 57, 15, 339, 51, 16, 31, 16, 17, 48], ["+", 0, 57, 15, 339, 51, 16, 31, 16, 12, 22], ["-", 8, 9, 0, 57, 15, 339, 51, 16, 12, 22], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 12, 22]] | 1 | 1,332 |
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (n); i++)
typedef long long ll;
int main() {
int n, m, sou = 0;
cin >> n >> m;
vector<int> hyou(n);
rep(i, n) {
cin >> hyou[i];
sou += hyou[i];
}
sort(hyou.begin(), hyou.end());
reverse(hyou.begin(), hyou.end());
... | #include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (n); i++)
typedef long long ll;
int main() {
int n, m, sou = 0;
cin >> n >> m;
vector<int> hyou(n);
rep(i, n) {
cin >> hyou[i];
sou += hyou[i];
}
sort(hyou.begin(), hyou.end());
reverse(hyou.begin(), hyou.end());
... | [["+", 51, 16, 12, 16, 31, 16, 31, 23, 0, 24], ["+", 12, 16, 31, 16, 31, 23, 0, 16, 17, 33], ["+", 12, 16, 31, 16, 31, 23, 0, 16, 12, 13], ["+", 51, 16, 12, 16, 31, 16, 31, 23, 0, 25], ["+", 0, 57, 15, 339, 51, 16, 12, 16, 17, 72], ["+", 0, 57, 15, 339, 51, 16, 12, 16, 12, 13]] | 1 | 139 |
#include <algorithm>
#include <functional>
#include <iostream>
int main() {
int n, m;
std::cin >> n >> m;
int arr[n];
int sum = 0;
for (int i = 0; i < n; ++i) {
std::cin >> arr[i];
sum += arr[i];
}
std::sort(arr, arr + n, std::greater<int>());
bool flag = true;
for (int i = 0; i < m; ++i) {
... | #include <algorithm>
#include <functional>
#include <iostream>
int main() {
int n, m;
std::cin >> n >> m;
int arr[n];
int sum = 0;
for (int i = 0; i < n; ++i) {
std::cin >> arr[i];
sum += arr[i];
}
std::sort(arr, arr + n, std::greater<int>());
bool flag = true;
for (int i = 0; i < m; ++i) {
... | [["+", 51, 16, 12, 23, 0, 16, 31, 74, 0, 24], ["-", 15, 339, 51, 16, 12, 74, 51, 23, 0, 24]] | 1 | 163 |
#include <bits/stdc++.h>
using namespace std;
int main() {
int n, m;
cin >> n >> m;
vector<int> N(n);
for (int i = 0; i < n; i++) {
cin >> N.at(i);
}
double sum;
for (int i = 0; i < n; i++) {
sum = sum + N.at(i);
}
double judge = sum * (1 / 4 * m);
int count = 0;
for (int i = 0; i < n; ... | #include <bits/stdc++.h>
using namespace std;
int main() {
int n, m;
cin >> n >> m;
vector<int> N(n);
for (int i = 0; i < n; i++) {
cin >> N.at(i);
}
double sum;
for (int i = 0; i < n; i++) {
sum = sum + N.at(i);
}
double judge = sum / (4 * m);
int count = 0;
for (int i = 0; i < n; i++)... | [["-", 8, 9, 0, 43, 49, 50, 51, 16, 17, 48], ["-", 0, 43, 49, 50, 51, 16, 12, 23, 0, 24], ["-", 51, 16, 12, 23, 0, 16, 31, 16, 31, 13], ["+", 0, 43, 49, 50, 51, 16, 12, 23, 0, 24]] | 1 | 164 |
#include <bits/stdc++.h>
#include <vector>
#define rep(i, n) for (int i = 0; i < n; ++i)
using namespace std;
int main() {
int n, m;
cin >> n >> m;
int result = 0;
int total = 0;
vector<int> vec(n);
rep(i, n) {
int a;
cin >> a;
vec[i] = a;
total += a;
}
rep(i, n) {
if (vec[i] >= (... | #include <bits/stdc++.h>
#include <vector>
#define rep(i, n) for (int i = 0; i < n; ++i)
using namespace std;
int main() {
int n, m;
cin >> n >> m;
int result = 0;
int total = 0;
vector<int> vec(n);
rep(i, n) {
int a;
cin >> a;
vec[i] = a;
total += a;
}
rep(i, n) {
if (vec[i] >= (... | [["-", 51, 16, 12, 16, 31, 23, 0, 16, 12, 13], ["+", 31, 23, 0, 16, 31, 16, 12, 16, 31, 13], ["+", 31, 23, 0, 16, 31, 16, 12, 16, 17, 48], ["+", 31, 23, 0, 16, 31, 16, 12, 16, 12, 22], ["+", 51, 16, 12, 16, 31, 23, 0, 16, 17, 33], ["+", 51, 16, 12, 16, 31, 23, 0, 16, 12, 13]] | 1 | 134 |
#include <algorithm>
#include <cctype>
#include <cmath>
#include <cstdio>
#include <cstring>
#include <functional>
#include <iomanip>
#include <iostream>
#include <limits>
#include <list>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <ve... | #include <algorithm>
#include <cctype>
#include <cmath>
#include <cstdio>
#include <cstring>
#include <functional>
#include <iomanip>
#include <iostream>
#include <limits>
#include <list>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <ve... | [["-", 0, 30, 0, 14, 8, 9, 0, 43, 39, 40], ["+", 0, 30, 0, 14, 8, 9, 0, 43, 39, 40], ["-", 0, 43, 39, 344, 3, 347, 0, 77, 39, 40], ["+", 0, 43, 39, 344, 3, 347, 0, 77, 39, 40], ["-", 0, 2, 63, 346, 3, 347, 0, 77, 39, 40], ["+", 0, 2, 63, 346, 3, 347, 0, 77, 39, 40]] | 1 | 349 |
import java.util.*;
public class Main {
public static void main(String[] args) {
Scanner scan = new java.util.Scanner(System.in);
int n = scan.nextInt();
int m = scan.nextInt();
Integer[] a = new Integer[n];
int sum = 0;
for (int i = 0; i < n; i++) {
a[i] = scan.nextInt();
sum += ... | import java.util.*;
public class Main {
public static void main(String[] args) {
Scanner scan = new java.util.Scanner(System.in);
int n = scan.nextInt();
int m = scan.nextInt();
Integer[] a = new Integer[n];
int sum = 0;
for (int i = 0; i < n; i++) {
a[i] = scan.nextInt();
sum += ... | [["+", 0, 503, 49, 200, 51, 16, 31, 74, 0, 24], ["+", 49, 200, 51, 16, 31, 74, 39, 511, 0, 512], ["+", 0, 503, 49, 200, 51, 16, 31, 74, 0, 25], ["+", 0, 503, 49, 200, 51, 16, 12, 23, 0, 24], ["-", 8, 196, 0, 503, 49, 200, 51, 16, 17, 85], ["+", 49, 200, 51, 16, 12, 23, 0, 16, 17, 48], ["+", 0, 503, 49, 200, 51, 16, 12,... | 3 | 153 |
n,m=map(int,input().split())
a=list(map(int,input().split()))
t=sum(a)
x=0
for i in range(n):
if a[i]>=(t//(4*m)):
x+=1
if x>=m:
print("Yes")
else:
print("No")
| n,m=map(int,input().split())
a=list(map(int,input().split()))
t=sum(a)
x=0
for i in range(n):
if a[i]>=(t/(4*m)):
x+=1
if x>=m:
print("Yes")
else:
print("No")
| [["-", 0, 57, 15, 666, 0, 23, 0, 657, 17, 676], ["+", 0, 57, 15, 666, 0, 23, 0, 657, 17, 85]] | 5 | 88 |
n, m = list(map(int, input().split()))
A = list(map(int, input().split()))
s = sum(A)
selected = []
for a in A:
if a/s > 1/(4*m):
selected.append(a)
if len(selected) >= m:
print('Yes')
else:
print('No')
| n, m = list(map(int, input().split()))
A = list(map(int, input().split()))
s = sum(A)
selected = []
for a in A:
if a >= s/(4*m):
selected.append(a)
if len(selected) >= m:
print('Yes')
else:
print('No')
| [["-", 8, 196, 0, 57, 15, 666, 0, 657, 17, 85], ["+", 0, 7, 8, 196, 0, 57, 15, 666, 667, 20], ["-", 0, 7, 8, 196, 0, 57, 15, 666, 667, 47], ["-", 8, 196, 0, 57, 15, 666, 0, 657, 31, 612]] | 5 | 92 |
n,m=map(int,input().split())
a=list(map(int,input().split()))
mm=sum(a)/4/m
s=0
for i in a:
if i >mm:
s+=1
if s>=m:
print('Yes')
else:
print('No')
| n,m=map(int,input().split())
a=list(map(int,input().split()))
mm=sum(a)/4/m
s=0
for i in a:
if i >=mm:
s+=1
if s>=m:
print('Yes')
else:
print('No')
| [["-", 0, 7, 8, 196, 0, 57, 15, 666, 667, 47], ["+", 0, 7, 8, 196, 0, 57, 15, 666, 667, 20]] | 5 | 78 |
#include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (n); ++i)
#define size_of_array(array) (sizeof(array) / sizeof(array[0]))
#define max 100005
using ll = long long;
using namespace std;
using Graph = vector<vector<int>>;
int main() {
int n, m;
cin >> n >> m;
int a[100] = {};
double sum = 0;
rep(... | #include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (n); ++i)
#define size_of_array(array) (sizeof(array) / sizeof(array[0]))
#define max 100005
using ll = long long;
using namespace std;
using Graph = vector<vector<int>>;
int main() {
int n, m;
cin >> n >> m;
int a[100] = {};
double sum = 0;
rep(... | [["-", 8, 9, 0, 57, 15, 339, 51, 16, 17, 47], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 17, 20]] | 1 | 183 |
N,M = map(int,input().split())
A = list(map(int,input().split()))
ans=[]
for i in range(N):
if A[i] < sum(A)/(4*M):
ans.append(A[i])
if len(ans) >= M:
print("Yes")
else:
print("No") | N,M = map(int,input().split())
A = list(map(int,input().split()))
ans=[]
for i in range(N):
if A[i] >= sum(A)/(4*M):
ans.append(A[i])
if len(ans) >= M:
print("Yes")
else:
print("No") | [["-", 0, 7, 8, 196, 0, 57, 15, 666, 667, 18], ["+", 0, 7, 8, 196, 0, 57, 15, 666, 667, 20]] | 5 | 93 |
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define INCANT \
cin.tie(0), ios::sync_with_stdio(false), cout << fixed << setprecision(20)
#define FOR(i, a, b) for (int i = (a); i < (b); i++)
#define rep(i, n) FOR(i, 0, n)
#define a... | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define INCANT \
cin.tie(0), ios::sync_with_stdio(false), cout << fixed << setprecision(20)
#define FOR(i, a, b) for (int i = (a); i < (b); i++)
#define rep(i, n) FOR(i, 0, n)
#define a... | [["+", 0, 57, 15, 339, 51, 16, 31, 74, 0, 24], ["+", 15, 339, 51, 16, 31, 74, 39, 77, 39, 40], ["+", 0, 57, 15, 339, 51, 16, 31, 74, 0, 25], ["+", 15, 339, 51, 16, 12, 16, 31, 74, 0, 24], ["+", 51, 16, 12, 16, 31, 74, 39, 77, 39, 40], ["+", 15, 339, 51, 16, 12, 16, 31, 74, 0, 25]] | 1 | 200 |
import java.util.*;
public class Main {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int n = sc.nextInt();
int m = sc.nextInt();
int[] a = new int[n];
int sum = 0;
for (int i = 0; i < n; i++) {
a[i] = sc.nextInt();
sum += a[i];
}
int min = ... | import java.util.*;
public class Main {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int n = sc.nextInt();
int m = sc.nextInt();
int[] a = new int[n];
double sum = 0;
for (int i = 0; i < n; i++) {
a[i] = sc.nextInt();
sum += a[i];
}
double ... | [["-", 0, 195, 8, 196, 0, 503, 39, 506, 0, 507], ["+", 0, 195, 8, 196, 0, 503, 39, 511, 0, 512]] | 3 | 166 |
#include <bits/stdc++.h>
#define ll long long
#define rep(i, begin, end) \
for (__typeof(end) i = (begin) - ((begin) > (end)); \
i != (end) - ((begin) > (end)); \
i += 1 - 2 * ((begin) > ... | #include <bits/stdc++.h>
#define ll long long
#define rep(i, begin, end) \
for (__typeof(end) i = (begin) - ((begin) > (end)); \
i != (end) - ((begin) > (end)); \
i += 1 - 2 * ((begin) > ... | [["-", 0, 9, 0, 57, 15, 339, 51, 16, 17, 47], ["+", 0, 9, 0, 57, 15, 339, 51, 16, 17, 20], ["+", 51, 16, 12, 23, 0, 16, 12, 74, 0, 24], ["+", 12, 23, 0, 16, 12, 74, 39, 77, 39, 40], ["+", 51, 16, 12, 23, 0, 16, 12, 74, 0, 25]] | 1 | 132 |
#include <bits/stdc++.h>
using namespace std;
int main() {
int n, m, sum = 0;
cin >> n >> m;
vector<int> ninki(n);
for (int i = 0; i < n; i++) {
int num;
cin >> num;
sum += num;
ninki.at(i) = num;
}
stable_sort(ninki.begin(), ninki.end());
if (ninki.at(n - m) < sum / 4 / m) {
cout << ... | #include <bits/stdc++.h>
using namespace std;
int main() {
int n, m;
double sum = 0;
cin >> n >> m;
vector<int> ninki(n);
for (int i = 0; i < n; i++) {
int num;
cin >> num;
sum += num;
ninki.at(i) = num;
}
stable_sort(ninki.begin(), ninki.end());
if (ninki.at(n - m) < sum / (4 * m)) {
... | [["-", 0, 30, 0, 14, 8, 9, 0, 43, 0, 21], ["+", 0, 30, 0, 14, 8, 9, 0, 43, 0, 35], ["+", 0, 30, 0, 14, 8, 9, 0, 43, 39, 40], ["+", 15, 339, 51, 16, 12, 16, 12, 23, 0, 24], ["-", 0, 57, 15, 339, 51, 16, 12, 16, 17, 85], ["+", 51, 16, 12, 16, 12, 23, 0, 16, 17, 48], ["+", 15, 339, 51, 16, 12, 16, 12, 23, 0, 25]] | 1 | 125 |
#include <bits/stdc++.h>
using namespace std;
int main() {
int n, m, a[105], sum = 0;
cin >> n >> m;
for (int i = 0; i < n; i++) {
cin >> a[i];
sum += a[i];
}
sort(a, a + n);
for (int i = 0; i < m; i++) {
if (a[n - 1 - i] < sum / (4 * m)) {
cout << "No" << endl;
return (0);
}
}... | #include <bits/stdc++.h>
using namespace std;
int main() {
int n, m;
int a[105];
double sum = 0;
cin >> n >> m;
for (int i = 0; i < n; i++) {
cin >> a[i];
sum += a[i];
}
sort(a, a + n);
for (int i = 0; i < m; i++) {
if (a[n - 1 - i] < sum / (4 * m)) {
cout << "No" << endl;
return... | [["-", 0, 30, 0, 14, 8, 9, 0, 43, 0, 21], ["+", 0, 30, 0, 14, 8, 9, 0, 43, 0, 35], ["+", 0, 30, 0, 14, 8, 9, 0, 43, 39, 40]] | 1 | 134 |
#include <bits/stdc++.h>
using namespace std;
int main() {
int N, M;
cin >> N >> M;
long long S = 0;
vector<int> A(N);
for (int i = 0; i < N; i++) {
cin >> A.at(i);
S += A.at(i);
}
sort(A.begin(), A.end());
cout << fixed << setprecision(2);
cout << (A.at(N - M) >= S / 4 / M ? "Yes" : "No") <<... | #include <bits/stdc++.h>
using namespace std;
int main() {
int N, M;
cin >> N >> M;
double S = 0;
vector<int> A(N);
for (int i = 0; i < N; i++) {
cin >> A.at(i);
S += A.at(i);
}
sort(A.begin(), A.end());
cout << fixed << setprecision(2);
cout << (A.at(N - M) >= S / 4 / M ? "Yes" : "No") << en... | [["-", 0, 14, 8, 9, 0, 43, 39, 86, 0, 96], ["+", 0, 30, 0, 14, 8, 9, 0, 43, 39, 40]] | 1 | 125 |
n, m = gets.split.map(&:to_i)
a = gets.split.map(&:to_i).sort.reverse
minVote = a.sum / 4.0 * m
answer = true
m.times do |i|
answer = false if a[i] < minVote
end
puts answer ? "Yes": "No" | n, m = gets.split.map(&:to_i)
a = gets.split.map(&:to_i).sort.reverse
minVote = a.sum / (4.0 * m)
answer = true
m.times do |i|
answer = false if a[i] < minVote
end
puts answer ? "Yes": "No" | [["+", 0, 493, 0, 662, 12, 738, 12, 739, 0, 24], ["+", 0, 493, 0, 662, 12, 738, 12, 739, 0, 25]] | 4 | 68 |
n, m = map(int, input().split())
a = list(map(int, input().split()))
x = sum(a)
count = 0
for i in range(n):
if i / a[i] >= 1/4/m:
count += 1
if count >= m:
print('Yes')
else:
print('No') | n, m = map(int, input().split())
a = list(map(int, input().split()))
x = sum(a)
count = 0
for i in range(n):
if a[i]/x >= 1/4/m:
count += 1
if count >= m:
print('Yes')
else:
print('No') | [["-", 8, 196, 0, 57, 15, 666, 0, 657, 31, 22], ["-", 8, 196, 0, 57, 15, 666, 0, 657, 17, 85], ["+", 8, 196, 0, 57, 15, 666, 0, 657, 17, 85], ["+", 8, 196, 0, 57, 15, 666, 0, 657, 12, 22]] | 5 | 86 |
N,M = map(int,input().split())
A = list(map(int,input().split()))
count = 0
for a in A:
if sum(A)/4*M > a:
count += 1
if count >= M:
print('Yes')
else:
print('No') | N,M = map(int,input().split())
A = list(map(int,input().split()))
count = 0
for a in A:
if sum(A)/(4*M) <= a:
count += 1
if count >= M:
print('Yes')
else:
print('No') | [["+", 0, 57, 15, 666, 0, 657, 12, 23, 0, 24], ["-", 0, 7, 8, 196, 0, 57, 15, 666, 667, 47], ["+", 0, 57, 15, 666, 0, 657, 12, 23, 0, 25], ["+", 0, 7, 8, 196, 0, 57, 15, 666, 667, 19]] | 5 | 75 |
n,m = gets.split(' ').map(&:to_i)
a = gets.split(' ').map(&:to_i).sort.reverse
minVote = a.sum / (4.0*m)
puts a[m-1] > minVote ? 'Yes' : 'No'
| n,m = gets.split(' ').map(&:to_i)
a = gets.split(' ').map(&:to_i).sort.reverse
minVote = a.sum / (4.0*m)
puts a[m-1] >= minVote ? 'Yes' : 'No' | [["-", 0, 652, 3, 4, 0, 754, 15, 738, 17, 47], ["+", 0, 652, 3, 4, 0, 754, 15, 738, 17, 20]] | 4 | 66 |
n,m = gets.split(' ').map(&:to_i)
a = gets.split(' ').map(&:to_i).sort
minVote = a.sum / (4*m)
answer = true
m.times do
compare = a.pop
answer = false if compare <= minVote
end
puts answer ? 'Yes' : 'No'
| n,m = gets.split(' ').map(&:to_i)
a = gets.split(' ').map(&:to_i).sort
minVote = a.sum / (4.0*m)
answer = true
m.times do |i|
compare = a.pop
answer = false if compare < minVote
end
puts answer ? 'Yes' : 'No' | [["-", 0, 662, 12, 738, 12, 739, 0, 738, 31, 612], ["+", 0, 662, 12, 738, 12, 739, 0, 738, 31, 531], ["+", 0, 493, 0, 652, 196, 737, 54, 758, 0, 139], ["+", 0, 493, 0, 652, 196, 737, 54, 758, 0, 22], ["-", 196, 737, 8, 736, 0, 751, 15, 738, 17, 19], ["+", 196, 737, 8, 736, 0, 751, 15, 738, 17, 18]] | 4 | 77 |
#include <algorithm>
#include <cmath>
#include <iostream>
#include <queue>
#include <string>
#include <vector>
using namespace std;
int main() {
int n, m;
cin >> n >> m;
int a[n];
int sum = 0;
for (int i = 0; i < n; i++) {
cin >> a[i];
sum += a[i];
}
int res = 0;
for (int i = 0; i < n; i++) {
... | #include <algorithm>
#include <cmath>
#include <iostream>
#include <queue>
#include <string>
#include <vector>
using namespace std;
int main() {
int n, m;
cin >> n >> m;
int a[n];
int sum = 0;
for (int i = 0; i < n; i++) {
cin >> a[i];
sum += a[i];
}
int res = 0;
for (int i = 0; i < n; i++) {
... | [["-", 8, 9, 0, 57, 15, 339, 51, 16, 17, 47], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 17, 20]] | 1 | 141 |
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef vector<int> vi;
typedef vector<ll> vll;
typedef vector<vll> vvll;
typedef vector<vector<int>> vvi;
typedef vector<string> vs;
typedef unordered_set<int> si;
typedef pair<int, int> pp;
typedef vector<pp> vpp;
typedef unsigned int i64;
#define ... | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef vector<int> vi;
typedef vector<ll> vll;
typedef vector<vll> vvll;
typedef vector<vector<int>> vvi;
typedef vector<string> vs;
typedef unordered_set<int> si;
typedef pair<int, int> pp;
typedef vector<pp> vpp;
typedef unsigned int i64;
#define ... | [["-", 0, 30, 0, 14, 8, 9, 0, 43, 39, 40], ["+", 0, 30, 0, 14, 8, 9, 0, 43, 39, 40], ["-", 0, 43, 49, 50, 51, 16, 31, 16, 12, 13], ["+", 0, 43, 49, 50, 51, 16, 31, 16, 12, 13]] | 1 | 585 |
import os
import heapq
import sys
import math
from collections import defaultdict
from io import BytesIO, IOBase
def check_kth_power(n, k):
while n%k == 0:
n = n/k
if n != 1:
return False
return True
def main():
#for _ in range(int(input())):
n,m=map(int,input().... | import os
import heapq
import sys
import math
from collections import defaultdict
from io import BytesIO, IOBase
def check_kth_power(n, k):
while n%k == 0:
n = n/k
if n != 1:
return False
return True
def main():
#for _ in range(int(input())):
n,m=map(int,input().... | [["-", 0, 1, 0, 662, 12, 23, 0, 657, 17, 676], ["+", 0, 1, 0, 662, 12, 23, 0, 657, 17, 85]] | 5 | 620 |
#include <bits/stdc++.h>
#define long long long int
using namespace std;
// @author: pashka
int main() {
ios::sync_with_stdio(false);
int n, m;
cin >> n >> m;
vector<int> a(n);
for (int i = 0; i < n; i++)
cin >> a[i];
int s = 0;
for (int x : a)
s += x;
int c = 0;
for (int i = 0; i < n; i++)... | #include <bits/stdc++.h>
#define long long long int
using namespace std;
// @author: pashka
int main() {
ios::sync_with_stdio(false);
int n, m;
cin >> n >> m;
vector<int> a(n);
for (int i = 0; i < n; i++)
cin >> a[i];
int s = 0;
for (int x : a)
s += x;
int c = 0;
for (int i = 0; i < n; i++)... | [["-", 8, 9, 0, 57, 15, 339, 51, 16, 12, 22], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 12, 22]] | 1 | 143 |
#include <iostream>
#include <algorithm>
#include <cctype>
#include <cstdio>
#include <cstdlib>
#include <fstream>
#include <iomanip>
#include <list>
#include <map>
#include <math.h>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <typeinfo>
#include <vector>
#define REP(i, n) for (int i =... | #include <iostream>
#include <algorithm>
#include <cctype>
#include <cstdio>
#include <cstdlib>
#include <fstream>
#include <iomanip>
#include <list>
#include <map>
#include <math.h>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <typeinfo>
#include <vector>
#define REP(i, n) for (int i =... | [["-", 8, 9, 0, 57, 15, 339, 51, 16, 17, 47], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 17, 20]] | 1 | 1,191 |
#include <bits/stdc++.h>
using namespace std;
int main() {
int n, m, total = 0, cnt = 0;
cin >> n >> m;
int a[n];
for (int i = 0; i < n; i++) {
cin >> a[i];
total += a[i];
}
// double k=4*m;
// double b= (total/k);
double b = ceil(total / (4.0 * m));
for (int i = 0; i < n; i++) {
if (a[i] ... | #include <bits/stdc++.h>
using namespace std;
int main() {
int n, m, total = 0, cnt = 0;
cin >> n >> m;
int a[n];
for (int i = 0; i < n; i++) {
cin >> a[i];
total += a[i];
}
// double k=4*m;
// double b= (total/k);
double b = ceil(total / (4.0 * m));
for (int i = 0; i < n; i++) {
if (a[i] ... | [["-", 64, 1, 0, 16, 31, 16, 12, 5, 0, 6], ["+", 64, 1, 0, 16, 31, 16, 12, 5, 0, 6], ["-", 0, 1, 0, 16, 31, 16, 12, 5, 0, 6], ["+", 0, 1, 0, 16, 31, 16, 12, 5, 0, 6]] | 1 | 139 |
#include <stdio.h>
int main(void) {
int n, m, flag, voteSum;
double l;
int ai[1000];
int i;
scanf("%d%d", &n, &m);
voteSum = 0;
/* お菓子の種類ごとに獲得票を合計する */
for (i = 0; i < n; i++) {
scanf("%d", &ai[i]);
voteSum += ai[i];
}
l = voteSum / (4 * m);
flag = 0;
/* 選択対象のお菓子を数える */
for (i = ... | #include <stdio.h>
int main(void) {
int n, m, flag, voteSum;
double l;
int ai[1000];
int i;
scanf("%d%d", &n, &m);
voteSum = 0;
/* お菓子の種類ごとに獲得票を合計する */
for (i = 0; i < n; i++) {
scanf("%d", &ai[i]);
voteSum += ai[i];
}
l = voteSum / (4.0 * m);
flag = 0;
/* 選択対象のお菓子を数える */
for (i ... | [["-", 0, 11, 12, 16, 12, 23, 0, 16, 31, 13], ["+", 0, 11, 12, 16, 12, 23, 0, 16, 31, 13], ["-", 8, 9, 0, 57, 15, 23, 0, 16, 17, 47], ["+", 8, 9, 0, 57, 15, 23, 0, 16, 17, 20]] | 0 | 157 |
#include <bits/stdc++.h>
using namespace std;
int main() {
int N, M;
cin >> N >> M;
vector<int> As(N);
for (int i = 0; i < N; i++)
cin >> As[i];
int c = 0;
int s = accumulate(As.begin(), As.end(), 0); // sums up all the array sum
cout << s;
for (int i = 0; i < N; i++) {
if (4 * M * As[i] >= s)
... | #include <bits/stdc++.h>
using namespace std;
int main() {
int N, M;
cin >> N >> M;
vector<int> As(N);
for (int i = 0; i < N; i++)
cin >> As[i];
int c = 0;
int s = accumulate(As.begin(), As.end(), 0); // sums up all the array sum
// cout<<s;
for (int i = 0; i < N; i++) {
if (4 * M * As[i] >= s)
... | [["-", 0, 14, 8, 9, 0, 1, 0, 16, 31, 22], ["-", 0, 14, 8, 9, 0, 1, 0, 16, 17, 151], ["-", 0, 14, 8, 9, 0, 1, 0, 16, 12, 22], ["-", 0, 30, 0, 14, 8, 9, 0, 1, 0, 35]] | 1 | 133 |
#include <stdio.h>
int main(int argc, const char *argv[]) {
int itemNum, popItemNum, totalVotes = 0, choosenItem = 0;
int votesArray[100];
double winVotes = 0;
scanf("%d %d", &itemNum, &popItemNum);
// Counting total number of votes, also creating an array with partial votes
for (int i = 0; i < itemNum; ... | #include <stdio.h>
int main(int argc, const char *argv[]) {
int itemNum, popItemNum, totalVotes = 0, choosenItem = 0;
int votesArray[100];
double winVotes = 0;
scanf("%d %d", &itemNum, &popItemNum);
// Counting total number of votes, also creating an array with partial votes
for (int i = 0; i < itemNum; ... | [["-", 0, 11, 12, 16, 12, 23, 0, 16, 31, 13], ["+", 0, 11, 12, 16, 12, 23, 0, 16, 31, 13]] | 0 | 167 |
#include <stdio.h>
int main(int argc, const char *argv[]) {
int itemNum, popItemNum, totalVotes = 0;
double quaterVotes = 0;
scanf("%d %d", &itemNum, &popItemNum);
int votesArray[itemNum];
for (int i = 0; i < itemNum; i++) {
int partVotes;
scanf("%d", &partVotes);
totalVotes += partVotes;
v... | #include <stdio.h>
int main(int argc, const char *argv[]) {
int itemNum, popItemNum, totalVotes = 0;
double quaterVotes = 0;
scanf("%d %d", &itemNum, &popItemNum);
int votesArray[100];
// Counting total number of votes, also creating an array with single votes
for (int i = 0; i < itemNum; i++) {
int ... | [["-", 0, 14, 8, 9, 0, 43, 49, 80, 81, 22], ["+", 0, 14, 8, 9, 0, 43, 49, 80, 81, 13], ["-", 8, 9, 0, 57, 15, 23, 0, 16, 17, 47], ["+", 8, 9, 0, 57, 15, 23, 0, 16, 17, 20]] | 0 | 165 |
#include <bits/stdc++.h>
using namespace std;
int main() {
int n, m;
cin >> n >> m;
int TotalPoint = 0;
vector<int> a(n);
for (int i = 0; i < n; i++) {
cin >> a[i];
TotalPoint += a[i];
}
sort(a.begin(), a.end());
if (a[n - m] >= TotalPoint / (4 * m))
cout << "Yes" << endl;
else
co... | #include <bits/stdc++.h>
using namespace std;
int main() {
int n, m;
cin >> n >> m;
double TotalPoint = 0;
vector<int> a(n);
for (int i = 0; i < n; i++) {
cin >> a[i];
TotalPoint += a[i];
}
sort(a.begin(), a.end());
if (a[n - m] >= TotalPoint / (4 * m))
cout << "Yes" << endl;
else
... | [["-", 0, 30, 0, 14, 8, 9, 0, 43, 39, 40], ["+", 0, 30, 0, 14, 8, 9, 0, 43, 39, 40]] | 1 | 116 |
N,M = map(int,input().split())
s = list(map(int,input().split()))
count = 0
al = sum(s)
for i in range(N):
if not(a[i] < s / (4 * M)):
count += 1
if count == M:
print("Yes")
else:
print("No") | N,M = map(int,input().split())
s = list(map(int,input().split()))
count = 0
al = sum(s)
for i in range(N):
if not(s[i] < al / (4 * M)):
count += 1
if count >= M:
print("Yes")
else:
print("No") | [["-", 15, 681, 28, 23, 0, 666, 0, 206, 51, 22], ["+", 15, 681, 28, 23, 0, 666, 0, 206, 51, 22], ["-", 15, 681, 28, 23, 0, 666, 0, 657, 31, 22], ["+", 15, 681, 28, 23, 0, 666, 0, 657, 31, 22], ["-", 36, 36, 0, 656, 0, 57, 15, 666, 667, 60], ["+", 36, 36, 0, 656, 0, 57, 15, 666, 667, 20]] | 5 | 89 |
#include <bits/stdc++.h>
using namespace std;
using lli = long long int;
using ll = long long;
using ld = long double;
using d = double;
int main() {
int t = 1;
// cin>>t;
while (t--) {
int n, m;
cin >> n >> m;
vector<int> a(n);
ll sum = 0;
for (int i = 0; i < n; i++) {
cin >> a[i];
... | #include <bits/stdc++.h>
using namespace std;
using lli = long long int;
using ll = long long;
using ld = long double;
using d = double;
int main() {
int t = 1;
// cin>>t;
while (t--) {
int n, m;
cin >> n >> m;
vector<int> a(n);
ll sum = 0;
for (int i = 0; i < n; i++) {
cin >> a[i];
... | [["+", 49, 50, 51, 16, 12, 74, 51, 23, 0, 24], ["+", 49, 50, 51, 16, 12, 74, 51, 23, 0, 25], ["-", 0, 7, 8, 9, 0, 57, 15, 339, 0, 24], ["-", 0, 57, 15, 339, 51, 16, 31, 74, 0, 25], ["+", 15, 339, 51, 16, 31, 2, 3, 4, 0, 24], ["+", 15, 339, 51, 16, 31, 2, 3, 4, 0, 25]] | 1 | 208 |
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ld = long double;
int main() {
int n, m;
cin >> n >> m;
int v[n];
int sum = 0;
for (int i = 0; i < n; i++) {
cin >> v[i];
sum += v[i];
}
double d = (float)1 / (m * 4) * sum;
// cout<<d<<" ";
sort(v, v + n);
int k =... | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ld = long double;
int main() {
int n, m;
cin >> n >> m;
int v[n];
int sum = 0;
for (int i = 0; i < n; i++) {
cin >> v[i];
sum += v[i];
}
double d = (float)1 / (m * 4) * sum;
// cout<<d<<" ";
sort(v, v + n);
int k =... | [["-", 0, 14, 8, 9, 0, 7, 15, 16, 17, 47], ["+", 0, 14, 8, 9, 0, 7, 15, 16, 17, 20]] | 1 | 156 |
n,m = map(int,input().split())
a = list(map(int,input().split()))
x = max(a)
s = 0
for i in a:
s += i
y = [l for l in a if l >=s]
if len(y) >=m:
print('Yes')
else:
print('No') | n,m = map(int,input().split())
a = list(map(int,input().split()))
x = max(a)
s = 0
for i in a:
s += i
y = [l for l in a if l >=s/4/m]
if len(y) >=m:
print('Yes')
else:
print('No') | [["+", 0, 678, 0, 666, 0, 657, 31, 657, 17, 85], ["+", 0, 678, 0, 666, 0, 657, 31, 657, 12, 612], ["+", 12, 658, 0, 678, 0, 666, 0, 657, 17, 85], ["+", 12, 658, 0, 678, 0, 666, 0, 657, 12, 22]] | 5 | 85 |
#include <bits/stdc++.h>
using namespace std;
int main() {
int N, ans = 0;
double sumA = 0, M;
cin >> N >> M;
map<double, int> A;
for (int i = 0; i < N; i++) {
int x;
cin >> x;
A[i] = x;
sumA += x;
}
double test = sumA / (4 * M);
for (int i = 0; i < N; i++) {
if (A[i] > test) {
... | #include <bits/stdc++.h>
using namespace std;
int main() {
int N, ans = 0;
double sumA = 0, M;
cin >> N >> M;
map<double, int> A;
for (int i = 0; i < N; i++) {
int x;
cin >> x;
A[i] = x;
sumA += x;
}
double test = sumA / (4 * M);
for (int i = 0; i < N; i++) {
if (A[i] >= test) {
... | [["-", 8, 9, 0, 57, 15, 339, 51, 16, 17, 47], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 17, 20], ["-", 8, 9, 0, 57, 15, 339, 51, 16, 17, 18], ["-", 0, 1, 0, 16, 31, 16, 12, 5, 0, 6], ["+", 0, 1, 0, 16, 31, 16, 12, 5, 0, 6]] | 1 | 142 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.