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 <bits/stdc++.h> using namespace std; #define rep(i, N) for (int i = 0; i < (int)N; i++) int main() { int N, M, sum = 0, count = 0; cin >> N >> M; vector<int> A(N, 0); rep(i, N) { cin >> A.at(i); sum += A.at(i); } rep(i, N) { count += (A.at(i) < (double)(sum / (double)(4 * M))) ? 1 : 0; ...
#include <bits/stdc++.h> using namespace std; #define rep(i, N) for (int i = 0; i < (int)N; i++) int main() { int N, M; int64_t sum = 0, count = 0; cin >> N >> M; vector<int> A(N, 0); rep(i, N) { cin >> A.at(i); sum += A.at(i); } rep(i, N) { count += (A.at(i) < (double)(sum / (double)(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], ["-", 8, 9, 0, 57, 15, 339, 51, 16, 17, 20], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 17, 47]]
1
146
in_ = input() n, m = map(int, in_.split()) in_ = input() a = map(int, in_.split()) a = sorted(a, reverse=True) mm = int(sum(a) / (4. * m)) if a[m-1] >= mm: print('Yes') else: print('No')
in_ = input() n, m = map(int, in_.split()) in_ = input() a = map(int, in_.split()) a = sorted(a, reverse=True) mm = sum(a) / (4. * m) if a[m-1] >= mm: print('Yes') else: print('No')
[["-", 0, 656, 0, 1, 0, 662, 12, 652, 63, 22], ["-", 0, 1, 0, 662, 12, 652, 3, 4, 0, 24], ["-", 12, 652, 3, 4, 0, 657, 12, 23, 0, 25]]
5
85
#include <iostream> #include <string> using namespace std; typedef long long ll; int main() { ll M, N; cin >> N >> M; ll *A = new ll[N]; ll total = 0; for (ll i = 0; i < N; i++) { cin >> A[i]; total += A[i]; } ll cnt = 0; for (ll i = 0; i < N; i++) { if (A[i] >= total / 4.0 / M) { ...
#include <iostream> #include <string> using namespace std; typedef long long ll; int main() { ll M, N; cin >> N >> M; ll *A = new ll[N]; ll total = 0; for (ll i = 0; i < N; i++) { cin >> A[i]; total += A[i]; } ll cnt = 0; for (ll i = 0; i < N; i++) { if (A[i] >= total / 4.0 / M) { ...
[["-", 8, 9, 0, 57, 15, 339, 51, 16, 17, 47], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 17, 20]]
1
144
#include <bits/stdc++.h> using namespace std; int main() { int n, m; vector<int> a_vec(110); int pic = 0; int a_sum = 0; cin >> n >> m; for (int i = 0; i < n; i++) { cin >> a_vec.at(i); a_sum += a_vec.at(i); } for (int j = 0; j < n; j++) { if (a_vec.at(j) >= (a_sum / (4 * m))) { pic...
#include <bits/stdc++.h> using namespace std; int main() { int n, m; vector<int> a_vec(110); int pic = 0; int a_sum = 0; cin >> n >> m; for (int i = 0; i < n; i++) { cin >> a_vec.at(i); a_sum += a_vec.at(i); } for (int j = 0; j < n; j++) { if (a_vec.at(j) >= (a_sum / (4.0 * m))) { p...
[["-", 12, 23, 0, 16, 12, 23, 0, 16, 31, 13], ["+", 12, 23, 0, 16, 12, 23, 0, 16, 31, 13]]
1
143
n,m = map(int,input().split()) a = [ int(x) for x in input().split()] limit = sum(a)//(4*m) count=0 for x in a: if(x>=limit): count+=1 if(count<m): print('No') else: print('Yes')
n,m = map(int,input().split()) a = [ int(x) for x in input().split()] limit = sum(a)/(4*m) count=0 for x in a: if(x>=limit): count+=1 if(count<m): print('No') else: print('Yes')
[["-", 0, 656, 0, 1, 0, 662, 12, 657, 17, 676], ["+", 0, 656, 0, 1, 0, 662, 12, 657, 17, 85]]
5
85
#include <bits/stdc++.h> using namespace std; int main() { int n, m; cin >> n >> m; int a[n]; float sum = 0; for (int i = 0; i < n; i++) { cin >> a[i]; sum += a[i]; } int count = 0; for (int i = 0; i < n; i++) { if (a[i] >= (sum / (4 * m))) { count++; } if (count == m) { ...
#include <bits/stdc++.h> using namespace std; int main() { int n, m; cin >> n >> m; int a[n]; float sum = 0; for (int i = 0; i < n; i++) { cin >> a[i]; sum += a[i]; } int count = 0; for (int i = 0; i < n; i++) { if (a[i] >= (sum / (4 * m))) { count++; } if (count == m) { ...
[["-", 0, 1, 0, 16, 31, 16, 12, 5, 0, 6], ["+", 0, 1, 0, 16, 31, 16, 12, 5, 0, 6]]
1
144
#include <bits/stdc++.h> 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 = 0; for (int i = 0; i < n; i++) sum += a[i]; int cnt = 0; for (int i = 0; i < n; i++) { if (a[i] >= sum / (4 * m)) cnt++; } if (cnt >= m...
#include <bits/stdc++.h> 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 = 0; for (int i = 0; i < n; i++) sum += a[i]; int cnt = 0; for (int i = 0; i < n; i++) { if ((double)a[i] >= (double)sum / (4 * m)) cnt++; ...
[["+", 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
142
n, m = gets.split.map {|item| item.to_i} product = gets.split.map {|item| item.to_i} total_vote = product.inject(:+) is_choose = product.map {|item| item >= total_vote / (4 * m)} if m <= is_choose.count(true) then puts "Yes" else puts "No" end
n, m = gets.split.map {|item| item.to_i} product = gets.split.map {|item| item.to_i} total_vote = product.inject(:+) is_choose = product.map {|item| item >= total_vote.to_f / (4 * m)} if m <= is_choose.count(true) then puts "Yes" else puts "No" end
[["+", 8, 734, 0, 738, 12, 738, 31, 652, 17, 131], ["+", 8, 734, 0, 738, 12, 738, 31, 652, 735, 22]]
4
79
N, M = map(int, input().split()) A = list(map(int, input().split())) thresh_score = 1/(4*M) * sum(A) over_count = sum([1 if a > thresh_score else 0 for a in A]) print('Yes' if over_count >= M else 'No')
N, M = map(int, input().split()) A = list(map(int, input().split())) thresh_score = 1/(4*M) * sum(A) over_count = sum([1 if a >= thresh_score else 0 for a in A]) print('Yes' if over_count >= M else 'No')
[["-", 3, 4, 0, 658, 8, 41, 0, 666, 667, 47], ["+", 3, 4, 0, 658, 8, 41, 0, 666, 667, 20]]
5
79
N, M = map(int, input().split()) A = input().split() list_a = [int(n) for n in A] count = 0 waru = 4 * M SUM = sum(list_a) vote = SUM / waru for i in range(0, N): if list_a[i] > vote: count += 1 else: pass if count >= M: print("Yes") else: print("No")
N, M = map(int, input().split()) A = input().split() list_a = [int(n) for n in A] count = 0 waru = 4 * M SUM = sum(list_a) vote = SUM / waru for i in range(0, N): if list_a[i] >= vote: count += 1 else: pass if 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
99
#include <bits/stdc++.h> using namespace std; int main() { int n, m, x; x = 0; cin >> n >> m; vector<int> vec(n); for (int i = 0; i < n; i++) { cin >> vec.at(i); x += vec.at(i); } sort(vec.begin(), vec.end()); reverse(vec.begin(), vec.end()); bool y = true; for (int i = 0; i < m; i++) { ...
#include <bits/stdc++.h> using namespace std; int main() { int n, m; double x = 0; cin >> n >> m; vector<int> vec(n); for (int i = 0; i < n; i++) { cin >> vec.at(i); x += vec.at(i); } sort(vec.begin(), vec.end()); reverse(vec.begin(), vec.end()); bool y = true; for (int i = 0; i < m; i++) {...
[["-", 0, 30, 0, 14, 8, 9, 0, 43, 0, 21], ["-", 0, 30, 0, 14, 8, 9, 0, 43, 49, 22], ["+", 0, 30, 0, 14, 8, 9, 0, 43, 39, 40]]
1
173
#include <bits/stdc++.h> using namespace std; int main() { long n, m; long sum = 0; vector<long> vec; cin >> n >> m; long res = 0; for (long i = 0; i < n; ++i) { long a; cin >> a; vec.push_back(a); sum += a; } long tmp = sum / (4 * m); auto itrend = vec.end(); for (auto itr = vec...
#include <bits/stdc++.h> using namespace std; int main() { long n, m; long sum = 0; vector<long> vec; cin >> n >> m; long res = 0; for (long i = 0; i < n; ++i) { long a; cin >> a; vec.push_back(a); sum += a; } double tmp = sum / (4.0 * m); auto itrend = vec.end(); for (auto itr =...
[["-", 0, 14, 8, 9, 0, 43, 39, 86, 0, 96], ["+", 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
158
#include <bits/stdc++.h> using namespace std; int main() { int M, N; cin >> N >> M; vector<int> A(N); int all; all = 0; for (int i = 0; i < N; i++) { cin >> A.at(i); all = all + A.at(i); } sort(A.begin(), A.end(), greater<int>()); if (A.at(M - 1) >= all / (4 * M)) { cout << "Yes"; } el...
#include <bits/stdc++.h> using namespace std; int main() { int N, M; cin >> N >> M; vector<int> A(N); double all; all = 0; for (int i = 0; i < N; i++) { cin >> A.at(i); all = all + A.at(i); } sort(A.begin(), A.end(), greater<int>()); if (A.at(M - 1) >= all / (4 * M)) { cout << "Yes"; }...
[["-", 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, 21], ["+", 0, 30, 0, 14, 8, 9, 0, 43, 49, 22], ["-", 0, 30, 0, 14, 8, 9, 0, 43, 39, 40], ["+", 0, 30, 0, 14, 8, 9, 0, 43, 39, 40]]
1
133
#include <bits/stdc++.h> using namespace std; #define rep(i, n) for (int i = 0; i < (n); i++) #define pb push_back #define all(v) (v).begin(), (v).end() #define fi first #define se second #define sz(x) ((int)(x).size()) using ll = long long; typedef pair<int, int> pii; typedef pair<ll, ll> pll; #define MOD 1000000007 c...
#include <bits/stdc++.h> using namespace std; #define rep(i, n) for (int i = 0; i < (n); i++) #define pb push_back #define all(v) (v).begin(), (v).end() #define fi first #define se second #define sz(x) ((int)(x).size()) using ll = long long; typedef pair<int, int> pii; typedef pair<ll, ll> pll; #define MOD 1000000007 c...
[["-", 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, 39, 78]]
1
263
import java.io.*; import java.util.*; public class Main { public static void main(String[] args) throws IOException { BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); PrintWriter pw = new PrintWriter(new OutputStreamWriter(System.out)); StringTokenizer st = new StringTokenizer(b...
import java.io.*; import java.util.*; public class Main { public static void main(String[] args) throws IOException { BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); PrintWriter pw = new PrintWriter(new OutputStreamWriter(System.out)); StringTokenizer st = new StringTokenizer(b...
[["+", 0, 16, 12, 16, 12, 74, 39, 511, 0, 512], ["+", 15, 15, 0, 16, 12, 16, 12, 74, 0, 25], ["+", 0, 16, 12, 16, 12, 74, 51, 23, 0, 24]]
3
237
import math n, m = map(int, input().split()) ls = list(map(int, input().split())) ls.sort(reverse=True) gk = sum(ls) hikaku = math.ceil(gk/(4*n)) if hikaku <=int(ls[m-1]): print('Yes') else: print('No')
import math n, m = map(int, input().split()) ls = list(map(int, input().split())) ls.sort(reverse=True) gk = sum(ls) hikaku = math.ceil(gk/(4*m)) if hikaku <= int(ls[m-1]): print('Yes') else: print('No')
[["-", 3, 4, 0, 657, 12, 23, 0, 657, 12, 22], ["+", 3, 4, 0, 657, 12, 23, 0, 657, 12, 22]]
5
90
#include <iostream> #include <math.h> using namespace std; #define rep(i, n) for (int i = 0; i < (int)(n); i++) int main() { int N, M; cin >> N >> M; int A[110]; int total = 0; rep(i, N) { cin >> A[i]; total += A[i]; } int c = 0; int AA = (total / (4 * M)); rep(i, N) { if (A[i] >= AA) { ...
#include <iostream> #include <math.h> using namespace std; #define rep(i, n) for (int i = 0; i < (int)(n); i++) int main() { double N, M; cin >> N >> M; int A[110]; double total = 0; rep(i, N) { cin >> A[i]; total += A[i]; } int c = 0; double AA = (total / (4 * M)); rep(i, N) { if (A[i]...
[["-", 0, 30, 0, 14, 8, 9, 0, 43, 39, 40], ["+", 0, 30, 0, 14, 8, 9, 0, 43, 39, 40]]
1
132
#include <bits/stdc++.h> using namespace std; #define IOS \ ios::sync_with_stdio(false); \ cin.tie(0); #define FOR(i, s, n) for (int i = (s); i < (n); i++) #define REP(i, n) FOR(i, 0, n) #define RREP(i...
#include <bits/stdc++.h> using namespace std; #define IOS \ ios::sync_with_stdio(false); \ cin.tie(0); #define FOR(i, s, n) for (int i = (s); i < (n); i++) #define REP(i, n) FOR(i, 0, n) #define RREP(i...
[["-", 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
199
from sys import stdin N, M = [int(x) for x in stdin.readline().rstrip().split()] A = [int(x) for x in input().split()] # print(N, M, A) A.sort() if sum(A) % (4*M): b = sum(A)//(4*M) else: b = sum(A)//(4*M)+1 # print(b,A,A[N-1-M-1]) if A[N-1-(M-1)] >= b: print("Yes") else: print("No") # print(A)
from sys import stdin N, M = [int(x) for x in stdin.readline().rstrip().split()] A = [int(x) for x in input().split()] # print(N, M, A) A.sort() if sum(A) % (4*M) == 0: b = sum(A)//(4*M) else: b = sum(A)//(4*M)+1 # print(b,A,A[N-1-M+1]) if A[N-1-(M-1)] >= b: print("Yes") else: print("No") # print(A)
[["+", 36, 36, 0, 656, 0, 57, 15, 666, 667, 60], ["+", 36, 36, 0, 656, 0, 57, 15, 666, 0, 612]]
5
126
N, M = map(int, input().split()) lists, count, error = [int(x) for x in input().split()], 0, 0 for x in lists: if x < ((1 / (4 * M)) * sum(lists)): count += 1 print('Yes' if count >= M else 'No')
N, M = map(int, input().split()) lists, count = [int(x) for x in input().split()], 0 for x in lists: if x >= ((1 / (4 * M)) * sum(lists)): count += 1 print('Yes' if count >= M else 'No')
[["-", 0, 656, 0, 1, 0, 662, 31, 684, 0, 21], ["-", 0, 656, 0, 1, 0, 662, 31, 684, 0, 22], ["-", 0, 656, 0, 1, 0, 662, 12, 432, 0, 21], ["-", 0, 656, 0, 1, 0, 662, 12, 432, 0, 612], ["-", 0, 7, 8, 196, 0, 57, 15, 666, 667, 18], ["+", 0, 7, 8, 196, 0, 57, 15, 666, 667, 20]]
5
84
N, M = (int(x) for x in input().split()) A = list(map(int, input().strip().split())) A.sort(reverse=True) for m in range(M): s = sum(A) if A[m] > s / (4 * M): a = True else: a = False if a == True: print("Yes") else: print("No")
N, M = (int(x) for x in input().split()) A = list(map(int, input().strip().split())) A.sort(reverse=True) for m in range(M): s = sum(A) if A[m] >= s / (4 * M): a = True else: a = False if a == True: 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
104
N, M = map(int, input().split()) A = list(map(int, input().split())) sum_A = sum(A) bool_list = [] for i in range(len(A)): if A[i] >= (sum_A / 4*M): bool_list.append("T") else: continue # print(sum_A) # print(bool_list) if bool_list.count("T") >= M: print("Yes") else: print("No") ...
N, M = map(int, input().split()) A = list(map(int, input().split())) sum_A = sum(A) bool_list = [] for i in range(len(A)): if A[i] >= (sum_A / (4*M)): bool_list.append("T") else: continue if bool_list.count("T") >= M: print("Yes") else: print("No")
[["+", 15, 666, 0, 23, 0, 657, 12, 23, 0, 24], ["+", 15, 666, 0, 23, 0, 657, 12, 23, 0, 25]]
5
107
n,m = map(int,input().split()) lis = input().split() lis = [int(i) for i in lis] s = sum(lis) ans = 0 for i in range(n): if lis[i] > s*(1/(4*m)): ans += 1 if ans >= m: print("Yes") else: print("No")
n,m = map(int,input().split()) lis = input().split() lis = [int(i) for i in lis] s = sum(lis) ans = 0 for i in range(n): if lis[i] >= s*(1/(4*m)): ans += 1 if ans >= 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
94
N, M = map(int, input(). split()) A = list(map(int, input().split())) A.sort() S = sum(A) if 1/(4*M) <= A[N-M]/S : print("YES") else: print("NO")
N, M = map(int, input(). split()) A = list(map(int, input().split())) A.sort() S = sum(A) if 1/(4*M) <= A[N-M]/S : 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
76
#include <bits/stdc++.h> using namespace std; int main() { int N, M; cin >> N >> M; vector<int> A(N); for (auto i = 0; i < N; ++i) { cin >> A[i]; } int tot = accumulate(A.begin(), A.end(), 0); // cout << "db:" << tot << endl; int cnt = 0; for (auto xi : A) { if ((double)xi >= (double)(tot / ...
#include <bits/stdc++.h> using namespace std; int main() { int N, M; cin >> N >> M; vector<int> A(N); for (auto i = 0; i < N; ++i) { cin >> A[i]; } int tot = accumulate(A.begin(), A.end(), 0); // cout << "db:" << tot << endl; int cnt = 0; for (auto xi : A) { if ((double)xi >= ((double)tot / ...
[["+", 51, 16, 12, 23, 0, 16, 31, 74, 0, 24], ["-", 15, 339, 51, 16, 12, 74, 51, 23, 0, 24], ["+", 0, 16, 12, 23, 0, 16, 12, 74, 0, 24], ["+", 12, 23, 0, 16, 12, 74, 39, 77, 39, 40], ["+", 0, 16, 12, 23, 0, 16, 12, 74, 0, 25]]
1
140
n, m = map(int, input().split()) a = sorted(list(map(int, input().split())), reverse=True) num = int(sum(a)/(4*m)) if a[m-1] < num: print('No') else: print('Yes')
n, m = map(int, input().split()) a = sorted(list(map(int, input().split())), reverse=True) num = int(-(-sum(a)//(4*m))) if a[m-1] < num: print('No') else: print('Yes')
[["+", 0, 662, 12, 652, 3, 4, 0, 664, 17, 33], ["+", 12, 652, 3, 4, 0, 664, 28, 23, 0, 24], ["+", 0, 664, 28, 23, 0, 657, 31, 664, 17, 33], ["-", 0, 662, 12, 652, 3, 4, 0, 657, 17, 85], ["+", 3, 4, 0, 664, 28, 23, 0, 657, 17, 676], ["+", 0, 664, 28, 23, 0, 657, 12, 23, 0, 25]]
5
79
#include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < n; i++) using namespace std; using ll = long long; int main() { int N, M, sum = 0; cin >> N >> M; double A[N], X; rep(i, N) { cin >> A[i]; sum += A[i]; } X = (double)sum / (4 * M); sort(A, A + N); if (A[N - M] > X) cout << "Y...
#include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < n; i++) using namespace std; using ll = long long; int main() { int N, M, sum = 0; cin >> N >> M; double A[N], X; rep(i, N) { cin >> A[i]; sum += A[i]; } X = (double)sum / (4 * M); sort(A, A + N); if (A[N - M] >= X) cout << "...
[["-", 8, 9, 0, 57, 15, 339, 51, 16, 17, 47], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 17, 20]]
1
120
#include <bits/stdc++.h> using namespace std; int main() { int a, b, sum = 0; cin >> a >> b; int arr[a]; for (int i = 0; i < a; i++) cin >> arr[i]; sort(arr, arr + a, greater<int>()); for (int i = 0; i < a; i++) sum += arr[i]; int l = sum / (4 * b); int c = 0, f = 0; for (int i = 0; i < a; i+...
#include <bits/stdc++.h> using namespace std; int main() { int a, b, sum = 0; cin >> a >> b; int arr[a]; for (int i = 0; i < a; i++) cin >> arr[i]; sort(arr, arr + a, greater<int>()); for (int i = 0; i < a; i++) sum += arr[i]; float l = sum / (4.0 * b); int c = 0, f = 0; for (int i = 0; i < a...
[["-", 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
179
#include <bits/stdc++.h> using namespace std; #define rep(i, n) for (int(i) = 0; (i) < (n); (i)++) int main() { // 入力 int n, m; cin >> n >> m; int a[n]; int sum = 0; rep(i, n) { scanf("%d", &a[i]); } rep(i, n) { sum += a[i]; } float border = float(sum) / float(4 * m); int cnt = 0; rep(i, n) { i...
#include <bits/stdc++.h> using namespace std; #define rep(i, n) for (int(i) = 0; (i) < (n); (i)++) int main() { // 入力 int n, m; cin >> n >> m; int a[n]; int sum = 0; rep(i, n) { scanf("%d", &a[i]); } rep(i, n) { sum += a[i]; } float border = float(sum) / float(4 * m); int cnt = 0; rep(i, n) { i...
[["-", 8, 9, 0, 57, 15, 339, 51, 16, 17, 47], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 17, 20]]
1
144
N,M=map(int,input().split()) A=[int(b) for b in input().split()] cnt=0 ans=sum(A)//(4*M) #print(ans) for i in range(N): if A[i] >=ans: cnt+=1 #print(cnt) if cnt >= M: print('Yes') else: print('No')
N,M=map(int,input().split()) A=[int(b) for b in input().split()] cnt=0 ans=sum(A)/(4*M) #print(ans) for i in range(N): if A[i] >=ans: cnt+=1 #print(cnt) if cnt >= 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
89
n, m = map(int, input().split()) a = [int(e) for e in input().split()] s = sum(a) / (4 * m) ans = 0 for i in range(n - 1): if a[i] >= s: ans += 1 else: ans += 0 if ans >= m: print("Yes") else: print("No")
n, m = map(int, input().split()) a = [int(e) for e in input().split()] s = sum(a) / (4 * m) ans = 0 for i in range(n): if a[i] >= s: ans += 1 else: ans += 0 if ans >= m: print("Yes") else: print("No")
[["-", 0, 7, 12, 652, 3, 4, 0, 657, 17, 33], ["-", 0, 7, 12, 652, 3, 4, 0, 657, 12, 612]]
5
94
#include <algorithm> #include <iostream> #include <string> #include <vector> using namespace std; int main() { int n, m; int sum = 0; cin >> n >> m; // a = new int[n]; vector<int> a(n); for (int i = 0; i < n; i++) { cin >> a[i]; sum += a[i]; } sort(a.begin(), a.end()); if (a[n - m] >= sum / ...
#include <algorithm> #include <iostream> #include <string> #include <vector> using namespace std; int main() { int n, m; int sum = 0; cin >> n >> m; // a = new int[n]; vector<int> a(n); for (int i = 0; i < n; i++) { cin >> a[i]; sum += a[i]; } sort(a.begin(), a.end()); if ((double)a[n - m] >...
[["+", 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
131
N, M = map(int,input().split()) A = list(map(int,input().split())) S = sum(A) f = S / (4 * M) A.sort(reverse=True) flag = 0 for i in range(M): if A[i] > f: pass else: flag = 1 break if flag == 0: print("Yes") else: print("No")
N, M = map(int,input().split()) A = list(map(int,input().split())) S = sum(A) f = S / (4 * M) A.sort(reverse=True) flag = 0 for i in range(M): if A[i] >= f: pass else: flag = 1 break if flag == 0: 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
101
#include <bits/stdc++.h> using namespace std; typedef int64_t i64; int main() { int N, M; cin >> N >> M; vector<int> v(N); int t = 0; for (int i = 0; i < N; i++) { int a; cin >> a; t += a; v.at(i) = a; } int c = 0; for (int i = 0; i < N; i++) { if (4 * M * v.at(i) > t) { c++...
#include <bits/stdc++.h> using namespace std; typedef int64_t i64; int main() { int N, M; cin >> N >> M; vector<int> v(N); int t = 0; for (int i = 0; i < N; i++) { int a; cin >> a; t += a; v.at(i) = a; } int c = 0; for (int i = 0; i < N; i++) { // v.at(i) < t / 4M if (4 * M ...
[["-", 8, 9, 0, 57, 15, 339, 51, 16, 17, 47], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 17, 20]]
1
141
#define _GLIBCXX_DEBUG #include <bits/stdc++.h> using namespace std; typedef long long ll; typedef pair<int, int> pp; const int INF = 1e9; const int MOD = 1000000007; const double pi = 3.141592653589793238; ll gcd(ll a, ll b) { return __gcd(a, b); } //最大公約数 ll lcm(ll a, ll b) { return a / gcd(a, b) * b; } //最大公...
#define _GLIBCXX_DEBUG #include <bits/stdc++.h> using namespace std; typedef long long ll; typedef pair<int, int> pp; const int INF = 1e9; const int MOD = 1000000007; const double pi = 3.141592653589793238; ll gcd(ll a, ll b) { return __gcd(a, b); } //最大公約数 ll lcm(ll a, ll b) { return a / gcd(a, b) * b; } //最大公...
[["-", 0, 43, 49, 50, 51, 74, 51, 23, 0, 24], ["-", 51, 74, 51, 23, 0, 16, 12, 23, 0, 25]]
1
437
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(); Integer[] ary = new Integer[n]; int total = 0; for (int i = 0; i < n; i++) { ary[i] = sc.nextInt(); total += ary[i]; ...
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(); Integer[] ary = new Integer[n]; int total = 0; for (int i = 0; i < n; i++) { ary[i] = sc.nextInt(); total += ary[i]; ...
[["-", 8, 196, 0, 57, 15, 15, 0, 16, 17, 47], ["+", 8, 196, 0, 57, 15, 15, 0, 16, 17, 18], ["-", 0, 1, 0, 492, 3, 4, 0, 5, 0, 491], ["+", 0, 1, 0, 492, 3, 4, 0, 5, 0, 491]]
3
160
#include <algorithm> #include <iostream> using namespace std; int n, a[10005], sum, m, conditie; int main() { cin >> n >> m; for (int i = 1; i <= n; i++) { cin >> a[i]; sum += a[i]; } conditie = sum / (4 * m); sort(a + 1, a + n + 1); for (int i = n; i >= n - m + 1; i--) if (a[i] < conditie) {...
#include <algorithm> #include <iostream> using namespace std; int n, a[10005]; double sum, m, conditie; int main() { cin >> n >> m; for (int i = 1; i <= n; i++) { cin >> a[i]; sum += a[i]; } conditie = sum / (4 * m); sort(a + 1, a + n + 1); for (int i = n; i >= n - m + 1; i--) if (a[i] < cond...
[["-", 36, 36, 36, 36, 0, 30, 0, 43, 0, 21], ["+", 36, 36, 36, 36, 0, 30, 0, 43, 0, 35], ["+", 36, 36, 36, 36, 0, 30, 0, 43, 39, 40]]
1
142
N, M = map(int, input().split()) num_list = list(map(int, input().split())) sorted_list = sorted(num_list, reverse=True) hoge = 4*M thr = sum(num_list) // hoge ans = 'Yes' if sorted_list[M-1] < thr: ans = 'No' print(ans)
N, M = map(int, input().split()) num_list = list(map(int, input().split())) sorted_list = sorted(num_list, reverse=True) hoge = 4*M thr = sum(num_list) / hoge ans = 'Yes' if sorted_list[M-1] < thr: ans = 'No' print(ans)
[["-", 0, 656, 0, 1, 0, 662, 12, 657, 17, 676], ["+", 0, 656, 0, 1, 0, 662, 12, 657, 17, 85]]
5
80
#include <iostream> #include <vector> using namespace std; int main() { int n, m; cin >> n >> m; float a[n]; int sum = 0; int count = 0; for (int i = 0; i < n; i++) { cin >> a[i]; sum += (int)a[i]; } float border = sum / (4 * m); for (int i = 0; i < n; i++) { if (border <= a[i]) { ...
#include <iostream> #include <vector> using namespace std; int main() { int n, m; cin >> n >> m; float a[n]; int sum = 0; int count = 0; for (int i = 0; i < n; i++) { cin >> a[i]; sum += (int)a[i]; } float border = (float)sum / (float)(4 * m); for (int i = 0; i < n; i++) { if (border <...
[["+", 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], ["+", 0, 43, 49, 50, 51, 16, 12, 74, 0, 24], ["+", 49, 50, 51, 16, 12, 74, 39, 77, 39, 40], ["+", 0, 43, 49, 50, 51, 16, 12, 74, 0, 25]]
1
141
n, m = map(int, input().split()) a = list(map(int, input().split())) choicable = list(map(lambda x:True if x>sum(a)/(4*m) else False,a)) print('Yes' if sum(choicable) >= m else 'No')
n, m = map(int, input().split()) a = list(map(int, input().split())) choicable = list(map(lambda x:True if x>=sum(a)/(4*m) else False,a)) print('Yes' if sum(choicable) >= m else 'No')
[["-", 3, 4, 0, 670, 8, 41, 0, 666, 667, 47], ["+", 3, 4, 0, 670, 8, 41, 0, 666, 667, 20]]
5
79
#include <bits/stdc++.h> #include <iostream> #define rep(i, z) for (int i = 0; i < (int)(z); i++) #define rep1(i, z) for (int i = 1; i <= (int)(z); i++) using namespace std; typedef long long ll; const ll MOD = 1e9 + 7; using pear = pair<int, int>; int main() { int n, m, sum = 0; cin >> n >> m; vector<int> a(...
#include <bits/stdc++.h> #include <iostream> #define rep(i, z) for (int i = 0; i < (int)(z); i++) #define rep1(i, z) for (int i = 1; i <= (int)(z); i++) using namespace std; typedef long long ll; const ll MOD = 1e9 + 7; using pear = pair<int, int>; int main() { int n, m, sum = 0; cin >> n >> m; vector<int> 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
174
N, M = list(map(int, input().split())) A = list(map(int, input().split())) mm = int(sum(A) / (4 * M)) print('Yes' if len([i for i in A if i >= mm]) >= M else 'No')
N, M = list(map(int, input().split())) A = list(map(int, input().split())) mm = sum(A) / (4 * M) print('Yes' if len([i for i in A if i >= mm]) >= M else 'No')
[["-", 0, 656, 0, 1, 0, 662, 12, 652, 63, 22], ["-", 0, 1, 0, 662, 12, 652, 3, 4, 0, 24], ["-", 12, 652, 3, 4, 0, 657, 12, 23, 0, 25]]
5
78
n, m = map(int, input().split()) a = list(map(int, input().split())) u = sum(a) / (4*m) print(u) l = 0 for i in a: if i >= u: l += 1 print("Yes") if l >= m else print("No")
n, m = map(int, input().split()) a = list(map(int, input().split())) u = sum(a) / (4*m) l = 0 for i in a: if i >= u: l += 1 print("Yes") if l >= m else print("No")
[["-", 36, 36, 0, 656, 0, 1, 0, 652, 63, 22], ["-", 0, 656, 0, 1, 0, 652, 3, 4, 0, 24], ["-", 0, 656, 0, 1, 0, 652, 3, 4, 0, 22], ["-", 0, 656, 0, 1, 0, 652, 3, 4, 0, 25]]
5
82
import java.util.Arrays; import java.util.Scanner; public class Main { static Scanner sc = new Scanner(System.in); public static void main(String[] args) { int n = sc.nextInt(); int m = sc.nextInt(); int[] a = new int[n]; for (int i = 0; i < n; i++) { a[i] = sc.nextInt(); } int cn...
import java.util.Arrays; import java.util.Scanner; public class Main { static Scanner sc = new Scanner(System.in); public static void main(String[] args) { int n = sc.nextInt(); int m = sc.nextInt(); int[] a = new int[n]; for (int i = 0; i < n; i++) { a[i] = sc.nextInt(); } int cn...
[["-", 0, 195, 8, 196, 0, 503, 39, 506, 0, 507], ["+", 0, 195, 8, 196, 0, 503, 39, 511, 0, 512], ["-", 8, 196, 0, 503, 49, 200, 51, 16, 31, 499], ["+", 8, 196, 0, 503, 49, 200, 51, 16, 31, 515], ["-", 0, 492, 3, 4, 0, 510, 15, 16, 12, 22], ["+", 0, 492, 3, 4, 0, 510, 15, 16, 12, 22]]
3
181
#include <algorithm> // min, max, swap, sort, reverse, lower_bound, upper_bound #include <bits/stdc++.h> // isupper, islower, isdigit, toupper, tolower #include <bitset> // bitset #include <cstdint> // int64_t, int*_t #include <cstdio> // printf #include <deque> // deque #include <iostream> ...
#include <algorithm> // min, max, swap, sort, reverse, lower_bound, upper_bound #include <bits/stdc++.h> // isupper, islower, isdigit, toupper, tolower #include <bitset> // bitset #include <cstdint> // int64_t, int*_t #include <cstdio> // printf #include <deque> // deque #include <iostream> ...
[["+", 15, 339, 51, 16, 31, 16, 31, 16, 31, 13], ["+", 15, 339, 51, 16, 31, 16, 31, 16, 17, 48], ["+", 15, 339, 51, 16, 31, 16, 31, 16, 12, 22], ["+", 0, 57, 15, 339, 51, 16, 31, 16, 17, 48], ["-", 8, 9, 0, 57, 15, 339, 51, 16, 17, 47], ["-", 8, 9, 0, 57, 15, 339, 51, 16, 12, 22], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 17...
1
247
N,M = map(int, input().split()) A = [int(N) for N in input().split()] list.sort(A, reverse = True) sum = 0 i = 0 while i != N: sum += A[i] i += 1 vote = sum / (4 * M) i = 0 while i != M: if A[i] <= vote: print("No") break i += 1 if i == M: print("Yes")
N,M = map(int, input().split()) A = [int(N) for N in input().split()] list.sort(A, reverse = True) sum = 0 i = 0 while i != N: sum += A[i] i += 1 vote = sum / (4 * M) i = 0 while i != M: if A[i] < vote: print("No") break i += 1 if i == M: print("Yes")
[["-", 0, 52, 8, 196, 0, 57, 15, 666, 667, 19], ["+", 0, 52, 8, 196, 0, 57, 15, 666, 667, 18]]
5
110
import math N, M = map(int, input().split()) AS = list(map(int, input().split())) cond = math.floor(sum(AS) / (4 * M)) AS = sorted(AS, reverse=True) origin = AS[0:M] result = list(filter(lambda a: a >= cond, origin)) if origin == result: print("Yes") else: print("No")
import math N, M = map(int, input().split()) AS = list(map(int, input().split())) cond = sum(AS) / (4 * M) AS = sorted(AS, reverse=True) origin = AS[0:M] result = list(filter(lambda a: a >= cond, origin)) if origin == result: print("Yes") else: print("No")
[["-", 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], ["-", 12, 652, 3, 4, 0, 657, 12, 23, 0, 25]]
5
105
N,M=map(int, input().split()) A=list(map(int, input().split())) s=sum(A) d=s//(4*M) count=0 i=0 while(i<N): if(A[i]>=d): count=count+1 i=i+1 if(count>=M): print("Yes") else: print("No")
N,M=map(int, input().split()) A=list(map(int, input().split())) s=sum(A) d=s/(4*M) count=0 i=0 while(i<N): if(A[i]>=d): count=count+1 i=i+1 if(count>=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
102
#include <bits/stdc++.h> using namespace std; int main() { ios::sync_with_stdio(0); cin.tie(0); int n, m; cin >> n >> m; int sum = 0; int ans = 0; vector<int> a(n); for (int i = 0; i < n; i++) { cin >> a[i]; sum += a[i]; } sort(a.begin(), a.end()); for (int i = n - 1; i >= (n - m); --i) ...
#include <bits/stdc++.h> using namespace std; int main() { ios::sync_with_stdio(0); cin.tie(0); double n, m; cin >> n >> m; double sum = 0; int ans = 0; vector<double> a(n); for (int i = 0; i < n; i++) { cin >> a[i]; sum += a[i]; } sort(a.begin(), a.end()); for (int i = n - 1; i >= (n - ...
[["-", 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
174
#include <bits/stdc++.h> using namespace std; int main() { int n, m; cin >> n >> m; int a[n], sum = 0, sum1 = 0; for (int i = 0; i < n; i++) { cin >> a[i]; sum = sum + a[i]; } double vote = double(sum / (4 * m)); for (int i = 0; i < n; i++) { if (a[i] >= vote) { sum1++; } } i...
#include <bits/stdc++.h> using namespace std; int main() { int n, m; cin >> n >> m; int a[n], sum = 0, sum1 = 0; for (int i = 0; i < n; i++) { cin >> a[i]; sum = sum + a[i]; } double vote = double(sum / double(4 * m)); for (int i = 0; i < n; i++) { if (a[i] >= vote) { sum1++; } ...
[["+", 51, 2, 3, 4, 0, 16, 12, 2, 63, 40]]
1
138
#include <algorithm> #include <iostream> using namespace std; int main() { int N, M, sum; cin >> N >> M; int *a = new int[N]; int i; sum = 0; for (i = 0; i < N; i++) { cin >> a[i]; sum += a[i]; } sort(a, a + N); if (a[N - M] * 4 * M > sum) { cout << "Yes" << endl; return 0; } else ...
#include <algorithm> #include <iostream> using namespace std; int main() { int N, M, sum; cin >> N >> M; int *a = new int[N]; int i; sum = 0; for (i = 0; i < N; i++) { cin >> a[i]; sum += a[i]; } sort(a, a + N); if (a[N - M] * 4 * M >= sum) { cout << "Yes" << endl; return 0; } else ...
[["-", 8, 9, 0, 57, 15, 339, 51, 16, 17, 47], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 17, 20]]
1
122
#include <algorithm> #include <iostream> using namespace std; bool ss(int a, int b) { return a > b; } int main() { int a[105]; int n, k; int s = 0; cin >> n >> k; for (int i = 0; i < n; i++) { cin >> a[i]; s += a[i]; } sort(a, a + n, ss); int flag = 1; for (int i = 0; i < k; i++) { if (a...
#include <algorithm> #include <iostream> using namespace std; bool ss(int a, int b) { return a > b; } int main() { int a[105]; int n, k; double s = 0; cin >> n >> k; for (int i = 0; i < n; i++) { cin >> a[i]; s += a[i]; } sort(a, a + n, ss); int flag = 1; for (int i = 0; i < k; i++) { if ...
[["-", 0, 30, 0, 14, 8, 9, 0, 43, 39, 40], ["+", 0, 30, 0, 14, 8, 9, 0, 43, 39, 40]]
1
152
#include <algorithm> #include <cmath> #include <iostream> #include <vector> using namespace std; int main() { int n, k; cin >> n >> k; int a[1005] = {0}; int sum = 0; for (int i = 1; i <= n; i++) cin >> a[i], sum += a[i]; sort(a + 1, a + n + 1); if (a[n - k + 1] >= ceil(sum / (4 * k))) cout << "Ye...
#include <algorithm> #include <cmath> #include <iostream> #include <vector> using namespace std; int main() { int n, k; cin >> n >> k; int a[1005] = {0}; int sum = 0; for (int i = 1; i <= n; i++) cin >> a[i], sum += a[i]; sort(a + 1, a + n + 1); if (a[n - k + 1] >= ceil(double(sum) / (4 * k))) cou...
[["+", 12, 2, 3, 4, 0, 16, 31, 2, 63, 40], ["+", 3, 4, 0, 16, 31, 2, 3, 4, 0, 24], ["+", 3, 4, 0, 16, 31, 2, 3, 4, 0, 25]]
1
123
#include <bits/stdc++.h> using namespace std; #define rep(i, n) for (int i = 0; i < (int)(n); i++) #define Rep(i, m, n) for (int i = m; i < (int)(n); i++) int main() { int N, M; cin >> N >> M; vector<int> price(N); int sum = 0; rep(i, N) { cin >> price.at(i); sum += price.at(i); } sort(price.begin...
#include <bits/stdc++.h> using namespace std; #define rep(i, n) for (int i = 0; i < (int)(n); i++) #define Rep(i, m, n) for (int i = m; i < (int)(n); i++) int main() { double N, M; cin >> N >> M; vector<double> price(N); double sum = 0; rep(i, N) { cin >> price.at(i); sum += price.at(i); } sort(pr...
[["-", 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], ["-", 51, 16, 12, 16, 12, 23, 0, 16, 31, 13], ["+", 51, 16, 12, 16, 12, 23, 0, 16, 31, 13]]
1
151
#include <bits/stdc++.h> using namespace std; // 型定義 typedef long long ll; typedef pair<ll, ll> P; // forループ #define REP(i, n) for (ll i = 0; i < (ll)(n); ++i) // 定数宣言 const int INF = 1e9; const int MOD = 1e9 + 7; const ll LINF = 1e18; // グラフ表現 using Graph = vector<vector<int>>; // グラフの辺表現 using Edge = map<pair<in...
#include <bits/stdc++.h> using namespace std; // 型定義 typedef long long ll; typedef pair<ll, ll> P; // forループ #define REP(i, n) for (ll i = 0; i < (ll)(n); ++i) // 定数宣言 const int INF = 1e9; const int MOD = 1e9 + 7; const ll LINF = 1e18; // グラフ表現 using Graph = vector<vector<int>>; // グラフの辺表現 using Edge = map<pair<in...
[["-", 8, 9, 0, 57, 15, 339, 51, 16, 17, 20], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 17, 47], ["+", 15, 339, 51, 16, 12, 16, 31, 23, 0, 24], ["+", 51, 16, 12, 16, 31, 23, 0, 16, 17, 33], ["+", 51, 16, 12, 16, 31, 23, 0, 16, 12, 13], ["+", 15, 339, 51, 16, 12, 16, 31, 23, 0, 25]]
1
318
N,M = map(int,input().split()) As = list(map(int,input().split())) As.sort(reverse=True) al = sum(As) ans = 'No' if al/(4*M)>As[M] else 'Yes' print(ans)
N,M = map(int,input().split()) As = list(map(int,input().split())) As.sort(reverse=True) al = sum(As) ans = 'No' if al/(4*M)>As[M-1] else 'Yes' print(ans)
[["+", 12, 41, 0, 666, 0, 206, 206, 657, 17, 33], ["+", 12, 41, 0, 666, 0, 206, 206, 657, 12, 612]]
5
73
#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[i]; } sort(A.begin(), A.end()); int ans = 0; for (int i = 0; i < n; i++) { ans += A[i]; } if (A[m - n] * 4 * m >= ans) cout << "Yes" << endl; e...
#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[i]; } sort(A.begin(), A.end()); int ans = 0; for (int i = 0; i < n; i++) { ans += A[i]; } if (A[n - m] * 4 * m >= ans) cout << "Yes" << endl; e...
[["-", 31, 16, 31, 69, 341, 342, 0, 16, 31, 22], ["-", 31, 16, 31, 69, 341, 342, 0, 16, 17, 33], ["+", 31, 16, 31, 69, 341, 342, 0, 16, 17, 33], ["+", 31, 16, 31, 69, 341, 342, 0, 16, 12, 22]]
1
130
#include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < (int)(n); i++) using namespace std; int main() { long int n, m; cin >> n >> m; vector<int> a(n); long int total = 0; rep(i, n) { cin >> a.at(i); total += a.at(i); } sort(a.begin(), a.end(), greater<long int>()); long int cVal = to...
#include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < (int)(n); i++) using namespace std; int main() { long int n, m; cin >> n >> m; vector<int> a(n); long int total = 0; rep(i, n) { cin >> a.at(i); total += a.at(i); } sort(a.begin(), a.end(), greater<long int>()); double cVal = (dou...
[["-", 0, 14, 8, 9, 0, 43, 39, 86, 0, 96], ["-", 0, 14, 8, 9, 0, 43, 39, 86, 39, 40], ["+", 0, 30, 0, 14, 8, 9, 0, 43, 39, 40], ["+", 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
148
#include <stdio.h> int num[128]; int quicksort(int left, int right) { int i, j, mid; i = left; j = right; mid = num[(left + right) >> 1]; while (i < j) { while (num[i] > mid) ++i; while (num[j] < mid) --j; if (i <= j) { int tmp; tmp = num[i]; num[i] = num[j]; ...
#include <stdio.h> int num[128]; int quicksort(int left, int right) { int i, j, mid; i = left; j = right; mid = num[(left + right) >> 1]; while (i < j) { while (num[i] > mid) ++i; while (num[j] < mid) --j; if (i <= j) { int tmp; tmp = num[i]; num[i] = num[j]; ...
[["-", 36, 36, 0, 30, 0, 9, 0, 43, 39, 40], ["+", 36, 36, 0, 30, 0, 9, 0, 43, 39, 40], ["-", 0, 11, 12, 16, 12, 23, 0, 16, 31, 13], ["+", 0, 11, 12, 16, 12, 23, 0, 16, 31, 13]]
0
286
#include <iostream> #include <math.h> using namespace std; int main() { int N, M; cin >> N >> M; int A[N]; int sumVote = 0; for (int i = 0; i < N; ++i) { cin >> A[i]; sumVote += A[i]; } int count = 0; double t = (double)sumVote / (4.0 * (double)M); for (int i = 0; i < N; ++i) { if (A...
#include <iostream> #include <math.h> using namespace std; int main() { int N, M; cin >> N >> M; int A[N]; int sumVote = 0; for (int i = 0; i < N; ++i) { cin >> A[i]; sumVote += A[i]; } int count = 0; double t = (double)sumVote / (4.0 * (double)M); for (int i = 0; i < N; ++i) { if (A...
[["-", 0, 57, 15, 339, 51, 16, 12, 2, 63, 22], ["+", 0, 57, 15, 339, 51, 16, 12, 2, 63, 22]]
1
152
n,m = list(map(int,input().split())) a = list(map(int,input().split())) output = "No" cnt = 0 for i in range(n - 1): if a[i] >= sum(a) * 1 / (4 * m): cnt += 1 if cnt >= m: output = "Yes" print(output)
n,m = list(map(int,input().split())) a = list(map(int,input().split())) output = "No" cnt = 0 for i in range(n): if a[i] >= sum(a) / (4 * m): cnt += 1 if cnt >= m: output = "Yes" print(output)
[["-", 0, 7, 12, 652, 3, 4, 0, 657, 17, 33], ["-", 0, 7, 12, 652, 3, 4, 0, 657, 12, 612], ["-", 0, 57, 15, 666, 0, 657, 31, 657, 17, 48], ["-", 0, 57, 15, 666, 0, 657, 31, 657, 12, 612]]
5
90
n,m = map(int, input().split()) a = list(map(int, input().split())) sa = sorted(a) sum=0 for i in range(n): sum += a[i] t = sum / (4*m) if sa[n-1-m] < t: print("No") else: print("Yes")
n,m = map(int, input().split()) a = list(map(int, input().split())) sa = sorted(a) sum=0 for i in range(n): sum += a[i] t = sum / (4*m) if sa[n-m] < t: print("No") else: print("Yes")
[["-", 15, 666, 0, 206, 206, 657, 31, 657, 12, 612], ["-", 0, 57, 15, 666, 0, 206, 206, 657, 17, 33]]
5
91
n,m = map(int,input().split()) a = list(map(int,input().split())) a_sum = sum(a) list.sort(a,reverse=True) judge = 1 for i in range(m): if a[i]<= a_sum*1/(m*4): judge = 0 break if judge == 0: print('No') else: print('Yes')
n,m = map(int,input().split()) a = list(map(int,input().split())) a_sum = sum(a) list.sort(a,reverse=True) judge = 1 for i in range(m): if a[i]< a_sum*1/(m*4): judge = 0 break if judge == 0: print('No') else: print('Yes')
[["-", 0, 7, 8, 196, 0, 57, 15, 666, 667, 19], ["+", 0, 7, 8, 196, 0, 57, 15, 666, 667, 18]]
5
99
n, m = map(int, input().split()) list_vote = list(map(int, input().split())) list_vote_copy = list_vote[:] total_votes = sum(list_vote) check = (total_votes / (4 * m)) count = 0 for ele in list_vote_copy: if ele > check: count += 1 if count >= m: print("Yes") else: print("No")
n, m = map(int, input().split()) list_vote = list(map(int, input().split())) list_vote_copy = list_vote[:] total_votes = sum(list_vote) check = (total_votes / (4 * m)) count = 0 for ele in list_vote_copy: if ele >= check: count += 1 if 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
91
N, M = map(int, input().split()) A = sorted(map(int, input().split()), reverse=True) if sum(A)/(4*M) > A[M-1]: print("No") print("Yes")
N, M = map(int, input().split()) A = sorted(map(int, input().split()), reverse=True) if sum(A)/(4*M) > A[M-1]: print("No") else: print("Yes")
[["+", 36, 36, 0, 656, 0, 57, 75, 76, 0, 95], ["+", 36, 36, 0, 656, 0, 57, 75, 76, 0, 102]]
5
68
n,m =map(int, input().split()) A = list(map(int, input().split())) total = sum(A) border = total // (4*m) count = 0 for i in range(n): if A[i] >= border: count += 1 ans = "Yes" if count < m: ans = "No" print(ans)
n,m =map(int, input().split()) A = list(map(int, input().split())) total = sum(A) border = total / (4*m) count = 0 for i in range(n): if A[i] >= border: count += 1 ans = "Yes" if count < m: ans = "No" print(ans)
[["-", 0, 656, 0, 1, 0, 662, 12, 657, 17, 676], ["+", 0, 656, 0, 1, 0, 662, 12, 657, 17, 85]]
5
89
#include <bits/stdc++.h> using namespace std; int main() { int n, m, sum = 0, count = 0; cin >> n >> m; double level = 1.0 / (4.0 * m); vector<int> goods(n); for (int i = 0; i < n; i++) { cin >> goods.at(i); sum += goods.at(i); } for (int i = 0; i < n; i++) { if (goods.at(i) > (double)sum * ...
#include <bits/stdc++.h> using namespace std; int main() { int n, m, sum = 0, count = 0; cin >> n >> m; double level = 1.0 / (4.0 * m); vector<int> goods(n); for (int i = 0; i < n; i++) { cin >> goods.at(i); sum += goods.at(i); } for (int i = 0; i < n; i++) { if (goods.at(i) >= (double)sum *...
[["-", 8, 9, 0, 57, 15, 339, 51, 16, 17, 47], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 17, 20]]
1
143
N,M = [int(i) for i in input().split()] AList = [int(i) for i in input().split()] H = sum(AList)/(4*M) S =0 for A in AList: if A> H: S = S + 1 if S >= M: print('Yes') else: print('No')
N,M = [int(i) for i in input().split()] AList = [int(i) for i in input().split()] H = sum(AList)/(4*M) S =0 for A in AList: if A>= H: S = 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
87
#include <algorithm> #include <cmath> #include <iostream> using namespace std; int m, n, a[109], tot; int main() { cin >> n >> m; for (int i = 0; i < n; i++) cin >> a[i], tot += a[i]; sort(a, a + n); if (a[n - m] < ceil(m * tot / 4)) cout << "No"; else cout << "Yes"; return 0; }
#include <algorithm> #include <cmath> #include <iostream> using namespace std; int m, n, a[109], tot; int main() { cin >> n >> m; for (int i = 0; i < n; i++) cin >> a[i], tot += a[i]; sort(a, a + n); if (a[n - m] < ceil((long double)tot / m / 4)) cout << "No"; else cout << "Yes"; return 0; }
[["-", 12, 2, 3, 4, 0, 16, 31, 16, 31, 22], ["-", 12, 2, 3, 4, 0, 16, 31, 16, 17, 48], ["+", 3, 4, 0, 16, 31, 16, 31, 74, 0, 24], ["+", 31, 16, 31, 74, 39, 77, 39, 86, 0, 96], ["+", 31, 16, 31, 74, 39, 77, 39, 86, 39, 40], ["+", 3, 4, 0, 16, 31, 16, 31, 74, 0, 25], ["+", 12, 2, 3, 4, 0, 16, 31, 16, 17, 85], ["+", 12, 2...
1
105
#include <algorithm> #include <iomanip> #include <iostream> #include <math.h> #include <queue> #include <stdio.h> #include <string.h> #include <vector> #define mod 1000000007 #define ll long long #define pi acos(-1) using namespace std; const double INF = 1e20; int main() { ios::sync_with_stdio(false); double m, n...
#include <algorithm> #include <iomanip> #include <iostream> #include <math.h> #include <queue> #include <stdio.h> #include <string.h> #include <vector> #define mod 1000000007 #define ll long long #define pi acos(-1) using namespace std; const double INF = 1e20; int main() { ios::sync_with_stdio(false); double m, n...
[["-", 8, 9, 0, 57, 15, 339, 51, 16, 17, 47], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 17, 20]]
1
163
import sys n, m = map(int, input().split()) l = [int(x) for x in input().split()] cnt = 0 for i in l: if i < int(sum(l)*1/(4*m)): cnt += 1 if cnt > len(l)-m: print("No") sys.exit() print("Yes")
import sys n, m = map(int, input().split()) l = [int(x) for x in input().split()] cnt = 0 for i in l: if float(i) < float(sum(l)*1/(4*m)): cnt += 1 if cnt > len(l)-m: print("No") sys.exit() print("Yes")
[["+", 8, 196, 0, 57, 15, 666, 0, 652, 63, 22], ["+", 0, 57, 15, 666, 0, 652, 3, 4, 0, 24], ["+", 0, 57, 15, 666, 0, 652, 3, 4, 0, 25], ["-", 8, 196, 0, 57, 15, 666, 0, 652, 63, 22]]
5
93
#include <bits/stdc++.h> using namespace std; typedef long long lint; #define RPT(i, b, e) for (int i = (b); i <= (e); i++) #define RPT0(i, n) RPT(i, 0, n - 1) #define RPT1(i, n) RPT(i, 1, n) #define EACH(it, v) for (const auto &it : v) #define ALL(v) v.begin(), v.end() void resolve() { int N, M; cin >> N >> M; ...
#include <bits/stdc++.h> using namespace std; typedef long long lint; #define RPT(i, b, e) for (int i = (b); i <= (e); i++) #define RPT0(i, n) RPT(i, 0, n - 1) #define RPT1(i, n) RPT(i, 1, n) #define EACH(it, v) for (const auto &it : v) #define ALL(v) v.begin(), v.end() void resolve() { int N, M; cin >> N >> M; ...
[["-", 49, 50, 51, 16, 12, 23, 0, 16, 31, 13], ["+", 49, 50, 51, 16, 12, 23, 0, 16, 31, 13], ["+", 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], ["-", 49, 50, 51, 41, 15, 23, 0, 16, 17, 47], ["+", 49, 50, 51, 41, 15, 23, 0, 16, 17, 20]]
1
188
import numpy as np input_str = input() N, M = list(map(lambda x: int(x), input_str.split(' '))) input_str = input() input_list = np.array(list(map(lambda x: int(x), input_str.split(' ')))) A_sum = np.sum(input_list) count = np.count_nonzero(input_list > A_sum / (4*M)) print('Yes' if count > M else 'No')
import numpy as np input_str = input() N, M = list(map(lambda x: int(x), input_str.split(' '))) input_str = input() input_list = np.array(list(map(lambda x: int(x), input_str.split(' ')))) A_sum = np.sum(input_list) count = np.count_nonzero(input_list >= A_sum / (4*M)) print('Yes' if count >= M else 'No')
[["-", 0, 662, 12, 652, 3, 4, 0, 666, 667, 47], ["+", 0, 662, 12, 652, 3, 4, 0, 666, 667, 20], ["-", 0, 652, 3, 4, 0, 41, 0, 666, 667, 47], ["+", 0, 652, 3, 4, 0, 41, 0, 666, 667, 20]]
5
107
#include <bits/stdc++.h> using namespace std; typedef long long ll; typedef pair<int, int> P; void printVec(std::vector<int> &vec) { std::cout << ""; for (auto it = vec.begin(); it != vec.end(); ++it) { std::cout << *it << " "; } std::cout << std::endl; } int main() { int n, m; cin >> n >> m; vecto...
#include <bits/stdc++.h> using namespace std; typedef long long ll; typedef pair<int, int> P; void printVec(std::vector<int> &vec) { std::cout << ""; for (auto it = vec.begin(); it != vec.end(); ++it) { std::cout << *it << " "; } std::cout << std::endl; } int main() { int n, m; cin >> n >> m; vecto...
[["+", 15, 339, 51, 16, 31, 16, 31, 16, 17, 48], ["+", 15, 339, 51, 16, 31, 16, 31, 16, 12, 22], ["+", 0, 57, 15, 339, 51, 16, 31, 16, 17, 48], ["+", 0, 57, 15, 339, 51, 16, 31, 16, 12, 13], ["-", 8, 9, 0, 57, 15, 339, 51, 16, 12, 22], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 12, 22]]
1
241
#pragma GCC optimize("-O3") #pragma GCC optimize("unroll-loops") #include <bits/stdc++.h> // #include <boost/multiprecision/cpp_int.hpp> #include <ext/pb_ds/assoc_container.hpp> #include <ext/pb_ds/detail/standard_policies.hpp> #include <ext/pb_ds/tree_policy.hpp> #define vl vector<ll> #define pb push_back #define el '...
#pragma GCC optimize("-O3") #pragma GCC optimize("unroll-loops") #include <bits/stdc++.h> // #include <boost/multiprecision/cpp_int.hpp> #include <ext/pb_ds/assoc_container.hpp> #include <ext/pb_ds/detail/standard_policies.hpp> #include <ext/pb_ds/tree_policy.hpp> #define vl vector<ll> #define pb push_back #define el '...
[["-", 0, 14, 8, 9, 0, 9, 0, 43, 39, 40], ["+", 8, 9, 0, 9, 0, 43, 39, 86, 0, 96], ["+", 8, 9, 0, 9, 0, 43, 39, 86, 39, 40], ["+", 0, 43, 49, 50, 51, 16, 31, 74, 0, 24], ["+", 51, 16, 31, 74, 39, 77, 39, 86, 0, 96], ["+", 51, 16, 31, 74, 39, 77, 39, 86, 39, 40], ["+", 0, 43, 49, 50, 51, 16, 31, 74, 0, 25]]
1
273
#include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < (n); i++) #define rep1(i, n) for (int i = 1; i < (n); i++) #define erep(i, n) for (int i = 0; i <= (n); i++) #define erep1(i, n) for (int i = 1; i <= (n); i++) using namespace std; using ll = long long; int main() { int n, m; cin >> n >> m; vector<in...
#include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < (n); i++) #define rep1(i, n) for (int i = 1; i < (n); i++) #define erep(i, n) for (int i = 0; i <= (n); i++) #define erep1(i, n) for (int i = 1; i <= (n); i++) using namespace std; using ll = long long; int main() { int n, m; cin >> n >> m; vector<do...
[["-", 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
160
n, m = map(int, input().split()) a = [int(i) for i in input().split(" ")] s = sum(a) c = s//(4*m) ans = [i for i in a if i >= c] if len(ans) >= m: print("Yes") else: print("No")
n, m = map(int, input().split()) a = [int(i) for i in input().split(" ")] s = sum(a) c = s/(4*m) ans = [1 for i in a if i >= c] if len(ans) >= 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], ["-", 0, 656, 0, 1, 0, 662, 12, 658, 8, 22], ["+", 0, 656, 0, 1, 0, 662, 12, 658, 8, 612]]
5
87
#include <bits/stdc++.h> #include <cfloat> #include <climits> #include <iomanip> #include <iostream> #include <math.h> #include <numeric> #include <stdio.h> #include <string> #include <unordered_map> using namespace std; int main() { long long int m, n; cin >> n >> m; vector<long long int> a(n); long long int ...
#include <bits/stdc++.h> #include <cfloat> #include <climits> #include <iomanip> #include <iostream> #include <math.h> #include <numeric> #include <stdio.h> #include <string> #include <unordered_map> using namespace std; int main() { long long int m, n; cin >> n >> m; vector<long long int> a(n); long long int ...
[["-", 8, 9, 0, 57, 15, 339, 51, 16, 17, 47], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 17, 20]]
1
177
#include <bits/stdc++.h> using namespace std; int main() { int N, M; std::cin >> N >> M; bool result = true; int count = 0; vector<int> A(N); for (size_t i = 0; i < N; i++) { std::cin >> A[i]; count += A[i]; } std::sort(A.begin(), A.end()); for (size_t i = 0; i < M; i++) { double a; a ...
#include <bits/stdc++.h> using namespace std; int main() { double N, M; std::cin >> N >> M; bool result = true; double count = 0; vector<int> A(N); for (size_t i = 0; i < N; i++) { std::cin >> A[i]; count += A[i]; } std::sort(A.begin(), A.end()); for (size_t i = 0; i < M; i++) { double a; ...
[["-", 0, 30, 0, 14, 8, 9, 0, 43, 39, 40], ["+", 0, 30, 0, 14, 8, 9, 0, 43, 39, 40]]
1
174
#include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < (n); ++i) using namespace std; using ll = long long; int main() { int n, m; cin >> n >> m; vector<int> p(n); rep(i, n) cin >> p[i]; int sum = 0; rep(i, n) sum += p[i]; int count = 0; rep(i, n) if (p[i] * 4 * m > sum) count++; if (count >=...
#include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < (n); ++i) using namespace std; using ll = long long; int main() { int n, m; cin >> n >> m; vector<int> p(n); rep(i, n) cin >> p[i]; int sum = 0; rep(i, n) sum += p[i]; int count = 0; rep(i, n) if (p[i] * 4 * m >= sum) count++; if (count >...
[["-", 8, 9, 0, 57, 15, 339, 51, 16, 17, 47], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 17, 20]]
1
132
// // Created on 2020/04/04. // //#include <bits/stdc++.h> #include <algorithm> // min, max, swap, sort, reverse, lower_bound, upper_bound #include <bitset> // bitset #include <cctype> // isupper, islower, isdigit, toupper, tolower #include <cstdint> // int64_t, int*_t #include <cstdio> // printf #include <...
// // Created on 2020/04/04. // //#include <bits/stdc++.h> #include <algorithm> // min, max, swap, sort, reverse, lower_bound, upper_bound #include <bitset> // bitset #include <cctype> // isupper, islower, isdigit, toupper, tolower #include <cstdint> // int64_t, int*_t #include <cstdio> // printf #include <...
[["-", 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], ["-", 0, 43, 39, 344, 3, 347, 0, 77, 39, 40], ["+", 0, 43, 39, 344, 3, 347, 0, 77, 39, 40], ["-", 0, 14, 8, 9, 0, 7, 10, 43, 39, 40], ["+", 0, 14, 8, 9, ...
1
224
#include <iostream> using namespace std; int main() { int n, m, votes = 0; cin >> n >> m; int arr[n]; for (int i = 0; i < n; i++) { cin >> arr[i]; votes += arr[i]; } float bar = 1.0 * (0.25 * votes) / m; for (int i = 0; i < n; i++) { if (arr[i] >= bar) m--; } if (m <= 0) cout <...
#include <iostream> using namespace std; int main() { int n, m, votes = 0; cin >> n >> m; int arr[n]; for (int i = 0; i < n; i++) { cin >> arr[i]; votes += arr[i]; } float bar = 1.0 * (0.25 * votes) / m; for (int i = 0; i < n; i++) { if (arr[i] >= bar) m--; } if (m <= 0) cout <...
[["-", 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
127
#include <algorithm> #include <cmath> #include <cstdio> #include <cstdlib> #include <cstring> #include <deque> #include <iomanip> #include <iostream> #include <list> #include <map> #include <math.h> #include <queue> #include <set> #include <stack> #include <stdio.h> #include <string.h> #include <string> #include <utili...
#include <algorithm> #include <cmath> #include <cstdio> #include <cstdlib> #include <cstring> #include <deque> #include <iomanip> #include <iostream> #include <list> #include <map> #include <math.h> #include <queue> #include <set> #include <stack> #include <stdio.h> #include <string.h> #include <string> #include <utili...
[["-", 0, 1, 0, 16, 31, 16, 12, 5, 0, 6], ["+", 0, 1, 0, 16, 31, 16, 12, 5, 0, 6]]
1
709
n, m = map(int, input().split()) alis = list(map(int, input().split())) func = lambda x : x > (sum(alis)/(4*m)) anslis = list(map(func, alis)) if anslis.count(True) >= m: print('Yes') else: print('No')
n, m = map(int, input().split()) alis = list(map(int, input().split())) func = lambda x : x >= (sum(alis)/(4*m)) anslis = list(map(func, alis)) if anslis.count(True) >= m: print('Yes') else: print('No')
[["-", 0, 1, 0, 662, 12, 670, 8, 666, 667, 47], ["+", 0, 1, 0, 662, 12, 670, 8, 666, 667, 20]]
5
87
N,M= map(int, input().split()) a = list(map(int,input().split())) b = sorted(a,reverse = True) total = 0 for i in range(len(b)): total += b[i] if b[M]<total/(4*M): print("No") else: print("Yes")
N,M= map(int, input().split()) a = list(map(int,input().split())) b = sorted(a,reverse = True) total = 0 for i in range(len(b)): total += b[i] if b[M-1]<total/(4*M): print("No") else: print("Yes")
[["+", 0, 57, 15, 666, 0, 206, 206, 657, 17, 33], ["+", 0, 57, 15, 666, 0, 206, 206, 657, 12, 612]]
5
91
N,M = map(int, input().split()) A = list(map(int, input().split())) sum_A = sum(A) cout = 0 flag = False for i in range(N): if A[i] >= sum_A // (4 * M): cout += 1 if cout > M: flag = True break if flag: print('Yes') else: print('No')
N,M = map(int, input().split()) A = list(map(float, input().split())) sum_A = sum(A) cout = 0 flag = False for i in range(N): if A[i] >= sum_A / (4 * M): cout += 1 if cout >= M: flag = True break if flag: print('Yes') else: print('No')
[["-", 12, 652, 3, 4, 0, 652, 3, 4, 0, 22], ["+", 12, 652, 3, 4, 0, 652, 3, 4, 0, 22], ["-", 8, 196, 0, 57, 15, 666, 0, 657, 17, 676], ["+", 8, 196, 0, 57, 15, 666, 0, 657, 17, 85], ["-", 0, 57, 64, 196, 0, 57, 15, 666, 667, 47], ["+", 0, 57, 64, 196, 0, 57, 15, 666, 667, 20]]
5
96
#include <bits/stdc++.h> using namespace std; int main() { int n, m, all = 0, ans = 0; double can; cin >> n >> m; vector<int> a(n); for (int i = 0; i < n; i++) { cin >> a[i]; all += a[i]; } can = all / (4 * m); for (int i = 0; i < n; i++) { if (a[i] > can) ans++; } if (ans >= m) ...
#include <bits/stdc++.h> using namespace std; int main() { int n, m, all = 0, ans = 0; double can; cin >> n >> m; vector<int> a(n); for (int i = 0; i < n; i++) { cin >> a[i]; all += a[i]; } can = all / (4.0 * m); for (int i = 0; i < n; i++) { if (!(a[i] < can)) ans++; } if (ans >=...
[["-", 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, 339, 51, 91, 17, 111], ["+", 0, 57, 15, 339, 51, 91, 28, 23, 0, 24], ["-", 8, 9, 0, 57, 15, 339, 51, 16, 17, 47], ["+", 15, 339, 51, 91, 28, 23, 0, 16, 17, 18], ["+", 0, 57, 15, 339, 51, 91, 28, 23, 0, 25]]
1
134
#include <iostream> #include <vector> bool judge(int m, int total, int a) { return (a >= total / 4 / m); } int main() { int n, m; std::vector<int> a; std::cin >> n >> m; a.resize(n); int total = 0; for (int i = 0; i < n; ++i) { std::cin >> a[i]; total += a[i]; } int selectable = 0; for (i...
#include <iostream> #include <vector> bool judge(int m, int total, int a) { return (a >= (double)total / 4 / m); } int main() { int n, m; std::vector<int> a; std::cin >> n >> m; a.resize(n); int total = 0; for (int i = 0; i < n; ++i) { std::cin >> a[i]; total += a[i]; } int selectable = 0; ...
[["+", 0, 16, 12, 16, 31, 16, 31, 74, 0, 24], ["+", 12, 16, 31, 16, 31, 74, 39, 77, 39, 40], ["+", 0, 16, 12, 16, 31, 16, 31, 74, 0, 25]]
1
178
n,m = map(int,input().split()) line = sorted(list(map(int,input().split())),reverse = True) sums = sum(line) if sums % (4*m) != 0: least = sums//(4*m) else: least = sums//(4*m) + 1 box = [] for i in line: if i > least: box.append(i) if len(box) >= m: print("Yes") else: print("No")
n,m = map(int,input().split()) line = sorted(list(map(int,input().split())),reverse = True) sums = sum(line) if sums % (4*m) != 0: least = sums//(4*m) + 1 else: least = sums//(4*m) box = [] for i in line: if i >= least: box.append(i) if len(box) >= m: print("Yes") else: print("No")
[["+", 64, 196, 0, 1, 0, 662, 12, 657, 17, 72], ["+", 64, 196, 0, 1, 0, 662, 12, 657, 12, 612], ["-", 8, 196, 0, 1, 0, 662, 12, 657, 17, 72], ["-", 8, 196, 0, 1, 0, 662, 12, 657, 12, 612], ["-", 0, 7, 8, 196, 0, 57, 15, 666, 667, 47], ["+", 0, 7, 8, 196, 0, 57, 15, 666, 667, 20]]
5
121
#include <algorithm> #include <iostream> #include <stdio.h> #include <string.h> int a[1005]; using namespace std; int main() { int n, m; int sum = 0; cin >> n >> m; for (int i = 0; i < n; i++) { scanf("%d", a + i); sum += a[i]; } sort(a, a + n, greater<int>()); int time = 0; for (int i = 0; i <...
#include <algorithm> #include <iostream> #include <stdio.h> #include <string.h> int a[1005]; using namespace std; int main() { int n, m; int sum = 0; cin >> n >> m; for (int i = 0; i < n; i++) { scanf("%d", a + i); sum += a[i]; } sort(a, a + n, greater<int>()); int time = 0; for (int i = 0; i <...
[["+", 15, 339, 51, 16, 12, 16, 12, 2, 63, 40]]
1
150
n, m = map(int, input().split()) a = list(map(int, input().split())) a.sort(reverse = True) t = sum(a) p = 0 for i in range(n): if a[i] >= t/(4*m): p += 1 else: break if p > m: print('Yes') else: print('No')
n, m = map(int, input().split()) a = list(map(int, input().split())) a.sort(reverse = True) t = sum(a) p = 0 for i in range(n): if a[i] >= t/(4*m): p += 1 else: break if p >= 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
97
n,m = map(int, input().split()) a = list(map(int, input().split())) count = 0 for i in range(n): if a[i] > (1/4)*(1/m)*sum(a): count += 1 if count >= m: print("Yes") else: print("No")
n,m = map(int, input().split()) a = list(map(float, input().split())) count = 0 for i in range(n): if a[i] >= (1.0/4)*(1.0/m)*sum(a): count += 1 if count >= m: print("Yes") else: print("No")
[["-", 12, 652, 3, 4, 0, 652, 3, 4, 0, 22], ["+", 12, 652, 3, 4, 0, 652, 3, 4, 0, 22], ["-", 0, 7, 8, 196, 0, 57, 15, 666, 667, 47], ["+", 0, 7, 8, 196, 0, 57, 15, 666, 667, 20], ["-", 0, 657, 31, 657, 31, 23, 0, 657, 31, 612], ["+", 0, 657, 31, 657, 31, 23, 0, 657, 31, 531], ["-", 0, 657, 31, 657, 12, 23, 0, 657, 31, ...
5
89
#include <iostream> #include <vector> int main(void) { int n, m; int popular_items = 0; int sum = 0; std::vector<int> a; std::cin >> n >> m; a.resize(n); for (int i = 0; i < n; i++) { std::cin >> a[i]; sum += a[i]; } for (int i = 0; i < n; i++) { if (m > 0 && a[i] >= (sum / (4 * m))) {...
#include <iostream> #include <vector> int main(void) { int n, m; int popular_items = 0; int sum = 0; std::vector<int> a; std::cin >> n >> m; a.resize(n); for (int i = 0; i < n; i++) { std::cin >> a[i]; sum += a[i]; } for (int i = 0; i < n; i++) { if (m > 0 && a[i] >= ((double)sum / (4 ...
[["+", 12, 16, 12, 23, 0, 16, 31, 74, 0, 24], ["+", 12, 23, 0, 16, 31, 74, 39, 77, 39, 40], ["+", 12, 16, 12, 23, 0, 16, 31, 74, 0, 25], ["-", 0, 57, 15, 339, 51, 16, 12, 16, 17, 60], ["+", 0, 57, 15, 339, 51, 16, 12, 16, 17, 20]]
1
165
#include <algorithm> #include <iostream> #include <map> #include <stdio.h> using namespace std; int main() { int n, m; cin >> n >> m; int a[n]; int max = 0; for (int i = 0; i < n; i++) { cin >> a[i]; max += a[i]; } sort(a, a + n); double c = max / 4 / m; if (a[n - m] >= c) { cout <...
#include <algorithm> #include <iostream> #include <map> #include <stdio.h> using namespace std; int main() { int n, m; cin >> n >> m; int a[n]; int max = 0; for (int i = 0; i < n; i++) { cin >> a[i]; max += a[i]; } sort(a, a + n); double c = max / 4.0 / m; if (a[n - m] >= c) { cout...
[["-", 0, 43, 49, 50, 51, 16, 31, 16, 12, 13], ["+", 0, 43, 49, 50, 51, 16, 31, 16, 12, 13]]
1
123
#include <stdio.h> int main() { int n, m, a[100], cou = 0, sum = 0; scanf("%d%d", &n, &m); 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)) { cou++; } } printf("%s\n", m <= cou ? "Yes" : "No"); return 0; }
#include <stdio.h> int main() { int n, m, a[100], cou = 0, sum = 0; scanf("%d%d", &n, &m); 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)) { cou++; } } printf("%s\n", m <= cou ? "Yes" : "No"); return ...
[["+", 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
134
#include <bits/stdc++.h> using namespace std; int main() { int n, m; cin >> n >> m; vector<int> item; int all = 0; for (int i = 0, temp; i < n; ++i) { cin >> temp; all += temp; item.push_back(temp); } // cout << all << endl; sort(item.begin(), item.end(), greater<>()); int minimum = all / ...
#include <bits/stdc++.h> using namespace std; int main() { int n, m; cin >> n >> m; vector<int> item; int all = 0; for (int i = 0, temp; i < n; ++i) { cin >> temp; all += temp; item.push_back(temp); } sort(item.begin(), item.end(), greater<>()); double minimum = all / 4.0 / m; string ans; ...
[["-", 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], ["-", 0, 1, 0, 11, 12, 41, 15, 16, 17, 18], ["+", 0, 1, 0, 11, 12, 41, 15, 16, 17, 19]]
1
126
#include <bits/stdc++.h> using namespace std; #define rep(i, n) for (int i = 0; i < (n); i++) typedef long long ll; typedef pair<ll, ll> P; #define ALL(v) v.begin(), v.end() const int MOD = 1000000007; const int MAX = 5100000; ll gcd(ll a, ll b) { return (b == 0) ? a : gcd(b, a % b); } ll fac[MAX], finv[MAX], inv[MAX...
#include <bits/stdc++.h> using namespace std; #define rep(i, n) for (int i = 0; i < (n); i++) typedef long long ll; typedef pair<ll, ll> P; #define ALL(v) v.begin(), v.end() const int MOD = 1000000007; const int MAX = 5100000; ll gcd(ll a, ll b) { return (b == 0) ? a : gcd(b, a % b); } ll fac[MAX], finv[MAX], inv[MAX...
[["-", 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, 2, 63, 22], ["+", 15, 339, 51, 16, 12, 2, 3, 4, 0, 24], ["+", 12, 2, 3, 4, 0, 16, 12, 23, 0, 25]]
1
1,413
#include <bits/stdc++.h> using namespace std; typedef long long ll; typedef unsigned long long ull; int main() { ios::sync_with_stdio(0); cin.tie(0); int n, m; cin >> n >> m; int a[n + 1], cnt = 0, sum = 0; for (int i = 1; i <= n; i++) { cin >> a[i]; sum += a[i]; } for (int i = 1; i <= n; i++...
#include <bits/stdc++.h> using namespace std; typedef long long ll; typedef unsigned long long ull; int main() { ios::sync_with_stdio(0); cin.tie(0); int n, m; cin >> n >> m; int a[n + 1], cnt = 0, sum = 0; for (int i = 1; i <= n; i++) { cin >> a[i]; sum += a[i]; } for (int i = 1; i <= n; i++...
[["-", 8, 9, 0, 57, 15, 339, 51, 16, 17, 47], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 17, 20]]
1
159
#include <bits/stdc++.h> using namespace std; int main() { int N, M; cin >> N >> M; vector<int> popular(N); for (int i = 0; i < N; i++) { cin >> popular.at(i); } int sum = 0; for (int i = 0; i < N; i++) { sum += popular.at(i); } int a = 4 * M; int tokuhyo = sum / a; int count = 0; for ...
#include <bits/stdc++.h> using namespace std; int main() { int N, M; cin >> N >> M; vector<int> popular(N); for (int i = 0; i < N; i++) { cin >> popular.at(i); } int sum = 0; for (int i = 0; i < N; i++) { sum += popular.at(i); } double a = 4 * M; double tokuhyo = sum / a; int count = 0; ...
[["-", 0, 30, 0, 14, 8, 9, 0, 43, 39, 40], ["+", 0, 30, 0, 14, 8, 9, 0, 43, 39, 40]]
1
165
INPUT = input().split() N = int(INPUT[0]) M = int(INPUT[1]) score_list = input().split() score_list_int = [int(n) for n in score_list] border = sum(score_list_int)/4/M answer = "yes" for i in score_list_int: if i < border: N -= 1 if N < M: answer = "no" print(answer)
INPUT = input().split() N = int(INPUT[0]) M = int(INPUT[1]) score_list = input().split() score_list_int = [int(n) for n in score_list] border = sum(score_list_int)/4/M answer = "Yes" for i in score_list_int: if i < border: N -= 1 if N < M: answer = "No" print(answer)
[["-", 0, 656, 0, 1, 0, 662, 12, 557, 0, 6], ["+", 0, 656, 0, 1, 0, 662, 12, 557, 0, 6], ["-", 64, 196, 0, 1, 0, 662, 12, 557, 0, 6], ["+", 64, 196, 0, 1, 0, 662, 12, 557, 0, 6]]
5
90