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 |
|---|---|---|---|---|
//#pragma GCC optimize("Ofast")
//#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
//#pragma GCC optimize("unroll-loops")
#include <bits/stdc++.h>
#define pb push_back
#define sz(x) ((int)(x).size())
#define all(x) (x).begin(), (x).end()
#define ll long long
using namespace std;
void fil... | //#pragma GCC optimize("Ofast")
//#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
//#pragma GCC optimize("unroll-loops")
#include <bits/stdc++.h>
#define pb push_back
#define sz(x) ((int)(x).size())
#define all(x) (x).begin(), (x).end()
#define ll long long
using namespace std;
void fil... | [["-", 0, 11, 12, 16, 12, 23, 0, 16, 17, 47], ["-", 12, 16, 12, 23, 0, 16, 12, 16, 31, 13], ["-", 12, 16, 12, 23, 0, 16, 12, 16, 17, 48], ["-", 12, 16, 12, 23, 0, 16, 12, 16, 12, 22], ["+", 0, 11, 12, 16, 12, 23, 0, 16, 17, 20], ["+", 0, 11, 12, 16, 12, 23, 0, 16, 12, 13]] | 1 | 278 |
n, m = gets.split(' ').map(&:to_i)
a = gets.split(' ').map(&:to_i)
sorted_a = a.sort.reverse
sum = a.inject(0) { |s, a_i| s + a_i }
print(sorted_a[m - 1] < (sum / (4 * m)) ? 'No' : 'Yes')
| _, m = gets.split(' ').map(&:to_i)
a = gets.split(' ').map(&:to_i)
sorted_a = a.sort.reverse
sum = a.inject(0) { |s, a_i| s + a_i }
print(sorted_a[m - 1] < (sum / (4 * m).to_f) ? 'No' : 'Yes')
| [["-", 36, 36, 0, 493, 0, 662, 31, 761, 0, 22], ["+", 36, 36, 0, 493, 0, 662, 31, 761, 0, 22], ["+", 15, 738, 12, 739, 0, 738, 12, 652, 17, 131], ["+", 15, 738, 12, 739, 0, 738, 12, 652, 735, 22]] | 4 | 86 |
#include <bits/stdc++.h>
using namespace std;
int main() {
int n, m, sum(0), mm;
string ans("Yes");
cin >> n >> m;
vector<int> a(n);
for (int i = 0; i < n; i++) {
cin >> a.at(i);
sum += a.at(i);
}
sort(a.begin(), a.end());
reverse(a.begin(), a.end());
for (int i = 0; i < m; i++) {
if (a.a... | #include <bits/stdc++.h>
using namespace std;
int main() {
int n, m, sum(0), mm;
string ans("Yes");
cin >> n >> m;
vector<int> a(n);
for (int i = 0; i < n; i++) {
cin >> a.at(i);
sum += a.at(i);
}
sort(a.begin(), a.end());
reverse(a.begin(), a.end());
for (int i = 0; i < m; i++) {
if (a.a... | [["+", 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 | 160 |
#include <bits/stdc++.h>
using namespace std;
int main() {
long N, M, sum = 0;
cin >> N >> M;
vector<int> data(N);
for (int i = 0; i < N; i++) {
cin >> data[i];
sum += data[i];
}
sort(data.begin(), data.end(), greater<int>());
if (data[M - 1] >= (sum / (4 * M))) {
cout << "Yes" << endl;
} el... | #include <bits/stdc++.h>
using namespace std;
int main() {
double N, M, sum = 0;
cin >> N >> M;
vector<int> data(N);
for (int i = 0; i < N; i++) {
cin >> data[i];
sum += data[i];
}
sort(data.begin(), data.end(), greater<int>());
if (data[M - 1] >= (sum / (4 * M))) {
cout << "Yes" << endl;
} ... | [["-", 0, 14, 8, 9, 0, 43, 39, 86, 0, 96], ["+", 0, 30, 0, 14, 8, 9, 0, 43, 39, 40]] | 1 | 128 |
#include <bits/stdc++.h>
#include <iostream>
using namespace std;
int main() {
int n, m;
cin >> n >> m;
int a[n], i;
for (i = 0; i < n; i++)
cin >> a[i];
int ans = 0, sum = 0;
for (i = 0; i < n; i++)
sum += a[i];
sum = sum / (4 * m);
for (i = 0; i < n; i++) {
if (a[i] >= sum)
an... | #include <bits/stdc++.h>
#include <iostream>
using namespace std;
int main() {
int n, m;
cin >> n >> m;
int a[n], i;
for (i = 0; i < n; i++)
cin >> a[i];
int ans = 0;
double sum = 0;
for (i = 0; i < n; i++)
sum += a[i];
sum = sum / (4 * m);
for (i = 0; i < n; i++) {
if (a[i] >= sum)... | [["-", 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 | 141 |
#include <iostream>
#include <vector>
int main() {
int N, M;
std::cin >> N >> M;
std::vector<int> v;
int tmp = 0;
while (std::cin >> tmp)
v.push_back(tmp);
unsigned long long sum = 0;
for (auto x : v) {
sum += x;
}
int m = 0;
for (auto x : v) {
if (x >= (float)(sum / 4 / M))
m++... | #include <iostream>
#include <vector>
int main() {
int N, M;
std::cin >> N >> M;
std::vector<int> v;
int tmp = 0;
while (std::cin >> tmp)
v.push_back(tmp);
double sum = 0;
for (auto x : v) {
sum += x;
}
int m = 0;
for (auto x : v) {
if (x >= (double)(sum / 4 / M))
m++;
}
if... | [["-", 0, 14, 8, 9, 0, 43, 39, 86, 0, 87], ["-", 0, 14, 8, 9, 0, 43, 39, 86, 0, 96], ["+", 0, 30, 0, 14, 8, 9, 0, 43, 39, 40], ["-", 15, 339, 51, 16, 12, 74, 39, 77, 39, 40], ["+", 15, 339, 51, 16, 12, 74, 39, 77, 39, 40]] | 1 | 138 |
nums1=[int(e) for e in input().split()]
nums2=[int(t) for t in input().split()]
all_vote = 0
sum = nums1[0]
for num in nums2:
all_vote += num
for k in nums2:
if (k/(all_vote) < 1/(4*nums1[1])):
sum-=1
if(nums1[1]<=sum):
print(Yes)
else:
print(No) | nums1=[int(e) for e in input().split()]
nums2=[int(t) for t in input().split()]
all_vote = 0
sums = nums1[0]
for num in nums2:
all_vote += num
for k in nums2:
if (k/(all_vote) < 1/(4*nums1[1])):
sums-=1
if(nums1[1]<=sums):
print('Yes')
else:
print('No') | [["-", 36, 36, 0, 656, 0, 1, 0, 662, 31, 22], ["+", 36, 36, 0, 656, 0, 1, 0, 662, 31, 22], ["-", 0, 57, 64, 196, 0, 1, 0, 677, 31, 22], ["+", 0, 57, 64, 196, 0, 1, 0, 677, 31, 22], ["-", 0, 656, 0, 57, 15, 23, 0, 666, 0, 22], ["+", 0, 656, 0, 57, 15, 23, 0, 666, 0, 22], ["+", 0, 1, 0, 652, 3, 4, 0, 557, 0, 654], ["+", ... | 5 | 101 |
import math
n,m = list(map(int,input().split()))
a = list(map(int,input().split()))
t = sum(a)
c = 0
f = 0
for i in range(n):
if a[i] >= t//(4*m):
c += 1
if c>=m:
print("Yes")
else:
print("No") | import math
n,m = list(map(int,input().split()))
a = list(map(int,input().split()))
t = sum(a)
c = 0
f = 0
for i in range(n):
if a[i] >= math.ceil(t/(4*m)):
c += 1
if c>=m:
print("Yes")
else:
print("No") | [["+", 0, 57, 15, 666, 0, 652, 63, 319, 500, 22], ["+", 0, 57, 15, 666, 0, 652, 63, 319, 0, 131], ["+", 0, 57, 15, 666, 0, 652, 63, 319, 319, 22], ["+", 0, 57, 15, 666, 0, 652, 3, 4, 0, 24], ["-", 8, 196, 0, 57, 15, 666, 0, 657, 17, 676], ["+", 15, 666, 0, 652, 3, 4, 0, 657, 17, 85], ["+", 0, 652, 3, 4, 0, 657, 12, 23,... | 5 | 94 |
def main():
n,m = map(int, input().split())
A = sorted([int(x) for x in input().split()],reverse=True)
sum = 0
for a in A:
sum += a
if(A[m-1]>=a/(4*m)):
print("Yes")
else:
print("No")
return 0
if __name__ == "__main__":
main() | def main():
n,m = map(int, input().split())
A = sorted([int(x) for x in input().split()],reverse=True)
asum = 0
for a in A:
asum += a
if(A[m-1]>=asum/(4*m)):
print("Yes")
else:
print("No")
return 0
if __name__ == "__main__":
main() | [["-", 0, 14, 8, 196, 0, 1, 0, 662, 31, 22], ["+", 0, 14, 8, 196, 0, 1, 0, 662, 31, 22], ["-", 0, 7, 8, 196, 0, 1, 0, 677, 31, 22], ["+", 0, 7, 8, 196, 0, 1, 0, 677, 31, 22], ["-", 0, 57, 15, 23, 0, 666, 0, 657, 31, 22], ["+", 0, 57, 15, 23, 0, 666, 0, 657, 31, 22]] | 5 | 101 |
#!/usr/bin/env python3
import sys
YES = "Yes" # type: str
NO = "No" # type: str
def solve(N: int, M: int, A: "List[int]"):
sum = 0
count = 0
for i in A:
sum += i
for a in A:
if a >= sum // (4 * M):
count += 1
if count >= M:
print(YES)
else:
pri... | #!/usr/bin/env python3
import sys
YES = "Yes" # type: str
NO = "No" # type: str
def solve(N: int, M: int, A: "List[int]"):
sum = 0
count = 0
for i in A:
sum += i
for a in A:
if a >= sum / (4 * M):
count += 1
if count >= M:
print(YES)
else:
prin... | [["-", 8, 196, 0, 57, 15, 666, 0, 657, 17, 676], ["+", 8, 196, 0, 57, 15, 666, 0, 657, 17, 85]] | 5 | 173 |
n,m=map(int,input().split())
a=list(map(int,input().split()))
a.sort()
s=0
b=True
for i in a:
s+=i
for i in range(0,m):
if a[i]>=s/4/m:
b=True
else:
b=False
if b:
print('Yes')
else:
print('No') | n,m=map(int,input().split())
a=list(map(int,input().split()))
a.sort(reverse=True)
s=0
b=True
for i in a:
s+=i
for i in range(0,m):
if a[i]>=s/4/m:
b=True
else:
b=False
if b:
print('Yes')
else:
print('No') | [["+", 0, 1, 0, 652, 3, 4, 0, 653, 141, 22], ["+", 0, 1, 0, 652, 3, 4, 0, 653, 0, 32], ["+", 0, 1, 0, 652, 3, 4, 0, 653, 51, 146]] | 5 | 99 |
n,m=map(int,input().split())
a=list(map(int,input().split()))
c=0
s=sum(a)
for i in range(n):
if a[i] > s*(1/(4*m)):
c+=1
if c >= m:
print('Yes')
else:
print('No') | n,m=map(int,input().split())
a=list(map(int,input().split()))
c=0
s=sum(a)
for i in range(n):
if a[i] >= s*(1/(4*m)):
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 | 90 |
#include <algorithm>
#include <cmath>
#include <cstdio>
#include <deque>
#include <iostream>
#include <map>
#include <string>
#include <vector>
using namespace std;
using ll = long long;
const int INF = 1001001001;
#define rep(i, n) for (int i = 0; i < (n); ++i)
int main() {
int n, m;
cin >> n >> m;
vector<int... | #include <algorithm>
#include <cmath>
#include <cstdio>
#include <deque>
#include <iostream>
#include <map>
#include <string>
#include <vector>
using namespace std;
using ll = long long;
const int INF = 1001001001;
#define rep(i, n) for (int i = 0; i < (n); ++i)
int main() {
int n, m;
cin >> n >> m;
vector<int... | [["-", 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, 43, 49, 50, 51, 13], ["+", 0, 14, 8, 9, 0, 43, 49, 50, 51, 13], ["+", 0, 57, 15, 339, 51, 16, 12, 74, 0, 24], ["+", 15, 339, 51, 16, 12, 74, 39, 77, 39, 40], ["+", 0, 57, 15, 339, 51, 16, 12, 74, 0, 25]] | 1 | 166 |
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef vector<long long> vll;
typedef vector<pair<int, int>> vpi;
typedef vector<pair<long long, long long>> vpl;
typedef pair<int, int> pii;
typedef pair<long long, long long> pll;
#define INF (int)(1e9)
#define MAXX 1.1529215e+18
#define inf 999999
... | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef vector<long long> vll;
typedef vector<pair<int, int>> vpi;
typedef vector<pair<long long, long long>> vpl;
typedef pair<int, int> pii;
typedef pair<long long, long long> pll;
#define INF (int)(1e9)
#define MAXX 1.1529215e+18
#define inf 999999
... | [["-", 0, 30, 0, 14, 8, 9, 0, 43, 39, 40], ["+", 0, 30, 0, 14, 8, 9, 0, 43, 39, 78], ["+", 0, 43, 49, 50, 51, 16, 31, 74, 0, 24], ["+", 49, 50, 51, 16, 31, 74, 39, 77, 39, 40], ["+", 0, 43, 49, 50, 51, 16, 31, 74, 0, 25]] | 1 | 383 |
n,m = map(int, input().split())
a = list(map(int, input().split()))
flag = False
allVote = sum(a)
a.sort(reverse=True)
counter = 0
for i in range(n):
if allVote/4 < a[i]:
counter +=1
else:
break
if counter >= m:
flag = True
if flag is False:
print("No")
else:
print("Yes") | n,m = map(int, input().split())
a = list(map(int, input().split()))
flag = False
allVote = sum(a)
a.sort(reverse=True)
counter = 0
for i in range(n):
if allVote/4 <= a[i]*m:
counter +=1
else:
break
if counter >= m:
flag = True
if flag is False:
print("No")
else:
print("Yes") | [["-", 0, 7, 8, 196, 0, 57, 15, 666, 667, 18], ["+", 0, 7, 8, 196, 0, 57, 15, 666, 667, 19], ["+", 8, 196, 0, 57, 15, 666, 0, 657, 17, 48], ["+", 8, 196, 0, 57, 15, 666, 0, 657, 12, 22]] | 5 | 104 |
#include <cstdio>
#include <iostream>
using namespace std;
int main() {
int n, m;
scanf("%d %d", &n, &m);
int arr[n];
int total = 0;
int i;
for (i = 0; i < n; i++) {
scanf("%d", &arr[i]);
total += arr[i];
}
total = total / (4 * m);
int flag = 0;
for (i = 0; i < n; i++) {
if (arr[i] >= t... | #include <cstdio>
#include <iostream>
using namespace std;
int main() {
int n, m;
scanf("%d %d", &n, &m);
int arr[n];
double total = 0;
int i;
for (i = 0; i < n; i++) {
scanf("%d", &arr[i]);
total += arr[i];
}
total = (double)total / (4 * m);
int flag = 0;
for (i = 0; i < n; i++) {
if (... | [["-", 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]] | 1 | 155 |
// CREATED BY TARANG KAPOOR
#include <bits/stdc++.h>
using namespace std;
int main() {
int n, m, sum = 0;
cin >> n >> m;
vector<int> v;
for (int i = 0; i < n; i++) {
int x;
cin >> x;
v.push_back(x);
sum += v[i];
}
// cout<<sum;
int count = 0;
sort(v.begin(), v.end(), greater<int>())... |
// CREATED BY TARANG KAPOOR
#include <bits/stdc++.h>
using namespace std;
int main() {
int n, m, sum = 0;
cin >> n >> m;
vector<int> v;
for (int i = 0; i < n; i++) {
int x;
cin >> x;
v.push_back(x);
sum += v[i];
}
// cout<<sum;
int count = 0;
sort(v.begin(), v.end(), greater<int>());... | [["+", 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 | 158 |
N , M = input().split()
array = input().split()
flag = 0
N = int(N)
M = int(M)
iarray = []
for i in array:
iarray.append(int(i))
total = sum(iarray)
for i in iarray:
if i >= total/(4*M):
flag += 1
if flag >= M:
print("yes")
else:
print("no") | N , M = input().split()
array = input().split()
flag = 0
N = int(N)
M = int(M)
iarray = []
for i in array:
iarray.append(int(i))
total = sum(iarray)
for i in iarray:
if i >= total/(4*M):
flag += 1
if flag >= M:
print("Yes")
else:
print("No") | [["-", 0, 1, 0, 652, 3, 4, 0, 557, 0, 6], ["+", 0, 1, 0, 652, 3, 4, 0, 557, 0, 6]] | 5 | 97 |
/*
@・ω・@ <だれだろうね
*/
/*****/
#include <algorithm>
#include <array>
#include <cmath>
#include <fstream>
#include <iomanip> //cout << fixed << setprecision(桁数);
#include <iostream>
#include <map>
#include <queue>
#include <stack>
#include <stdexcept>
#include <string>
#include <vector>
//#define int long long
... |
/*
@・ω・@ <だれだろうね
*/
/*****/
#include <algorithm>
#include <array>
#include <cmath>
#include <fstream>
#include <iomanip> //cout << fixed << setprecision(桁数);
#include <iostream>
#include <map>
#include <queue>
#include <stack>
#include <stdexcept>
#include <string>
#include <vector>
//#define int long long
... | [["-", 0, 30, 0, 14, 8, 9, 0, 43, 39, 78], ["+", 0, 30, 0, 14, 8, 9, 0, 43, 39, 78]] | 1 | 800 |
#include <bits/stdc++.h>
using namespace std;
int main() {
int N, M;
cin >> N >> M;
int sum = 0;
vector<int> vote(N); // N個の商品の得票数データ
// 得票数データを受け取る
for (int i = 0; i < N; i++) {
cin >> vote.at(i);
sum = sum + vote.at(i);
}
sort(vote.begin(), vote.end());
reverse(vote.begin(), vote.end()... | #include <bits/stdc++.h>
using namespace std;
int main() {
int N, M;
cin >> N >> M;
int sum = 0;
vector<int> vote(N); // N個の商品の得票数データ
// 得票数データを受け取る
for (int i = 0; i < N; i++) {
cin >> vote.at(i);
sum = sum + vote.at(i);
}
sort(vote.begin(), vote.end());
reverse(vote.begin(), vote.end()... | [["-", 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 | 171 |
#include <bits/stdc++.h>
using namespace std;
int main() {
int n, m;
cin >> n >> m;
vector<int> products(n);
int sum = 0;
for (int i = 0; i < n; i++) {
cin >> products.at(i);
sum += products.at(i);
}
int count = 0;
for (int i = 0; i < n; i++) {
if (products.at(i) >= sum / (m * 4)) {
... | #include <bits/stdc++.h>
using namespace std;
int main() {
int n, m;
cin >> n >> m;
vector<int> products(n);
int sum = 0;
for (int i = 0; i < n; i++) {
cin >> products.at(i);
sum += products.at(i);
}
int count = 0;
for (int i = 0; i < n; i++) {
if (products.at(i) >= sum / float(m * 4)) {
... | [["+", 15, 339, 51, 16, 12, 16, 12, 2, 63, 40]] | 1 | 144 |
#include <bits/stdc++.h>
using namespace std;
int main() {
int n, m;
cin >> n >> m;
vector<int> v(n);
int total = 0;
for (int i = 0; i < n; i++) {
cin >> v[i];
total += v[i];
}
int c = 0;
int hoge = total / (4 * m);
for (int i = 0; i < n; i++) {
if (v[i] >= hoge)
c++;
}
cout << ... | #include <bits/stdc++.h>
using namespace std;
int main() {
int n;
double m;
cin >> n >> m;
vector<int> v(n);
double total = 0;
for (int i = 0; i < n; i++) {
cin >> v[i];
total += v[i];
}
int c = 0;
double hoge = total / (4.0 * m);
// cout << hoge << endl;
for (int i = 0; i < n; i++) {
... | [["-", 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, 30, 0, 14, 8, 9, 0, 43, 39, 40], ["-", 49, 50, 51, 16, 12, 23, 0, 16, 31, 13], ["+", 49, 50, 51, 16, 12, 23, 0, 16, 31, 13]] | 1 | 129 |
#include <bits/stdc++.h>
using namespace std;
#define int long long
#define double long double
#define fo(a, b) for (int a = 0; a < b; a++)
#define Sort(a) sort(a.begin(), a.end())
#define rev(a) reverse(a.begin(), a.end())
#define fi first
#define se second
#define sz size()
#define bgn begin()
#define en end()
#defin... | #include <bits/stdc++.h>
using namespace std;
#define int long long
#define double long double
#define fo(a, b) for (int a = 0; a < b; a++)
#define Sort(a) sort(a.begin(), a.end())
#define rev(a) reverse(a.begin(), a.end())
#define fi first
#define se second
#define sz size()
#define bgn begin()
#define en end()
#defin... | [["-", 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, 43, 49, 50, 51, 16, 31, 16, 12, 13], ["+", 0, 43, 49, 50, 51, 16, 31, 16, 12, 13]] | 1 | 1,926 |
#include <bits/stdc++.h>
using namespace std;
#define fi first
#define se second
#define all(a) a.begin(), a.end()
#define pb push_back
#define mp make_pair
typedef long long ll;
typedef pair<ll, ll> P;
#define rep(i, a, b) for (ll i = a; i < b; i++)
const int max_n = 1e5;
const ll mod = 1e9 + 7;
const ll INF = 1LL << ... | #include <bits/stdc++.h>
using namespace std;
#define fi first
#define se second
#define all(a) a.begin(), a.end()
#define pb push_back
#define mp make_pair
typedef long long ll;
typedef pair<ll, ll> P;
#define rep(i, a, b) for (ll i = a; i < b; i++)
const int max_n = 1e5;
const ll mod = 1e9 + 7;
const ll INF = 1LL << ... | [["-", 0, 43, 39, 344, 3, 347, 0, 77, 39, 40], ["+", 0, 43, 39, 344, 3, 347, 0, 77, 39, 40], ["-", 0, 30, 0, 14, 8, 9, 0, 43, 39, 40], ["+", 0, 30, 0, 14, 8, 9, 0, 43, 39, 40], ["-", 0, 57, 15, 339, 51, 16, 12, 74, 0, 24], ["-", 15, 339, 51, 16, 12, 74, 39, 77, 39, 40], ["-", 0, 57, 15, 339, 51, 16, 12, 74, 0, 25]] | 1 | 344 |
def MI(): return map(int, input().split())
def LI(): return list(map(int, input().split()))
if __name__ == "__main__":
N, M = map(int, input().split())
A = sorted(LI(), reverse=True)
sum = sum(A)
if A[M-1] < sum//(4*M):
print("No")
else:
print("Yes") | def MI(): return map(int, input().split())
def LI(): return list(map(int, input().split()))
if __name__ == "__main__":
N, M = map(int, input().split())
A = sorted(LI(), reverse=True)
sum = sum(A)
if A[M-1] < sum/(4*M):
print("No")
else:
print("Yes") | [["-", 64, 196, 0, 57, 15, 666, 0, 657, 17, 676], ["+", 64, 196, 0, 57, 15, 666, 0, 657, 17, 85]] | 5 | 110 |
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define all(x) (x).begin(), (x).end()
typedef long long ll;
int main() {
int n, m;
cin >> n >> m;
int a[n];
rep(i, n) cin >> a[i];
int sum = 0;
rep(i, n) sum += a[i];
ll count = 0;
rep(i, n) {
if (sum ... | #include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define all(x) (x).begin(), (x).end()
typedef long long ll;
int main() {
ll n, m;
cin >> n >> m;
int a[n];
rep(i, n) cin >> a[i];
double sum = 0;
rep(i, n) sum += a[i];
ll count = 0;
rep(i, n) {
if (su... | [["-", 0, 30, 0, 14, 8, 9, 0, 43, 39, 40], ["+", 0, 30, 0, 14, 8, 9, 0, 43, 39, 78], ["+", 0, 30, 0, 14, 8, 9, 0, 43, 39, 40]] | 1 | 133 |
$input_1 = trim(fgets(STDIN));
$m = explode(' ', $input_1)[1];
$input_2 = trim(fgets(STDIN));
$items = explode(' ', $input_2);
$total = array_sum($items);
$border = $total / (4 * $m);
rsort($items);
for ($i = 0; $i < $m; $i++) {
if ($items[$i] < $border) {
echo "No";
exit();
}
}
echo 'Yes'... | <?php
$input_1 = trim(fgets(STDIN));
$m = explode(' ', $input_1)[1];
$input_2 = trim(fgets(STDIN));
$items = explode(' ', $input_2);
$total = array_sum($items);
$border = $total / (4 * $m);
rsort($items);
for ($i = 0; $i < $m; $i++) {
if ($items[$i] < $border) {
echo "No";
exit();
}
}
echo ... | [["+", 36, 36, 36, 36, 36, 36, 0, 493, 0, 605]] | 6 | 126 |
#include <algorithm>
#include <bits/stdc++.h>
#include <iomanip>
#include <iostream>
#include <string>
using namespace std;
typedef long long ll;
typedef long double ld;
int MOD = 1000000007;
int main() {
ll M, N, ans = 0;
bool an = true;
cin >> N >> M;
ll A[N + 10];
for (ll i = 0; i < N; i++) {
cin >>... | #include <algorithm>
#include <bits/stdc++.h>
#include <iomanip>
#include <iostream>
#include <string>
using namespace std;
typedef long long ll;
typedef long double ld;
int MOD = 1000000007;
int main() {
ll M, N;
ld ans = 0.0;
bool an = true;
cin >> N >> M;
ll A[N + 10];
for (ll i = 0; i < N; i++) {
... | [["-", 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, 78], ["-", 0, 14, 8, 9, 0, 43, 49, 50, 51, 13], ["+", 0, 14, 8, 9, 0, 43, 49, 50, 51, 13]] | 1 | 170 |
#include <algorithm>
#include <array>
#include <iostream>
#include <vector>
using namespace std;
int main(void) {
int N, M;
cin >> N >> M;
vector<int> a;
int total = 0;
for (int i = 0; i < N; i++) {
int tmp;
cin >> tmp;
a.push_back(tmp);
total += tmp;
}
sort(a.begin(), a.end());
int ans... | #include <algorithm>
#include <array>
#include <iostream>
#include <vector>
using namespace std;
int main(void) {
int N, M;
cin >> N >> M;
vector<int> a;
int total = 0;
for (int i = 0; i < N; i++) {
int tmp;
cin >> tmp;
a.push_back(tmp);
total += tmp;
}
sort(a.begin(), a.end());
int ans... | [["+", 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 | 165 |
#include <bits/stdc++.h>
#define ll long long
using namespace std;
int main() {
int n, m;
cin >> n >> m;
ll sum = 0;
int arr[n];
for (int i = 0; i < n; i++) {
cin >> arr[i];
sum += arr[i];
}
bool flag = false;
int count = 0;
for (int i = 0; i < n; i++) {
ll temp = arr[i] * 4 * m;
if (... | #include <bits/stdc++.h>
#define ll long long
using namespace std;
int main() {
int n, m;
cin >> n >> m;
ll sum = 0;
int arr[n];
for (int i = 0; i < n; i++) {
cin >> arr[i];
sum += arr[i];
}
bool flag = false;
int count = 0;
for (int i = 0; i < n; i++) {
ll temp = arr[i] * 4 * m;
if (... | [["-", 8, 9, 0, 57, 15, 339, 51, 16, 17, 47], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 17, 20]] | 1 | 150 |
tmp = list(map(int, input().split()))
num = list(map(int, input().split()))
count = 0
b = sum(num)//(4*tmp[1])
for i in num:
if i>b:
count+=1
if tmp[1]<=count:
print("Yes")
else:
print("No") | tmp = list(map(int, input().split()))
num = list(map(int, input().split()))
count = 0
b = sum(num)/(4*tmp[1])
for i in num:
if i>=b:
count+=1
if tmp[1]<=count:
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], ["-", 0, 7, 8, 196, 0, 57, 15, 666, 667, 47], ["+", 0, 7, 8, 196, 0, 57, 15, 666, 667, 20]] | 5 | 87 |
#include <bits/stdc++.h>
using namespace std;
int main(void) {
int N, M;
int sum = 0;
cin >> N >> M;
vector<int> A(N);
bool ok = true;
for (int i = 0; i < N; i++) {
cin >> A[i];
sum += A[i];
}
sort(A.rbegin(), A.rend());
for (int i = 0; i < M; i++) {
if (A[i] < sum / (4 * M)) {
ok... | #include <bits/stdc++.h>
using namespace std;
int main(void) {
int N, M;
int sum = 0;
cin >> N >> M;
vector<int> A(N);
bool ok = true;
for (int i = 0; i < N; i++) {
cin >> A[i];
sum += A[i];
}
sort(A.rbegin(), A.rend());
for (int i = 0; i < M; i++) {
if (A[i] < (double)sum / (double)(4 ... | [["+", 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], ["+", 15, 339, 51, 16, 12, 16, 12, 74, 0, 24], ["+", 51, 16, 12, 16, 12, 74, 39, 77, 39, 40], ["+", 15, 339, 51, 16, 12, 16, 12, 74, 0, 25]] | 1 | 155 |
#include <iostream>
#include <vector>
int main() {
long long N, M;
std::cin >> N >> M;
std::vector<long long> A(N);
long long total = 0;
for (int i = 0; i < N; i++) {
std::cin >> A[i];
total += A[i];
}
long long cnt = 0;
for (int i = 0; i < N; i++) {
if (A[i] * 4 * M > total) {
cnt++;... | #include <iostream>
#include <vector>
int main() {
long long N, M;
std::cin >> N >> M;
std::vector<long long> A(N);
long long total = 0;
for (int i = 0; i < N; i++) {
std::cin >> A[i];
total += A[i];
}
long long cnt = 0;
for (int i = 0; i < N; i++) {
if (A[i] * 4 * M >= total) {
cnt++... | [["-", 8, 9, 0, 57, 15, 339, 51, 16, 17, 47], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 17, 20]] | 1 | 152 |
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 + 1];
int sum = 0;
int choice = 0;
String ansy = "Yes";
String ansn = "No";
for (int i = 1; i <= N; ... | 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();
double A[] = new double[N + 1];
double sum = 0;
int choice = 0;
String ansy = "Yes";
String ansn = "No";
for (int i = 1;... | [["-", 0, 195, 8, 196, 0, 503, 39, 506, 0, 507], ["+", 0, 195, 8, 196, 0, 503, 39, 511, 0, 512], ["-", 0, 503, 49, 200, 51, 227, 39, 506, 0, 507], ["+", 0, 503, 49, 200, 51, 227, 39, 511, 0, 512]] | 3 | 210 |
#include <iostream>
#include <vector>
using namespace std;
int main(void) {
int N, M;
cin >> N >> M;
vector<int> A(N);
for (int i = 0; i < N; i++) {
cin >> A[i];
}
//------------------------------------
int Asum = 0;
for (int i = 0; i < N; i++) {
Asum = Asum + A[i];
}
//選定できるか否かのライン
doubl... | #include <iostream>
#include <vector>
using namespace std;
int main(void) {
int N, M;
cin >> N >> M;
vector<double> A(N);
for (int i = 0; i < N; i++) {
cin >> A[i];
}
//------------------------------------
double Asum = 0;
for (int i = 0; i < N; i++) {
Asum = Asum + A[i];
}
//選定できるか否かのライン
... | [["-", 0, 43, 39, 344, 3, 347, 0, 77, 39, 40], ["+", 0, 43, 39, 344, 3, 347, 0, 77, 39, 40], ["-", 0, 30, 0, 14, 8, 9, 0, 43, 39, 40], ["+", 0, 30, 0, 14, 8, 9, 0, 43, 39, 40]] | 1 | 164 |
first_input = list(map(lambda x:int(x), input().split(" ")))
second_input = list(map(lambda x:int(x), input().split(" ")))
second_input.sort(reverse=True)
criteria = sum(second_input)/float(4*first_input[1])
count = 0
for i in range(len(second_input)):
if second_input[i]>=criteria:
count = count+1
... |
first_input = list(map(lambda x:int(x), input().split(" ")))
second_input = list(map(lambda x:int(x), input().split(" ")))
second_input.sort(reverse=True)
criteria = sum(second_input)/float(4*first_input[1])
count = 0
for i in range(len(second_input)):
if second_input[i]>=criteria:
count = count+1
el... | [["-", 8, 196, 0, 57, 64, 196, 0, 116, 0, 117], ["+", 0, 57, 75, 76, 8, 196, 0, 93, 0, 94], ["-", 8, 196, 0, 57, 15, 666, 0, 657, 17, 72], ["-", 8, 196, 0, 57, 15, 666, 0, 657, 12, 612], ["-", 0, 57, 75, 76, 8, 196, 0, 93, 0, 94]] | 5 | 131 |
#include <bits/stdc++.h>
using namespace std;
#define ll long long int
int main(void) {
ll M, N;
cin >> N >> M;
ll sum = 0;
vector<ll> vec(N);
for (ll i = 0; i < N; i++) {
cin >> vec.at(i);
}
sort(vec.begin(), vec.end());
reverse(vec.begin(), vec.end());
for (ll i = 0; i < N; i++) {
sum +... | #include <bits/stdc++.h>
using namespace std;
#define ll long long int
int main(void) {
ll M, N;
cin >> N >> M;
double sum = 0;
vector<ll> vec(N);
for (ll i = 0; i < N; i++) {
cin >> vec.at(i);
}
sort(vec.begin(), vec.end());
reverse(vec.begin(), vec.end());
for (ll i = 0; i < N; i++) {
s... | [["-", 0, 30, 0, 14, 8, 9, 0, 43, 39, 78], ["+", 0, 30, 0, 14, 8, 9, 0, 43, 39, 40]] | 1 | 157 |
#include <bits/stdc++.h>
using namespace std;
#define REP(i, n) for (int i = 0; i < (n); i++)
#define REP2(i, x, n) for (int i = x; i < (n); i++)
#define ALL(n) begin(n), end(n)
struct cww {
cww() {
ios::sync_with_stdio(false);
cin.tie(0);
}
} star;
const long long INF = numeric_limits<long long>::max();
in... | #include <bits/stdc++.h>
using namespace std;
#define REP(i, n) for (int i = 0; i < (n); i++)
#define REP2(i, x, n) for (int i = x; i < (n); i++)
#define ALL(n) begin(n), end(n)
struct cww {
cww() {
ios::sync_with_stdio(false);
cin.tie(0);
}
} star;
const long long INF = numeric_limits<long long>::max();
in... | [["-", 12, 23, 0, 16, 12, 23, 0, 16, 31, 13], ["+", 12, 23, 0, 16, 12, 23, 0, 16, 31, 13]] | 1 | 230 |
#include <bits/stdc++.h>
using namespace std;
int main() {
int n, m;
vector<int> a;
cin >> n >> m;
int sum = 0;
for (int i = 0; i < n; i++) {
int x;
cin >> x;
a.push_back(x);
sum += x;
}
int d = sum / (4 * m);
sort(a.begin(), a.end());
if (a[n - m] >= d)
cout << "Yes" << endl;
e... | #include <bits/stdc++.h>
using namespace std;
int main() {
int n, m;
vector<int> a;
cin >> n >> m;
int sum = 0;
for (int i = 0; i < n; i++) {
int x;
cin >> x;
a.push_back(x);
sum += x;
}
double d = 1.0 * sum / (4 * m);
sort(a.begin(), a.end());
if (a[n - m] >= d)
cout << "Yes" << ... | [["-", 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, 31, 13], ["+", 0, 43, 49, 50, 51, 16, 31, 16, 17, 48]] | 1 | 125 |
import java.util.Scanner;
public class Main {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int A = sc.nextInt();
double B = sc.nextInt();
int hairetu[] = new int[A];
double sum = 0;
int count = 0;
for (int i = 0; i < A; i++) {
hairetu[i] = sc.nextInt... | import java.util.Scanner;
public class Main {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int A = sc.nextInt();
double B = sc.nextInt();
int hairetu[] = new int[A];
double sum = 0;
int count = 0;
for (int i = 0; i < A; i++) {
hairetu[i] = sc.nextInt... | [["-", 8, 196, 0, 57, 15, 15, 0, 16, 17, 47], ["+", 8, 196, 0, 57, 15, 15, 0, 16, 17, 20]] | 3 | 182 |
#include <algorithm>
#include <cmath>
#include <fstream>
#include <iostream>
#include <stdio.h>
#include <string>
#include <tuple>
#include <vector>
#define REP(i, n) for (int i = 0; i < n; i++)
using namespace std;
int main() {
cin.tie(0);
ios::sync_with_stdio(false);
int n, m, sum = 0, cnt = 0;
float b = 0... | #include <algorithm>
#include <cmath>
#include <fstream>
#include <iostream>
#include <stdio.h>
#include <string>
#include <tuple>
#include <vector>
#define REP(i, n) for (int i = 0; i < n; i++)
using namespace std;
int main() {
cin.tie(0);
ios::sync_with_stdio(false);
int n, m, sum = 0, cnt = 0;
float b = 0... | [["+", 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, 14, 8, 9, 0, 57, 15, 339, 0, 24], ["+", 15, 339, 51, 16, 31, 74, 39, 77, 39, 40], ["+", 0, 57, 15, 339, 51, 16, 31, 74, 0, 25]] | 1 | 159 |
N, M = map(int, input().split())
A = list(map(int, input().split()))
length = len(A)
for idx in range(len(A)):
if A[idx] < sum(A)/(4*M):
length -= 1
ans = 'Yes' if length>=2 else 'No'
print(ans) | N, M = map(int, input().split())
A = list(map(int, input().split()))
length = len(A)
for idx in range(len(A)):
if A[idx] < sum(A)/(4*M):
length -= 1
ans = 'Yes' if length>=M else 'No'
print(ans) | [["-", 0, 1, 0, 662, 12, 41, 0, 666, 0, 612], ["+", 0, 1, 0, 662, 12, 41, 0, 666, 0, 22]] | 5 | 87 |
#include <math.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
typedef int keytype;
// quicksort(<#keytype *a#>, <#int first#>, <#int last#>);
// long long ;
void quicksort(keytype a[], int first, int last) {
int i, j;
keytype x, t;
x = a[(first + last) / 2];
i = first;
j = last;
for (;;) {... | #include <math.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
typedef int keytype;
// quicksort(<#keytype *a#>, <#int first#>, <#int last#>);
// long long ;
void quicksort(keytype a[], int first, int last) {
int i, j;
keytype x, t;
x = a[(first + last) / 2];
i = first;
j = last;
for (;;) {... | [["-", 8, 9, 0, 1, 0, 11, 12, 69, 71, 22], ["+", 8, 9, 0, 1, 0, 11, 12, 69, 71, 22], ["-", 8, 9, 0, 57, 15, 23, 0, 16, 17, 19], ["+", 8, 9, 0, 57, 15, 23, 0, 16, 17, 20]] | 0 | 342 |
#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define mp make_pair
#define pb push_back
#define ff first
#define ss second
#define deb(x) cout << x << "\n";
#define deB(x, y) cout << x << " " << y << "\n";
#define Deb(x, y, z) cout << x << " " << y << " " << z << "\n";
#define OK cout << "OK";
int ... | #include <bits/stdc++.h>
using namespace std;
#define ll float
#define mp make_pair
#define pb push_back
#define ff first
#define ss second
#define deb(x) cout << x << "\n";
#define deB(x, y) cout << x << " " << y << "\n";
#define Deb(x, y, z) cout << x << " " << y << " " << z << "\n";
#define OK cout << "OK";
int main... | [["-", 36, 36, 36, 36, 0, 30, 0, 58, 51, 59], ["+", 36, 36, 36, 36, 0, 30, 0, 58, 51, 59], ["-", 0, 30, 0, 14, 8, 9, 0, 43, 39, 78], ["+", 0, 30, 0, 14, 8, 9, 0, 43, 39, 40], ["-", 8, 9, 0, 57, 15, 339, 51, 16, 17, 47], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 17, 20]] | 1 | 182 |
N, M = map(int,input().split())
A = [int(a) for a in input().split()]
A.sort(reverse=True)
votes = sum(A)
for i in range(M):
if A[i]<votes//(4*M):
print("No")
break
else:
print("Yes") | N, M = map(int,input().split())
A = [int(a) for a in input().split()]
A.sort(reverse=True)
votes = sum(A)
for i in range(M):
if A[i]<votes/(4*M):
print("No")
break
else:
print("Yes") | [["-", 8, 196, 0, 57, 15, 666, 0, 657, 17, 676], ["+", 8, 196, 0, 57, 15, 666, 0, 657, 17, 85]] | 5 | 85 |
import java.util.Scanner;
public class Main {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int n = sc.nextInt();
int 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 ... | import java.util.Scanner;
public class Main {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int n = sc.nextInt();
int 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];
}
floa... | [["-", 0, 195, 8, 196, 0, 503, 39, 506, 0, 507], ["+", 0, 195, 8, 196, 0, 503, 39, 511, 0, 531], ["+", 0, 503, 49, 200, 51, 16, 31, 74, 0, 24], ["+", 49, 200, 51, 16, 31, 74, 39, 511, 0, 531], ["+", 0, 503, 49, 200, 51, 16, 31, 74, 0, 25]] | 3 | 182 |
import math
import sys
n, m = map(int, input().split())
#print(n)
#print(m)
a = input().split()
l_si_i = [int(b) for b in a]
#print(l_si_i)
#print(max(l_si_i))
#print(sum(l_si_i))
#border = math.floor(sum(l_si_i) / (4 * m))
border = sum(l_si_i) / (4 * m)
#print(border)
check = 0
for i in range(n):
c = l_si_i[i]
... | import math
import sys
n, m = map(int, input().split())
#print(n)
#print(m)
a = input().split()
l_si_i = [int(b) for b in a]
#print(l_si_i)
#print(max(l_si_i))
#print(sum(l_si_i))
#border = math.floor(sum(l_si_i) / (4 * m))
border = sum(l_si_i) / (4 * m)
#print(border)
check = 0
for i in range(n):
if l_si_i[i] >... | [["-", 0, 7, 8, 196, 0, 1, 0, 662, 31, 22], ["-", 0, 7, 8, 196, 0, 1, 0, 662, 0, 32], ["+", 0, 656, 0, 7, 8, 196, 0, 57, 0, 121], ["-", 0, 656, 0, 7, 8, 196, 0, 57, 0, 121], ["-", 0, 7, 8, 196, 0, 57, 15, 666, 0, 22], ["-", 0, 7, 8, 196, 0, 57, 15, 666, 667, 47], ["+", 0, 7, 8, 196, 0, 57, 15, 666, 667, 20]] | 5 | 107 |
N, M = [int(e) for e in input().split()]
A = sorted([int(e) for e in input().split()])
A.reverse()
base =float(sum(A)) / 4.0*M
cond = all([float(e) >= base for e in A[:M]])
ans = 'Yes' if cond else 'No'
print(ans)
| N, M = [int(e) for e in input().split()]
A = sorted([int(e) for e in input().split()])
A.reverse()
base =float(sum(A)) / 4.0/M
cond = all([float(e) >= base for e in A[:M]])
ans = 'Yes' if cond else 'No'
print(ans)
| [["-", 0, 656, 0, 1, 0, 662, 12, 657, 17, 48], ["+", 0, 656, 0, 1, 0, 662, 12, 657, 17, 85]] | 5 | 95 |
n, m = map(int, input().split())
a = list(map(int, input().split()))
a.sort(reverse=True)
sum_a = sum(a)
for i in range(m):
if a[i] > int(sum_a/(4*m)):
continue
else:
print('No')
exit()
print('Yes')
| n, m = map(int, input().split())
a = list(map(int, input().split()))
a.sort(reverse=True)
sum_a = sum(a)
for i in range(m):
if a[i] >= sum_a/(4*m):
continue
else:
print('No')
exit()
print('Yes')
| [["-", 0, 7, 8, 196, 0, 57, 15, 666, 667, 47], ["-", 8, 196, 0, 57, 15, 666, 0, 652, 63, 22], ["-", 0, 57, 15, 666, 0, 652, 3, 4, 0, 24], ["+", 0, 7, 8, 196, 0, 57, 15, 666, 667, 20], ["-", 0, 652, 3, 4, 0, 657, 12, 23, 0, 25]] | 5 | 90 |
N, M = map(int, input().split())
cnt = 0
A = list(map(int, input().split()))
s = sum(A)
for i in range(N):
if(A[i] < (s/(4 * M))):
cnt += 1
if(cnt >= M):
print('Yes')
else:
print('No') | N, M = map(int, input().split())
cnt = 0
A = list(map(int, input().split()))
s = sum(A)
for i in range(N):
if(A[i] >= (s/(4 * M))):
cnt += 1
if(cnt >= M):
print('Yes')
else:
print('No')
| [["-", 8, 196, 0, 57, 15, 23, 0, 666, 667, 18], ["+", 8, 196, 0, 57, 15, 23, 0, 666, 667, 20]] | 5 | 92 |
#include <algorithm>
#include <cmath>
#include <cstdio>
#include <cstring>
using namespace std;
typedef long long ll;
#define M 1005
int A[M];
inline void rd(int &l) {
l = 0;
int f = 0;
char ch = getchar();
while (ch > '9' || ch < '0') {
if (ch == '-')
f = 1;
ch = getchar();
}
while (ch >= '0'... | #include <algorithm>
#include <cmath>
#include <cstdio>
#include <cstring>
using namespace std;
typedef long long ll;
#define M 1005
int A[M];
inline void rd(int &l) {
l = 0;
int f = 0;
char ch = getchar();
while (ch > '9' || ch < '0') {
if (ch == '-')
f = 1;
ch = getchar();
}
while (ch >= '0'... | [["-", 64, 1, 0, 2, 3, 4, 0, 5, 0, 6], ["+", 64, 1, 0, 2, 3, 4, 0, 5, 0, 6], ["-", 0, 1, 0, 2, 3, 4, 0, 5, 0, 6], ["+", 0, 1, 0, 2, 3, 4, 0, 5, 0, 6]] | 1 | 254 |
#line 2 "../../library/template.hpp"
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using pl = pair<ll, ll>;
using vl = vector<ll>;
#define rep(i, n) for (ll i = 0; i < (ll)n; i++)
#define rep3(i, l, r) for (ll i = l; i < (ll)r; i++)
#define per(i, n) for (ll i = (ll)n - 1; i >= 0; i--)
#define pe... | #line 2 "../../library/template.hpp"
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using pl = pair<ll, ll>;
using vl = vector<ll>;
#define rep(i, n) for (ll i = 0; i < (ll)n; i++)
#define rep3(i, l, r) for (ll i = l; i < (ll)r; i++)
#define per(i, n) for (ll i = (ll)n - 1; i >= 0; i--)
#define pe... | [["-", 0, 30, 0, 14, 8, 9, 0, 43, 39, 78], ["+", 0, 30, 0, 14, 8, 9, 0, 43, 39, 40]] | 1 | 485 |
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ld = long double;
#define rep(i, n) for (int i = 0; i < (int)(n); ++i)
#define rrep(i, n) for (int i = (int)(n); i >= 0; --i)
struct fast_ios {
fast_ios() {
cin.tie(0);
ios::sync_with_stdio(false);
cout << fixed << setprecision(20);... | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ld = long double;
#define rep(i, n) for (int i = 0; i < (int)(n); ++i)
#define rrep(i, n) for (int i = (int)(n); i >= 0; --i)
struct fast_ios {
fast_ios() {
cin.tie(0);
ios::sync_with_stdio(false);
cout << fixed << setprecision(20);... | [["-", 0, 30, 0, 14, 8, 9, 0, 43, 39, 40], ["+", 0, 30, 0, 14, 8, 9, 0, 43, 39, 40]] | 1 | 187 |
#include <bits/stdc++.h>
using namespace std;
int main() {
int n, m;
long sum = 0;
cin >> n >> m;
int a[n];
for (int i = 0; i < n; ++i) {
scanf("%d", &a[i]);
sum += a[i];
}
sort(a, a + n);
if (a[n - m] > sum / (double)m / 4.0) {
cout << "Yes";
} else {
cout << "No";
}
return 0... | #include <bits/stdc++.h>
using namespace std;
int main() {
int n, m;
long sum = 0;
cin >> n >> m;
int a[n];
for (int i = 0; i < n; ++i) {
scanf("%d", &a[i]);
sum += a[i];
}
sort(a, a + n);
if (a[n - m] >= sum / (double)m / 4.0) {
cout << "Yes";
} else {
cout << "No";
}
return ... | [["-", 8, 9, 0, 57, 15, 339, 51, 16, 17, 47], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 17, 20]] | 1 | 117 |
#include <bits/stdc++.h>
using namespace std;
int main() {
int n, m;
cin >> n >> m;
int arr[n];
int sum = 0;
for (int i = 0; i < n; i++) {
cin >> arr[i];
sum += arr[i];
}
float d = sum / (4 * m);
int c = 0;
for (int i = 0; i < n; i++) {
if (arr[i] >= d) {
c++;
}
}
if (c >= m)... | #include <bits/stdc++.h>
using namespace std;
int main() {
int n, m;
cin >> n >> m;
int arr[n];
int sum = 0;
for (int i = 0; i < n; i++) {
cin >> arr[i];
sum += arr[i];
}
float d = sum * (1.0) / (4 * m);
// cout<<d<<endl;
int c = 0;
for (int i = 0; i < n; i++) {
if (arr[i] >= d) {
... | [["+", 0, 43, 49, 50, 51, 16, 31, 16, 17, 48], ["+", 49, 50, 51, 16, 31, 16, 12, 23, 0, 24], ["+", 49, 50, 51, 16, 31, 16, 12, 23, 0, 13], ["+", 49, 50, 51, 16, 31, 16, 12, 23, 0, 25]] | 1 | 140 |
#include <bits/stdc++.h>
#include <stdio.h>
#include <string>
using namespace std;
int main() {
int n, m;
cin >> n >> m;
vector<int> a(n);
int total = 0;
for (int i = 0; i < n; i++) {
cin >> a[i];
total += a[i];
}
float jud = total / (4 * m);
int count = n;
for (int i = 0; i < n; i++) {
i... | #include <bits/stdc++.h>
#include <stdio.h>
#include <string>
using namespace std;
int main() {
int n;
float m;
cin >> n >> m;
vector<float> a(n);
float total = 0;
for (int i = 0; i < n; i++) {
cin >> a[i];
total += a[i];
}
float jud = total / (4 * m);
int count = n;
for (int i = 0; i < 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, 43, 39, 344, 3, 347, 0, 77, 39, 40], ["+", 0, 43, 39, 344, 3, 347, 0, 77, 39, 40], ["-", 0, 30, 0, 14, 8, 9, 0, 43, 39, 40]] | 1 | 140 |
# coding: utf-8
# Your code here!
n,m= list(map(int,input().split()))
A = list(map(int,input().split()))
d = sum(A)
A.sort(reverse=True)
for a in range(m):
if A[a]< d//(4*m):
d = 0
break
if d == 0:print("No")
else: print("Yes")
| # coding: utf-8
# Your code here!
n,m= list(map(int,input().split()))
A = list(map(int,input().split()))
d = sum(A)
A.sort(reverse=True)
for a in range(m):
if A[a]< d/(4*m):
d = 0
break
if d == 0:print("No")
else: print("Yes")
| [["-", 8, 196, 0, 57, 15, 666, 0, 657, 17, 676], ["+", 8, 196, 0, 57, 15, 666, 0, 657, 17, 85]] | 5 | 97 |
import java.util.Arrays;
import java.util.Collections;
import java.util.Scanner;
public class Main {
public static void main(String args[]) {
Scanner scan = new Scanner(System.in);
int n = scan.nextInt();
int m = scan.nextInt();
int sum = 0;
Integer array[] = new Integer[n];
String ans = "Yes... | import java.util.Arrays;
import java.util.Collections;
import java.util.Scanner;
public class Main {
public static void main(String args[]) {
Scanner scan = new Scanner(System.in);
int n = scan.nextInt();
int m = scan.nextInt();
double sum = 0;
Double array[] = new Double[n];
String ans = "Ye... | [["-", 0, 195, 8, 196, 0, 503, 39, 506, 0, 507], ["+", 0, 195, 8, 196, 0, 503, 39, 511, 0, 512], ["-", 8, 498, 0, 195, 8, 196, 0, 503, 39, 78], ["+", 8, 498, 0, 195, 8, 196, 0, 503, 39, 78], ["-", 8, 196, 0, 503, 49, 200, 51, 227, 39, 78], ["+", 8, 196, 0, 503, 49, 200, 51, 227, 39, 78], ["-", 8, 196, 0, 1, 0, 11, 12, ... | 3 | 194 |
n,m = map(int,input().split())
List = [int(i) for i in input().split()]
a = sum(x>float(sum(List)/(4*m)) for x in List)
print("Yes" if a >= m else "No")
| n,m = map(int,input().split())
List = [int(i) for i in input().split()]
a = sum(x>=float(sum(List)/(4*m)) for x in List)
print("Yes" if a >= m else "No")
| [["-", 0, 662, 12, 652, 3, 668, 8, 666, 667, 47], ["+", 0, 662, 12, 652, 3, 668, 8, 666, 667, 20]] | 5 | 72 |
#include <math.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
int int_sort(const void *a, const void *b) {
if (*(int *)a < *(int *)b) {
return 1;
} else if (*(int *)a == *(int *)b) {
return 0;
}
return -1;
}
int main(void) {
int n, m;
int a[100] = {0};
int i;
int sum = 0;
sca... | #include <math.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
int int_sort(const void *a, const void *b) {
if (*(int *)a < *(int *)b) {
return 1;
} else if (*(int *)a == *(int *)b) {
return 0;
}
return -1;
}
int main(void) {
int n, m;
int a[100] = {0};
int i;
int sum = 0;
sca... | [["-", 0, 57, 15, 23, 0, 16, 31, 16, 12, 22], ["+", 0, 57, 15, 23, 0, 16, 31, 16, 12, 22]] | 0 | 202 |
N,M = map(int,input().split())
a = list(map(int,input().split()))
a.sort(reverse=True)
s = 0
for i in range(N):
s += a[i]
border = s/4*M
if a[M-1] < border:
print('No')
else:
print('Yes') | N,M = map(int,input().split())
a = list(map(int,input().split()))
a.sort(reverse=True)
s = 0
for i in range(N):
s += a[i]
border = s/(4*M)
if a[M-1] < border:
print('No')
else:
print('Yes') | [["+", 0, 1, 0, 662, 12, 657, 12, 23, 0, 24], ["+", 0, 1, 0, 662, 12, 657, 12, 23, 0, 25]] | 5 | 89 |
#include <bits/stdc++.h>
const int maxn = 105;
int val[maxn], n, m;
int tot = 0, cnt = 0;
int main() {
scanf("%d%d", &n, &m);
for (int i = 1; i <= n; i++)
scanf("%d", &val[i]), tot += val[i];
std::sort(val + 1, val + n + 1);
for (int i = n; i; i--) {
if (val[i] * 4 * m < tot)
cnt++;
}
if (cnt... | #include <bits/stdc++.h>
const int maxn = 105;
int val[maxn], n, m;
int tot = 0, cnt = 0;
int main() {
scanf("%d%d", &n, &m);
for (int i = 1; i <= n; i++)
scanf("%d", &val[i]), tot += val[i];
std::sort(val + 1, val + n + 1);
for (int i = n; i; i--) {
if (val[i] * 4 * m >= tot)
cnt++;
}
if (cn... | [["-", 8, 9, 0, 57, 15, 339, 51, 16, 17, 18], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 17, 20]] | 1 | 151 |
#include <bits/stdc++.h>
using namespace std;
int main() {
int n, m;
cin >> n >> m;
vector<int> vote(n);
int total = 0;
for (int i = 0; i < n; i++) {
int num;
cin >> num;
total += num;
vote.at(i) = num;
}
sort(vote.begin(), vote.end(), greater<int>());
int x = total / 4 / m;
if (vote.... | #include <bits/stdc++.h>
using namespace std;
int main() {
int n, m;
cin >> n >> m;
vector<int> vote(n);
int total = 0;
for (int i = 0; i < n; i++) {
int num;
cin >> num;
total += num;
vote.at(i) = num;
}
sort(vote.begin(), vote.end(), greater<int>());
double x = (double)total / 4 / m;
... | [["-", 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 | 141 |
#include <algorithm>
#include <cmath>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <string>
#include <vector>
using namespace std;
#define ll long long
#define rep(i, s, n) for (int i = s; i < n; i++)
int main() {
int n, m;
cin >> n >> m;
vector<int> a(n);
ll sum = 0;
rep(i, 0,... | #include <algorithm>
#include <cmath>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <string>
#include <vector>
using namespace std;
#define ll long long
#define rep(i, s, n) for (int i = s; i < n; i++)
int main() {
int n, m;
cin >> n >> m;
vector<int> a(n);
ll sum = 0;
rep(i, 0,... | [["+", 0, 9, 0, 1, 0, 11, 12, 16, 17, 72], ["+", 0, 9, 0, 1, 0, 11, 12, 16, 12, 13]] | 1 | 194 |
#include <bits/stdc++.h>
using namespace std;
int main() {
int n, m;
cin >> n >> m;
int arr[n];
int sum = 0, count = 0;
for (int i = 0; i < n; i++) {
cin >> arr[i];
sum = sum + arr[i];
}
sum = sum / (4 * m);
for (int i = 0; i < n; i++) {
if (arr[i] < sum) {
} else {
count++;
... | #include <bits/stdc++.h>
using namespace std;
int main() {
int n, m;
cin >> n >> m;
double arr[n];
double sum = 0;
int count = 0;
for (int i = 0; i < n; i++) {
cin >> arr[i];
sum = sum + arr[i];
}
// cout << sum <<endl;
sum = sum / (4 * m);
// cout << sum << endl;
for (int i = 0; i < n; i... | [["-", 0, 30, 0, 14, 8, 9, 0, 43, 39, 40], ["+", 0, 30, 0, 14, 8, 9, 0, 43, 39, 40], ["-", 0, 30, 0, 14, 8, 9, 0, 43, 0, 21], ["+", 0, 30, 0, 14, 8, 9, 0, 43, 0, 35]] | 1 | 143 |
#include <bits/stdc++.h>
using namespace std;
int main() {
int n, m, sum;
cin >> n >> m;
sum = 0;
vector<int> A(n);
for (int i = 0; i < n; ++i) {
cin >> A.at(i);
sum += A.at(i);
}
int cnt = 0;
double go = sum / (4 * m);
for (int i = 0; i < n; ++i) {
if (go < A.at(i)) {
cnt++;
}... | #include <bits/stdc++.h>
using namespace std;
int main() {
int n, m, sum;
cin >> n >> m;
sum = 0;
vector<int> A(n);
for (int i = 0; i < n; ++i) {
cin >> A.at(i);
sum += A.at(i);
}
int cnt = 0;
double go = (double)sum / (4 * m);
for (int i = 0; i < n; ++i) {
if (go <= A.at(i)) {
cnt... | [["+", 0, 43, 49, 50, 51, 16, 31, 74, 0, 24], ["+", 49, 50, 51, 16, 31, 74, 39, 77, 39, 40], ["+", 0, 43, 49, 50, 51, 16, 31, 74, 0, 25], ["-", 8, 9, 0, 57, 15, 339, 51, 16, 17, 18], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 17, 19]] | 1 | 147 |
#include <bits/stdc++.h>
using namespace std;
int main() {
int x, y;
cin >> x >> y;
vector<int> a(x);
for (int i = 0; i < x; i++) {
cin >> a.at(i);
}
int sum = 0;
for (int i = 0; i < x; i++) {
sum += a.at(i);
}
sort(a.begin(), a.end());
reverse(a.begin(), a.end());
for (int i = 0; i < y; ... | #include <bits/stdc++.h>
using namespace std;
int main() {
int x, y;
cin >> x >> y;
vector<int> a(x);
for (int i = 0; i < x; i++) {
cin >> a.at(i);
}
double sum = 0;
for (int i = 0; i < x; i++) {
sum += a.at(i);
}
sort(a.begin(), a.end());
reverse(a.begin(), a.end());
for (int i = 0; i < ... | [["-", 0, 30, 0, 14, 8, 9, 0, 43, 39, 40], ["+", 0, 30, 0, 14, 8, 9, 0, 43, 39, 40]] | 1 | 171 |
#include <bits/stdc++.h>
#include <string.h>
using namespace std;
int main() {
long long n, m;
cin >> n >> m;
long long a[n], sum = 0;
for (int i = 0; i < n; i++) {
cin >> a[i];
sum = sum + a[i];
}
long long count = 0;
double s = sum / (4 * m) * 1.0;
for (int i = 0; i < n; i++) {
if (a[i] >... |
#include <bits/stdc++.h>
#include <string.h>
using namespace std;
int main() {
long long n, m;
cin >> n >> m;
double a[n], sum = 0;
for (int i = 0; i < n; i++) {
cin >> a[i];
sum = sum + a[i];
}
long long count = 0;
double s = sum / (4 * m * 1.0);
for (int i = 0; i < n; i++) {
if (a[i] >= s... | [["-", 0, 14, 8, 9, 0, 43, 39, 86, 0, 96], ["+", 0, 30, 0, 14, 8, 9, 0, 43, 39, 40], ["-", 49, 50, 51, 16, 31, 16, 12, 23, 0, 25], ["+", 0, 43, 49, 50, 51, 16, 12, 23, 0, 25]] | 1 | 139 |
#include <bits/stdc++.h>
using namespace std;
using lint = long long int;
using pint = pair<int, int>;
using plint = pair<lint, lint>;
struct fast_ios {
fast_ios() {
cin.tie(0);
ios::sync_with_stdio(false);
cout << fixed << setprecision(20);
};
} fast_ios_;
#define ALL(x) (x).begin(), (x).end()
#define ... | #include <bits/stdc++.h>
using namespace std;
using lint = long long int;
using pint = pair<int, int>;
using plint = pair<lint, lint>;
struct fast_ios {
fast_ios() {
cin.tie(0);
ios::sync_with_stdio(false);
cout << fixed << setprecision(20);
};
} fast_ios_;
#define ALL(x) (x).begin(), (x).end()
#define ... | [["-", 0, 30, 0, 14, 8, 9, 0, 43, 39, 40], ["+", 0, 30, 0, 14, 8, 9, 0, 43, 39, 40]] | 1 | 248 |
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
#define all(obj) (obj).begin(), (obj).end()
#define debug(x) cerr << #x << ": " << endl
#define rep(i, n) for (int i = 0; (i) < (n); ++(i))
#define rrep(i, n) for (int i = (n); (i) >= 0; --(i))
#define reps(i, s, n) for (int i = (s); (i) < (n); ++(i))
... | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
#define all(obj) (obj).begin(), (obj).end()
#define debug(x) cerr << #x << ": " << endl
#define rep(i, n) for (int i = 0; (i) < (n); ++(i))
#define rrep(i, n) for (int i = (n); (i) >= 0; --(i))
#define reps(i, s, n) for (int i = (s); (i) < (n); ++(i))
... | [["-", 8, 9, 0, 57, 15, 339, 51, 16, 17, 47], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 17, 20]] | 1 | 398 |
#include <bits/stdc++.h>
using namespace std;
// useful library
int long long gcd(int long long a, int long long b) {
return b ? gcd(b, a % b) : a;
} //最大公約数
int long long lcm(int long long a, int long long b) {
return a / gcd(a, b) * b;
} //最小公倍数
int long long GetDigit(int long long num) {
int long long digit = ... | #include <bits/stdc++.h>
using namespace std;
// useful library
int long long gcd(int long long a, int long long b) {
return b ? gcd(b, a % b) : a;
} //最大公約数
int long long lcm(int long long a, int long long b) {
return a / gcd(a, b) * b;
} //最小公倍数
int long long GetDigit(int long long num) {
int long long digit = ... | [["-", 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, 23, 0, 24], ["+", 0, 43, 49, 50, 51, 16, 12, 2, 63, 22], ["-", 49, 50, 51, 23, 0, 16, 12, 23, 0, 25]] | 1 | 308 |
n,m = map(int, input().split())
ls = list(map(int, input().split()))
ls = sorted(ls,reverse=True)
print("Yes" if ls[m-1]*4*m >sum(ls) else "No")
| n,m = map(int, input().split())
ls = list(map(int, input().split()))
ls = sorted(ls,reverse=True)
print("Yes" if ls[m-1]*4*m >=sum(ls) else "No") | [["-", 0, 652, 3, 4, 0, 41, 0, 666, 667, 47], ["+", 0, 652, 3, 4, 0, 41, 0, 666, 667, 20]] | 5 | 69 |
#include <algorithm>
#include <cmath>
#include <iostream>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <string>
#include <tuple>
#include <unordered_map>
#include <unordered_set>
#include <vector>
using ll = long long int;
using ul = unsigned long long int;
const ll LL_MAX(1LL << 60);
co... |
#include <algorithm>
#include <cmath>
#include <iostream>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <string>
#include <tuple>
#include <unordered_map>
#include <unordered_set>
#include <vector>
using ll = long long int;
using ul = unsigned long long int;
const ll LL_MAX(1LL << 60);
co... | [["-", 51, 16, 12, 16, 12, 23, 0, 16, 31, 13], ["+", 51, 16, 12, 16, 12, 23, 0, 16, 31, 13]] | 1 | 226 |
N,M=(int(i) for i in input().split())
A=list(map(int,input().split()))
S=len(A)
mono=0
soutoku=0
for i in range(S):
soutoku=soutoku+A[i]
for i in range(S):
if A[i]>soutoku/(4*M):
mono=mono+1
if mono>=M:
print("Yes")
else:
print("No") | N,M=(int(i) for i in input().split())
A=list(map(int,input().split()))
S=len(A)
mono=0
soutoku=0
for i in range(S):
soutoku=soutoku+A[i]
for i in range(S):
if A[i]>=soutoku/(4*M):
mono=mono+1
if mono>=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 | 111 |
#include <stdio.h>
int main() {
int i;
double a, b, c[100], sum = 0, ok = 0;
scanf("%lf%lf\n", &a, &b);
for (i = 0; i < a; i++) {
scanf("%lf", &c[i]);
sum += c[i];
}
for (i = 0; i < a; i++) {
if (c[i] / sum >= (1 / 4 * b))
ok++;
}
if (b <= ok)
printf("Yes");
else
printf("No")... | #include <stdio.h>
int main() {
int i;
double a, b, c[100], sum = 0, ok = 0;
scanf("%lf%lf\n", &a, &b);
for (i = 0; i < a; i++) {
scanf("%lf", &c[i]);
sum += c[i];
}
for (i = 0; i < a; i++) {
if (c[i] / sum >= 1 / (4 * b))
ok++;
}
if (b <= ok)
printf("Yes");
else
printf("No")... | [["-", 0, 57, 15, 23, 0, 16, 12, 23, 0, 24], ["+", 15, 23, 0, 16, 12, 16, 12, 23, 0, 24]] | 0 | 137 |
import numpy as np
n, m = map(int, input().split())
an = list(map(int, input().split()))
an = np.array(sorted(an, reverse=True))
total = sum(an)
if sum(an[:m] > (total / (4 * m))) >= m:
print('Yes')
else:
print('No') | import numpy as np
n, m = map(int, input().split())
an = list(map(int, input().split()))
an = np.array(sorted(an, reverse=True))
total = sum(an)
if sum(an[:m] >= (total / (4 * m))) >= m:
print('Yes')
else:
print('No') | [["-", 15, 666, 0, 652, 3, 4, 0, 666, 667, 47], ["+", 15, 666, 0, 652, 3, 4, 0, 666, 667, 20]] | 5 | 94 |
n, m = map(int, input().split())
points = [i for i in map(int, input().split())]
sumValue = sum(points)
candidates = [i for i in points if i > (sumValue/4*m)]
if len(candidates) >= m:
print("Yes")
else:
print("No") | n, m = map(int, input().split())
points = [i for i in map(int, input().split())]
sumValue = sum(points)
candidates = [i for i in points if float(i) >= (sumValue/(4*m))]
if len(candidates) >= m:
print("Yes")
else:
print("No") | [["+", 12, 658, 0, 678, 0, 666, 0, 652, 63, 22], ["+", 0, 678, 0, 666, 0, 652, 3, 4, 0, 24], ["-", 0, 662, 12, 658, 0, 678, 0, 666, 667, 47], ["+", 0, 678, 0, 666, 0, 652, 3, 4, 0, 25], ["+", 0, 662, 12, 658, 0, 678, 0, 666, 667, 20], ["+", 0, 666, 0, 23, 0, 657, 12, 23, 0, 24], ["+", 0, 666, 0, 23, 0, 657, 12, 23, 0, ... | 5 | 83 |
#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 INF 2e9
#define ALL(v) v.begin(), v.end()
using namespace std;
typedef long long ll;
int main() {
int m, n;
vector<int> a;
int votes = 0;
... | #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 INF 2e9
#define ALL(v) v.begin(), v.end()
using namespace std;
typedef long long ll;
int main() {
int m, n;
vector<float> a;
float votes =... | [["-", 0, 43, 39, 344, 3, 347, 0, 77, 39, 40], ["+", 0, 43, 39, 344, 3, 347, 0, 77, 39, 40], ["-", 0, 30, 0, 14, 8, 9, 0, 43, 39, 40], ["+", 0, 30, 0, 14, 8, 9, 0, 43, 39, 40], ["-", 8, 9, 0, 14, 8, 9, 0, 43, 39, 40], ["+", 8, 9, 0, 14, 8, 9, 0, 43, 39, 40]] | 1 | 158 |
#define lp(i, n) for (int i = 0; i < n; i++)
#define pau system("pause")
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
int main() {
int n, m, c = 0, sum = 0;
bool f = 0;
cin >> n >> m;
vector<int> a(n);
lp(i, n) {
cin >> a[i];
sum += a[i];
}
sort(a.rbegin(), a.rend());
lp(... | #define lp(i, n) for (int i = 0; i < n; i++)
#define pau system("pause")
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
int main() {
int n, c = 0;
double m, sum = 0;
bool f = 0;
cin >> n >> m;
vector<int> a(n);
lp(i, n) {
cin >> a[i];
sum += a[i];
}
sort(a.rbegin(), a.rend(... | [["-", 0, 30, 0, 14, 8, 9, 0, 43, 49, 22], ["-", 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, 30, 0, 14, 8, 9, 0, 43, 49, 22]] | 1 | 153 |
#include <stdio.h>
int main(void) {
int n, m;
scanf("%d %d", &n, &m);
int i = 0;
int a[n];
int vote = 0;
while (i < n) {
scanf("%d", &a[i]);
vote += a[i];
i++;
}
i = 0;
int cnt = 0;
double tmp = vote / (4 * m);
while (i < n) {
if (a[i] >= tmp) {
cnt++;
}
i++;
}
... | #include <stdio.h>
int main(void) {
int n, m;
scanf("%d %d", &n, &m);
int i = 0;
int a[n];
int vote = 0;
while (i < n) {
scanf("%d", &a[i]);
vote += a[i];
i++;
}
i = 0;
int cnt = 0;
double tmp = vote;
tmp = tmp / (4 * m);
while (i < n) {
if (a[i] >= tmp) {
cnt++;
}
... | [["+", 0, 30, 0, 14, 8, 9, 0, 43, 0, 35], ["+", 0, 14, 8, 9, 0, 1, 0, 11, 31, 22], ["+", 0, 14, 8, 9, 0, 1, 0, 11, 17, 32], ["+", 8, 9, 0, 1, 0, 11, 12, 16, 31, 22]] | 0 | 147 |
#include <bits/stdc++.h>
using namespace std;
int main() {
int n, m, count = 0, total = 0;
cin >> n;
cin >> m;
int a[n];
for (int i = 0; i < n; i++) {
cin >> a[i];
total += a[i];
}
for (int i = 0; i < n; i++) {
if (a[i] >= ceil(total / (4 * m))) {
count++;
}
}
if (count >= m... | #include <bits/stdc++.h>
using namespace std;
int main() {
int n, m, count = 0;
double total = 0;
cin >> n;
cin >> m;
int a[n];
for (int i = 0; i < n; i++) {
cin >> a[i];
total += a[i];
}
for (int i = 0; i < n; i++) {
if (a[i] >= (total / (4 * m))) {
count++;
}
}
if (count... | [["-", 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, 57, 15, 339, 51, 16, 12, 2, 63, 22]] | 1 | 135 |
#include <stdio.h>
int main() {
int n, m;
scanf("%d %d", &n, &m);
int a[n + 1];
int sum = 0;
for (int i = 1; i <= n; i++) {
scanf("%d", &a[i]);
sum += a[i];
}
int cm = 0;
double std = sum / (4 * m);
for (int i = 1; i <= n; i++) {
if (std <= a[i]) {
cm++;
}
}
if (cm >= m) {
... | #include <stdio.h>
int main() {
int n, m;
scanf("%d %d", &n, &m);
int a[n + 1];
double sum = 0;
for (int i = 1; i <= n; i++) {
scanf("%d", &a[i]);
sum += a[i];
}
int cm = 0;
double std = sum / (4 * m);
for (int i = 1; i <= n; i++) {
if (std <= a[i]) {
cm++;
}
}
if (cm >= m) {... | [["-", 0, 30, 0, 14, 8, 9, 0, 43, 39, 40], ["+", 0, 30, 0, 14, 8, 9, 0, 43, 39, 40]] | 1 | 154 |
N,M = map(int,input().split())
A = list(map(int,input().split()))
S = sum(A)
ans = [i for i in A if i > S / (4*M)]
if len(ans) >= M:
print('Yes')
else:
print('No') | N,M = map(int,input().split())
A = list(map(int,input().split()))
S = sum(A)
ans = [i for i in A if i >= S / (4*M)]
if len(ans) >= M:
print('Yes')
else:
print('No') | [["-", 0, 662, 12, 658, 0, 678, 0, 666, 667, 47], ["+", 0, 662, 12, 658, 0, 678, 0, 666, 667, 20]] | 5 | 80 |
#include <bits/stdc++.h>
using namespace std;
int main() {
int n, m;
cin >> n >> m;
vector<int> a(n);
for (int i = 0; i < n; i++) {
cin >> a.at(i);
}
sort(a.begin(), a.end());
reverse(a.begin(), a.end());
int count = 0;
int sum = accumulate(a.begin(), a.end(), 0);
for (int i = 0; i < m; i++)... | #include <bits/stdc++.h>
using namespace std;
int main() {
int n, m;
cin >> n >> m;
vector<int> a(n);
for (int i = 0; i < n; i++) {
cin >> a.at(i);
}
sort(a.begin(), a.end());
reverse(a.begin(), a.end());
int count = 0;
int sum = accumulate(a.begin(), a.end(), 0);
for (int i = 0; i < m; i++)... | [["+", 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], ["+", 15, 339, 51, 16, 12, 16, 12, 23, 0, 24], ["+", 15, 339, 51, 16, 12, 16, 12, 23, 0, 25]] | 1 | 173 |
# -*- coding: utf-8 -*-
from sys import stdin
from operator import itemgetter
import math
# stdin = open("sample.txt")
N,M = [int(x) for x in stdin.readline().rstrip().split()]
hyo = list(map(int,[int(x) for x in stdin.readline().rstrip().split()]))
sort_hyo = sorted(hyo, reverse=True)
point = sum(hyo)
target = point... | # -*- coding: utf-8 -*-
from sys import stdin
from operator import itemgetter
import math
# stdin = open("sample.txt")
N,M = [int(x) for x in stdin.readline().rstrip().split()]
hyo = list(map(int,[int(x) for x in stdin.readline().rstrip().split()]))
sort_hyo = sorted(hyo, reverse=True)
point = sum(hyo)
target = math.... | [["+", 0, 1, 0, 662, 12, 652, 63, 319, 500, 22], ["+", 0, 1, 0, 662, 12, 652, 63, 319, 0, 131], ["+", 0, 1, 0, 662, 12, 652, 63, 319, 319, 22], ["+", 0, 1, 0, 662, 12, 652, 3, 4, 0, 24], ["-", 0, 656, 0, 1, 0, 662, 12, 657, 17, 676], ["+", 0, 662, 12, 652, 3, 4, 0, 657, 17, 85], ["+", 12, 652, 3, 4, 0, 657, 12, 23, 0, ... | 5 | 141 |
#include <stdio.h>
int main(void) {
int N, M;
scanf("%d %d", &N, &M);
int A[N], number = 0, Sum = 0;
for (int i = 0; i < N; i++) {
scanf("%d", &A[i]);
Sum += A[i];
}
for (int j = 0; j < N; j++) {
if (A[j] >= Sum / (4 * M)) {
number++;
}
}
if (number >= M) {
printf("Yes\n");
... | #include <stdio.h>
int main(void) {
int N, M;
scanf("%d %d", &N, &M);
double A[N], number = 0, Sum = 0;
for (int i = 0; i < N; i++) {
scanf("%lf", &A[i]);
Sum += A[i];
}
for (int j = 0; j < N; j++) {
if (A[j] >= Sum / (4 * M)) {
number++;
}
}
if (number >= M) {
printf("Yes\n")... | [["-", 0, 30, 0, 14, 8, 9, 0, 43, 39, 40], ["+", 0, 30, 0, 14, 8, 9, 0, 43, 39, 40], ["-", 0, 1, 0, 2, 3, 4, 0, 5, 0, 6], ["+", 0, 1, 0, 2, 3, 4, 0, 5, 0, 6]] | 0 | 143 |
n,m = map(int,input().split())
a = [int(x) for x in input().split()]
ans = 'Yes'
list.sort(a, reverse=True)
for i in range(m):
if a[i]/sum(a) <= 1/(4*m):
ans = 'No'
print(ans) | n,m = map(int,input().split())
a = [int(x) for x in input().split()]
ans = 'Yes'
list.sort(a, reverse=True)
for i in range(m):
if a[i]/sum(a) < 1/(4*m):
ans = 'No'
print(ans) | [["-", 0, 7, 8, 196, 0, 57, 15, 666, 667, 19], ["+", 0, 7, 8, 196, 0, 57, 15, 666, 667, 18]] | 5 | 85 |
import java.util.*;
class Main {
public static void main(String[] args) {
Scanner scan = new Scanner(System.in);
int kind = scan.nextInt();
int cho = scan.nextInt();
PriorityQueue in = new PriorityQueue();
int full = 0;
for (int a = 0; a < kind; a++) {
int input = scan.nextInt();
... | import java.util.*;
class Main {
public static void main(String[] args) {
Scanner scan = new Scanner(System.in);
int kind = scan.nextInt();
int cho = scan.nextInt();
PriorityQueue in = new PriorityQueue();
int full = 0;
for (int a = 0; a < kind; a++) {
int input = scan.nextInt();
... | [["-", 0, 16, 31, 16, 12, 23, 0, 16, 31, 499], ["+", 0, 16, 31, 16, 12, 23, 0, 16, 31, 515]] | 3 | 172 |
N,M=map(int,input().split())#N 種類の数 M 選ぶ品物の数
A=list(map(int,input().split()))#得票数
m=sum(A)/(4*M)
A=[i for i in A if i>=m]
if len(A)>=M:
print("Yes")
else:
print("NO") | N,M=map(int,input().split())#N 種類の数 M 選ぶ品物の数
A=list(map(int,input().split()))#得票数
m=sum(A)/(4*M)
A=[i for i in A if i>=m]
if len(A)>=M:
print("Yes")
else:
print("No")
| [["-", 0, 1, 0, 652, 3, 4, 0, 557, 0, 6], ["+", 0, 1, 0, 652, 3, 4, 0, 557, 0, 6]] | 5 | 82 |
N,M=map(int,input().split())
A=list(map(int,input().split()))
Sum=sum(A)
pop=[]
l=Sum/(4*M)
for i in range(N):
if(A[i]>=l):
pop.append(A[i])
print("Yes" if len(pop)==M else "No") | N,M=map(int,input().split())
A=list(map(int,input().split()))
Sum=sum(A)
pop=[]
l=Sum/(4*M)
for i in range(N):
if(A[i]>=l):
pop.append(A[i])
print("Yes" if len(pop)>=M else "No") | [["-", 0, 652, 3, 4, 0, 41, 0, 666, 667, 60], ["+", 0, 652, 3, 4, 0, 41, 0, 666, 667, 20]] | 5 | 96 |
#include <bits/stdc++.h>
using namespace std;
int main() {
int m, n;
cin >> n >> m;
int c = 0;
long a[n];
for (int i = 0; i < n; i++)
cin >> a[i];
long votes = accumulate(a, a + n, 0);
for (int i = 0; i < n; i++)
if (a[i] >= (long)(votes / (m * 4)))
c++;
if (c < m)
cout << "No";
else... | #include <bits/stdc++.h>
using namespace std;
int main() {
int m, n;
cin >> n >> m;
int c = 0;
long a[n];
for (int i = 0; i < n; i++)
cin >> a[i];
double votes = accumulate(a, a + n, 0);
for (int i = 0; i < n; i++)
if (a[i] >= (double)(votes / (m * 4)))
c++;
if (c < m)
cout << "No";
... | [["-", 0, 14, 8, 9, 0, 43, 39, 86, 0, 96], ["+", 0, 30, 0, 14, 8, 9, 0, 43, 39, 40], ["-", 51, 16, 12, 74, 39, 77, 39, 86, 0, 96], ["+", 15, 339, 51, 16, 12, 74, 39, 77, 39, 40]] | 1 | 125 |
N, M = map(int, input().split())
*A, = map(int, input().split())
A.sort(reverse=True)
total_point = sum(A)
selectable = False
if total_point * (1 / (4 * M)) < A[M-1]:
selectable = True
if selectable:
print('Yes')
else:
print('No')
| N, M = map(int, input().split())
*A, = map(int, input().split())
A.sort(reverse=True)
total_point = sum(A)
selectable = False
if total_point * (1 / (4 * M)) <= A[M-1]:
selectable = True
if selectable:
print('Yes')
else:
print('No')
| [["-", 36, 36, 0, 656, 0, 57, 15, 666, 667, 18], ["+", 36, 36, 0, 656, 0, 57, 15, 666, 667, 19]] | 5 | 89 |
#include <bits/stdc++.h>
using namespace std;
int main() {
int n, m, sum = 0;
cin >> n >> m;
int vote[100];
for (int i = 0; i < n; i++) {
scanf("%d", &vote[i]);
sum += vote[i];
}
sort(vote, vote + n);
int flag = 0;
for (int i = n - 1; i >= n - m; i--) {
if (vote[i] < sum / (4 * m)) {
... | #include <bits/stdc++.h>
using namespace std;
int main() {
int n, m;
float sum = 0;
cin >> n >> m;
int vote[100];
for (int i = 0; i < n; i++) {
scanf("%d", &vote[i]);
sum += vote[i];
}
sort(vote, vote + n);
int flag = 0;
for (int i = n - 1; i >= n - m; i--) {
if (vote[i] < 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]] | 1 | 152 |
n,m = map(int,input().split())
l = list(map(int,input().split()))
l.sort(reverse=True)
if l[n-1] < sum(l)/4/m:
print('No')
else:
print('Yes') | n,m = map(int,input().split())
l = list(map(int,input().split()))
l.sort(reverse=True)
if l[m-1] < (sum(l)/4)/m:
print('No')
else:
print('Yes') | [["-", 0, 57, 15, 666, 0, 206, 206, 657, 31, 22], ["+", 0, 57, 15, 666, 0, 206, 206, 657, 31, 22], ["+", 0, 57, 15, 666, 0, 657, 31, 23, 0, 24], ["+", 0, 57, 15, 666, 0, 657, 31, 23, 0, 25]] | 5 | 72 |
n,m=map(int,input().split())
a=list(map(int,input().split()))
s=sum(a)
k=0
for i in range(n):
if a[i]>=s/4*m:
k+=1
if k>=m:
print("Yes")
else:
print("No") | n,m=map(int,input().split())
a=list(map(int,input().split()))
s=sum(a)
k=0
for i in range(n):
if a[i]>=s/(4*m):
k+=1
if k>=m:
print("Yes")
else:
print("No") | [["+", 0, 57, 15, 666, 0, 657, 12, 23, 0, 24], ["+", 0, 57, 15, 666, 0, 657, 12, 23, 0, 25]] | 5 | 84 |
#include <bits/stdc++.h>
typedef long long ll;
#define rep(i, n) for (ll i = 0; i < (n); ++i)
#define rep_rev(n, i) for (ll i = n; i >= 0; --i)
using namespace std;
using P = pair<int, int>;
const long long INF = 1LL << 60;
int main() {
int N, M;
cin >> N >> M;
int A[N], sum = 0, c = 0;
double judge = (double)... | #include <bits/stdc++.h>
typedef long long ll;
#define rep(i, n) for (ll i = 0; i < (n); ++i)
#define rep_rev(n, i) for (ll i = n; i >= 0; --i)
using namespace std;
using P = pair<int, int>;
const long long INF = 1LL << 60;
int main() {
int N, M;
cin >> N >> M;
int A[N], sum = 0, c = 0;
double judge = (double)... | [["-", 0, 57, 15, 339, 51, 16, 31, 16, 17, 18], ["+", 0, 57, 15, 339, 51, 16, 31, 16, 17, 19]] | 1 | 176 |
n,m=map(int,input().split())
a=list(map(int,input().split()))
suma=sum(a)
l=suma/(4*m)
a.sort(reverse=True)
if a[m]>=l:
print('Yes')
else:
print('No') | n,m=map(int,input().split())
a=list(map(int,input().split()))
suma=sum(a)
l=suma/(4*m)
a.sort(reverse=True)
if a[m-1]>=l:
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 | 78 |
N, M=map(int, input().split())
A=list(map(int, input().split()))
count=0
for a in A:
if a>=sum(A)/4:
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 a>=sum(A)/4/M:
count+=1
if count>=M:
print("Yes")
else:
print("No") | [["+", 8, 196, 0, 57, 15, 666, 0, 657, 17, 85], ["+", 8, 196, 0, 57, 15, 666, 0, 657, 12, 22]] | 5 | 73 |
N, M = map(int, input().split())
A = list(map(int, input().split()))
check = ((1 / (4 * M)) * sum(A))
x = 0
for item in A:
if item < check:
x += 1
ans = N - x
if ans > M :
print('Yes')
else:
print('No') | N, M = map(int, input().split())
A = list(map(int, input().split()))
check = ((1 / (4 * M)) * sum(A))
x = 0
for item in A:
if item < check:
x += 1
ans = N - x
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 | 91 |
#include <bits/stdc++.h>
using namespace std;
int main() {
int n, m;
cin >> n >> m;
vector<int> vec(n);
for (int i = 0; i < n; i++) {
cin >> vec.at(i);
}
int sum = 0;
for (int i = 0; i < n; i++) {
sum += vec.at(i);
}
int x = sum / (4 * m);
int count = 0;
for (int i = 0; i < n; i++) {
... | #include <bits/stdc++.h>
using namespace std;
int main() {
double n, m;
cin >> n >> m;
vector<double> vec(n);
for (int i = 0; i < n; i++) {
cin >> vec.at(i);
}
double sum = 0;
for (int i = 0; i < n; i++) {
sum += vec.at(i);
}
// cout << "sum: " << sum << endl;
double x = sum / (4 * m);
... | [["-", 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 | 163 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.