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; using ll = long long; using ld = long double; using p = pair<int, int>; using Graph = vector<vector<int>>; #define rep(i, n) for (int i = 0; i < n; i++) int dx[4]{-1, 0, 1, 0}; int dy[4]{0, 1, 0, -1}; int main() { int N, M; cin >> N >> M; vector<int> Item(N); doub...
#include <bits/stdc++.h> using namespace std; using ll = long long; using ld = long double; using p = pair<int, int>; using Graph = vector<vector<int>>; #define rep(i, n) for (int i = 0; i < n; i++) int dx[4]{-1, 0, 1, 0}; int dy[4]{0, 1, 0, -1}; int main() { int N, M; cin >> N >> M; vector<int> Item(N); doub...
[["-", 0, 14, 8, 9, 0, 43, 39, 86, 0, 96], ["+", 0, 30, 0, 14, 8, 9, 0, 43, 39, 40], ["-", 8, 9, 0, 43, 49, 50, 51, 2, 63, 22]]
1
209
def main(): N, M = [int(_) for _ in input().split()] slist = list(map(int, input().split())) sort_list = sorted(slist) thr = sum(sort_list) / (4 * M) cnt = 0 for i in sort_list: if i > thr: cnt += 1 if cnt >= M: print("Yes") else: print("No") m...
def main(): N, M = [int(_) for _ in input().split()] slist = list(map(int, input().split())) sort_list = sorted(slist) thr = sum(sort_list) / (4 * M) cnt = 0 for i in sort_list: if i >= thr: cnt += 1 if cnt >= 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
98
#include <iostream> using namespace std; int main() { int n, m; cin >> n >> m; long s = 0; int arr[n]; for (int i = 0; i < n; i++) { cin >> arr[i]; s += arr[i]; } int count = 0, p = 1; float f = s / (4.0 * m); for (int i = 0; i < n; i++) { if (arr[i] > f) { count++; } if (co...
#include <iostream> using namespace std; int main() { int n, m; cin >> n >> m; long s = 0; int arr[n]; for (int i = 0; i < n; i++) { cin >> arr[i]; s += arr[i]; } int count = 0, p = 1; float f = s / (4.0 * m); for (int i = 0; i < n; i++) { if (arr[i] >= f) { count++; } if (c...
[["-", 8, 9, 0, 57, 15, 339, 51, 16, 17, 47], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 17, 20]]
1
146
#include <stdio.h> #include <stdlib.h> int main() { int n, m, i, num; float s; scanf("%d %d", &n, &m); num = 0; s = 0.0; int a[n]; for (i = 0; i < n; i++) { scanf("%d", &a[i]); s += a[i]; } s = s / 4.0 * m; for (i = 0; i < n; i++) { if (a[i] >= s) num++; if (num == m) ...
#include <stdio.h> #include <stdlib.h> int main() { int n, m, i, num; float s; scanf("%d %d", &n, &m); num = 0; s = 0.0; int a[n]; for (i = 0; i < n; i++) { scanf("%d", &a[i]); s += a[i]; } s /= 4.0 * (float)m; for (i = 0; i < n; i++) { if (a[i] >= s) num++; if (num ==...
[["-", 0, 14, 8, 9, 0, 1, 0, 11, 17, 32], ["-", 0, 1, 0, 11, 12, 16, 31, 16, 31, 22], ["-", 0, 1, 0, 11, 12, 16, 31, 16, 17, 85], ["+", 0, 14, 8, 9, 0, 1, 0, 11, 17, 90], ["+", 0, 1, 0, 11, 12, 16, 12, 74, 0, 24], ["+", 0, 11, 12, 16, 12, 74, 39, 77, 39, 40], ["+", 0, 1, 0, 11, 12, 16, 12, 74, 0, 25]]
0
150
#include <bits/stdc++.h> using namespace std; int main() { int N, M; cin >> N >> M; vector<int> A(N); long long 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)) continue; else count += 1...
#include <bits/stdc++.h> using namespace std; int main() { int N, M; cin >> N >> M; vector<int> A(N); long long 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 ((double)A[i] < (double)sum / (4 * M)) continue; else ...
[["+", 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
141
N,M=map(int,input().split()) A=list(map(int,input().split())) A.sort() A.reverse() b=sum(A)/4 ans="Yes" for i in range(M): if A[i]<b: ans="No" print(ans)
N,M=map(int,input().split()) A=list(map(int,input().split())) A.sort() A.reverse() b=sum(A)/(4*M) ans="Yes" for i in range(M): if A[i]<b: ans="No" print(ans)
[["+", 0, 1, 0, 662, 12, 657, 12, 23, 0, 24], ["+", 0, 662, 12, 657, 12, 23, 0, 657, 17, 48], ["+", 0, 662, 12, 657, 12, 23, 0, 657, 12, 22], ["+", 0, 1, 0, 662, 12, 657, 12, 23, 0, 25]]
5
81
#include <algorithm> #include <iostream> #include <vector> using namespace std; int main() { uint64_t m, n, all = 0; vector<int> vec; cin >> n >> m; for (int i = 0; i < n; ++i) { vec.emplace_back(); cin >> vec.back(); all += vec.back(); } std::sort(vec.begin(), vec.end()); for (int i = 0...
#include <algorithm> #include <iostream> #include <vector> using namespace std; int main() { uint64_t m, n, all = 0; vector<int> vec; cin >> n >> m; for (int i = 0; i < n; ++i) { vec.emplace_back(); cin >> vec.back(); all += vec.back(); } std::sort(vec.begin(), vec.end()); for (int i = ...
[["+", 51, 16, 12, 16, 31, 16, 31, 16, 31, 13], ["+", 51, 16, 12, 16, 31, 16, 31, 16, 17, 48]]
1
150
#include <bits/stdc++.h> using namespace std; int main() { int n, m, total, sum = 0; cin >> n >> m; vector<int> a(n); for (auto &e : a) cin >> e; total = accumulate(a.begin(), a.end(), 0); for (auto &e : a) { if (e > total / 4 / m) { sum++; } } if (sum >= m) { cout << "Yes" << ...
#include <bits/stdc++.h> using namespace std; int main() { int n, m, total, sum = 0; cin >> n >> m; vector<int> a(n); for (auto &e : a) cin >> e; total = accumulate(a.begin(), a.end(), 0); for (auto &e : a) { if (e >= total / 4. / m) { sum++; } } if (sum >= m) { cout << "Yes" <...
[["-", 8, 9, 0, 57, 15, 339, 51, 16, 17, 47], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 17, 20], ["-", 15, 339, 51, 16, 12, 16, 31, 16, 12, 13], ["+", 15, 339, 51, 16, 12, 16, 31, 16, 12, 13]]
1
121
#include <bits/stdc++.h> using namespace std; int main() { int N, M; vector<int> A; cin >> N >> M; for (int i = 0; i < N; i++) { int Ai; cin >> Ai; A.emplace_back(Ai); } sort(A.rbegin(), A.rend()); if (A[M - 1] >= accumulate(A.begin(), A.end(), 0) / (4 * M)) cout << "Yes" << endl; else...
#include <bits/stdc++.h> using namespace std; // int 3E4 // long 2E9 // long long 9E18 int main() { int N, M; vector<int> A; cin >> N >> M; for (int i = 0; i < N; i++) { int Ai; cin >> Ai; A.emplace_back(Ai); } sort(A.rbegin(), A.rend()); if (A[M - 1] >= (double)accumulate(A.begin(), A.end()...
[["+", 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], ["-", 51, 16, 12, 16, 31, 2, 3, 4, 0, 13], ["+", 12, 16, 31, 74, 51, 2, 3, 4, 0, 13]]
1
123
//~ while (clock()<=69*CLOCKS_PER_SEC) //~ #pragma comment(linker, "/stack:200000000") #pragma GCC optimize("O3") //~ #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> #include <ext/pb_ds/as...
//~ while (clock()<=69*CLOCKS_PER_SEC) //~ #pragma comment(linker, "/stack:200000000") #pragma GCC optimize("O3") //~ #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> #include <ext/pb_ds/as...
[["-", 8, 9, 0, 57, 15, 339, 51, 16, 31, 22], ["-", 8, 9, 0, 57, 15, 339, 51, 16, 17, 60], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 17, 20], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 12, 22]]
1
532
N,M = list(map(int, input().split())) A = [int(x) for x in input().split()] total = sum(A) count = 0 for i in range(N): if A[i] > ((1 / (4 * M)) * total): count = count + 1 if count < M: print("No") else: print("Yes")
N,M = list(map(int, input().split())) A = [int(x) for x in input().split()] total = sum(A) count = 0 for i in range(N): if A[i] >= ((1 / (4 * M)) * total): count = count + 1 if count < M: print("No") else: print("Yes")
[["-", 0, 7, 8, 196, 0, 57, 15, 666, 667, 47], ["+", 0, 7, 8, 196, 0, 57, 15, 666, 667, 20]]
5
98
NM=input().split() M=int(NM[1]) a=input().split() a_list=[] for i in a : a_list.append(int(i)) a_list.sort(reverse=True) sum1=sum(a_list) flag=True for i,youso in enumerate(a_list) : if(youso*4*M<sum1 and i+1<=M) : print(youso) flag=False break if flag==True : print('Yes') else : print('No')
NM=input().split() M=int(NM[1]) a=input().split() a_list=[] for i in a : a_list.append(int(i)) a_list.sort(reverse=True) sum1=sum(a_list) flag=True for i,youso in enumerate(a_list) : if(youso*4*M<sum1 and i+1<=M) : flag=False break if flag==True : print('Yes') else : print('No')
[["-", 0, 57, 64, 196, 0, 1, 0, 652, 63, 22], ["-", 64, 196, 0, 1, 0, 652, 3, 4, 0, 24], ["-", 64, 196, 0, 1, 0, 652, 3, 4, 0, 22], ["-", 64, 196, 0, 1, 0, 652, 3, 4, 0, 25]]
5
116
#include <bits/stdc++.h> #include <ext/pb_ds/assoc_container.hpp> // Common file #include <ext/pb_ds/tree_policy.hpp> #include <functional> // for less #include <iostream> using namespace __gnu_pbds; using namespace std; typedef long long ll; #define pf(n) cout << n << endl #define ps() cout << " "; #define sf(n) cin...
#include <bits/stdc++.h> #include <ext/pb_ds/assoc_container.hpp> // Common file #include <ext/pb_ds/tree_policy.hpp> #include <functional> // for less #include <iostream> using namespace __gnu_pbds; using namespace std; typedef long long ll; #define pf(n) cout << n << endl #define ps() cout << " "; #define sf(n) cin...
[["-", 0, 30, 0, 14, 8, 9, 0, 43, 39, 40], ["+", 0, 30, 0, 14, 8, 9, 0, 43, 39, 40]]
1
297
#include <bits/stdc++.h> using namespace std; int main() { int N, M; cin >> N >> M; int sum = 0; vector<int> hyou(N); for (int i = 0; i < N; i++) { cin >> hyou.at(i); sum += hyou.at(i); } sort(hyou.begin(), hyou.end()); reverse(hyou.begin(), hyou.end()); if (hyou.at(M - 1) < sum / (4 * M)) ...
#include <bits/stdc++.h> using namespace std; int main() { int N, M; cin >> N >> M; int sum = 0; vector<int> hyou(N); for (int i = 0; i < N; i++) { cin >> hyou.at(i); sum += hyou.at(i); } sort(hyou.begin(), hyou.end()); reverse(hyou.begin(), hyou.end()); if (hyou.at(M - 1) * 4 * M < sum) ...
[["-", 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
137
#include <bits/stdc++.h> using namespace std; #define vi vector<int> #define ll unsigned long long int #define pp long long int #define pb push_back #define mp make_pair #define eb emplace_back int binaryExponentiation(int x, int n) // function to calculate x raise to power n { int result = ...
#include <bits/stdc++.h> using namespace std; #define vi vector<int> #define ll unsigned long long int #define pp long long int #define pb push_back #define mp make_pair #define eb emplace_back int binaryExponentiation(int x, int n) // function to calculate x raise to power n { int result = ...
[["-", 0, 30, 0, 14, 8, 9, 0, 43, 39, 78], ["+", 0, 30, 0, 14, 8, 9, 0, 43, 39, 40]]
1
226
#include <bits/stdc++.h> #include <utility> using namespace std; int main() { int n, m; cin >> n >> m; vector<int> a(n); int tokuhyo = 0; for (int i = 0; i < n; i++) { cin >> a.at(i); tokuhyo += a.at(i); } for (int i = 0; i < n - 1; i++) { for (int j = 0; j < n - i - 1; j++) { if (a.a...
#include <bits/stdc++.h> #include <utility> using namespace std; int main() { int n, m; cin >> n >> m; vector<int> a(n); float tokuhyo = 0; for (int i = 0; i < n; i++) { cin >> a.at(i); tokuhyo += a.at(i); } for (int i = 0; i < n - 1; i++) { for (int j = 0; j < n - i - 1; j++) { if (a...
[["-", 0, 30, 0, 14, 8, 9, 0, 43, 39, 40], ["+", 0, 30, 0, 14, 8, 9, 0, 43, 39, 40], ["-", 8, 9, 0, 57, 64, 1, 0, 11, 17, 32], ["+", 8, 9, 0, 57, 64, 1, 0, 11, 17, 107]]
1
213
n = list(map(int,input().split())) vote = list(map(int,input().split())) a = sum(vote)/(4*n[1]) result = 0 for i in range(n[0]): if vote[i]>a: result += 1 if result<n[1]: print('No') else: print('Yes')
n = list(map(int,input().split())) vote = list(map(int,input().split())) a = sum(vote)/(4*n[1]) result = 0 for i in range(n[0]): if vote[i]>=a: result += 1 if result<n[1]: print('No') else: print('Yes')
[["-", 0, 7, 8, 196, 0, 57, 15, 666, 667, 47], ["+", 0, 7, 8, 196, 0, 57, 15, 666, 667, 20]]
5
96
n, m = [int(x) for x in input().split()] votes = [int(x) for x in input().split()] print('Yes' if (sorted(votes, reverse=True)[m-1] > (sum(votes) / (4 * m))) else 'No')
n, m = [int(x) for x in input().split()] votes = [int(x) for x in input().split()] print('Yes' if (sorted(votes, reverse=True)[m-1] >= (sum(votes) / (4 * m))) else 'No')
[["-", 3, 4, 0, 41, 0, 23, 0, 666, 667, 47], ["+", 3, 4, 0, 41, 0, 23, 0, 666, 667, 20]]
5
77
N, M = map(int, input().split()) tokuten_list = list(map(int, input().split())) soutokuten = sum(tokuten_list) asikiri_line = int(soutokuten / (4 * M)) + 1 kekka = "No" ninki_count = 0 for tokuten in tokuten_list: if tokuten >= asikiri_line: ninki_count += 1 if ninki_count >= M: kekka = ...
N, M = map(int, input().split()) tokuten_list = list(map(int, input().split())) soutokuten = sum(tokuten_list) asikiri_line = soutokuten / (4 * M) kekka = "No" ninki_count = 0 for tokuten in tokuten_list: if tokuten >= asikiri_line: ninki_count += 1 if ninki_count >= M: kekka = "Yes" ...
[["-", 0, 1, 0, 662, 12, 657, 31, 652, 63, 22], ["-", 0, 662, 12, 657, 31, 652, 3, 4, 0, 24], ["-", 0, 662, 12, 657, 31, 652, 3, 4, 0, 25], ["-", 0, 656, 0, 1, 0, 662, 12, 657, 17, 72], ["-", 0, 656, 0, 1, 0, 662, 12, 657, 12, 612]]
5
89
#include <iostream> using namespace std; int main() { int n, i, m, a[100], s = 0, count = 0; cin >> n >> m; for (i = 0; i < n; i++) { cin >> a[i]; s += a[i]; } s = s / 4 / m; for (i = 0; i < n; i++) { if (a[i] >= s) count++; } if (count >= m) cout << "Yes"; else cout << "No";...
#include <iostream> using namespace std; int main() { int n, i, m, a[100], count = 0; double s = 0; cin >> n >> m; for (i = 0; i < n; i++) { cin >> a[i]; s += a[i]; } s = s / 4.0 / m; for (i = 0; i < n; i++) { if (a[i] >= s) count++; } if (count >= m) cout << "Yes"; else co...
[["-", 0, 14, 8, 9, 0, 43, 49, 50, 49, 22], ["+", 0, 14, 8, 9, 0, 43, 49, 50, 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, 1, 0, 11, 12, 16, 31, 16, 12, 13], ["+", 0, 1, 0, 11, 12, 16, 31, 16, 12, 13]]
1
121
/****************************************************************************** Welcome to GDB Online. GDB online is an online compiler and debugger tool for C, C++, Python, PHP, Ruby, C#, VB, Perl, Swift, Prolog, Javascript, Pascal, HTML, CSS, JS Code, Compile, Run and Debug online from anywhere in world. **********...
/****************************************************************************** Welcome to GDB Online. GDB online is an online compiler and debugger tool for C, C++, Python, PHP, Ruby, C#, VB, Perl, Swift, Prolog, Javascript, Pascal, HTML, CSS, JS Code, Compile, Run and Debug online from anywhere in world. **********...
[["-", 15, 339, 51, 16, 12, 16, 31, 16, 12, 13], ["+", 15, 339, 51, 16, 12, 16, 31, 16, 12, 13]]
1
226
#include <bits/stdc++.h> using namespace std; #define rep(i, n) for (int i = 0; i < (int)(n); i++) int main() { int n, m, s = 0, cnt = 0; cin >> n >> m; vector<int> a(n); rep(i, n) cin >> a[i]; rep(i, n) s += a[i]; double o = s / (4 * m); rep(i, n) { if (a[i] >= o) cnt++; } if (cnt >= m)...
#include <bits/stdc++.h> using namespace std; #define rep(i, n) for (int i = 0; i < (int)(n); i++) int main() { int n, m, s = 0, cnt = 0; cin >> n >> m; vector<int> a(n); rep(i, n) cin >> a[i]; rep(i, n) s += a[i]; double o = (double)s / (4 * m); rep(i, n) { if (a[i] >= o) cnt++; } if (c...
[["+", 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
129
#include <bits/stdc++.h> #include <iostream> using namespace std; int main() { int a, b, sum = 0; cin >> a >> b; int c[a]; for (int i = 0; i < a; i++) { cin >> c[i]; sum += c[i]; } sort(c, c + a); if ((float)c[a - b] <= (float)sum / (4 * b)) cout << "No"; else cout << "Yes"; }
#include <bits/stdc++.h> #include <iostream> using namespace std; int main() { int a, b, sum = 0; cin >> a >> b; int c[a]; for (int i = 0; i < a; i++) { cin >> c[i]; sum += c[i]; } sort(c, c + a); if ((float)c[a - b] < (float)sum / (4 * b)) cout << "No"; else cout << "Yes"; }
[["-", 8, 9, 0, 57, 15, 339, 51, 16, 17, 19], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 17, 18]]
1
110
#include <iostream> #include <string> using namespace std; int main(void) { int n, m, tot = 0, c = 0; cin >> n >> m; int a[n]; for (int i = 0; i < n; i++) { cin >> a[i]; tot = tot + a[i]; } double x = 1 / (4 * (double)m); for (int i = 0; i < n; i++) { double y = (double)a[i] / (double)tot; ...
#include <iostream> #include <string> using namespace std; int main(void) { int n, m, tot = 0, c = 0; cin >> n >> m; int a[n]; for (int i = 0; i < n; i++) { cin >> a[i]; tot = tot + a[i]; } double x = 1 / (4 * (double)m); for (int i = 0; i < n; i++) { double y = (double)a[i] / (double)tot; ...
[["-", 8, 9, 0, 57, 15, 339, 51, 16, 17, 19], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 17, 18]]
1
162
#include <bits/stdc++.h> #include <stdio.h> using namespace std; #define inputInt(a) \ int a; \ cin >> a; #define inputInt2(a, b) \...
#include <bits/stdc++.h> #include <stdio.h> using namespace std; #define inputInt(a) \ int a; \ cin >> a; #define inputInt2(a, b) \...
[["-", 8, 9, 0, 57, 15, 339, 51, 16, 17, 47], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 17, 20], ["-", 8, 9, 0, 57, 15, 339, 51, 16, 17, 20], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 17, 47]]
1
399
#include "bits/stdc++.h" using namespace std; void Main() { int N, M; cin >> N; vector<int> vec(N); cin >> M; for (int i = 0; i < N; i++) { cin >> vec[i]; } int cnt = 0; double sum = std::accumulate(vec.begin(), vec.end(), 0) / (4 * M); bool isYes = false; for (int i = 0; i < vec.size(); i++) {...
#include "bits/stdc++.h" using namespace std; void Main() { int N, M; cin >> N; vector<int> vec(N); cin >> M; for (int i = 0; i < N; i++) { cin >> vec[i]; } int cnt = 0; double sum = (double)accumulate(vec.begin(), vec.end(), 0) / ((double)4 * M); bool isYes = false; for (int i = 0; i < vec.siz...
[["-", 49, 50, 51, 16, 31, 2, 63, 343, 345, 348], ["-", 49, 50, 51, 16, 31, 2, 63, 343, 0, 349], ["+", 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], ["+", 51, 16, 12, 23, 0, 16, 31, 74, 0, 24], ["+", 12, 23, 0, 16, 31, 74, 39, 77, 39, ...
1
197
#include <iostream> #include <vector> using namespace std; int main() { int N, M; int sum = 0; cin >> N >> M; vector<int> A(N); 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 (...
#include <iostream> #include <vector> using namespace std; int main() { int N, M; int sum = 0; cin >> N >> M; vector<int> A(N); 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.0 * M))) count++; } if...
[["-", 12, 23, 0, 16, 12, 23, 0, 16, 31, 13], ["+", 12, 23, 0, 16, 12, 23, 0, 16, 31, 13]]
1
136
#include <algorithm> #include <bitset> #include <climits> #include <cmath> #include <cstdio> #include <cstring> #include <ctime> #include <deque> #include <iomanip> #include <iostream> #include <map> #include <queue> #include <set> #include <stack> #include <string> #include <unordered_map> #include <unordered_set> #in...
#include <algorithm> #include <bitset> #include <climits> #include <cmath> #include <cstdio> #include <cstring> #include <ctime> #include <deque> #include <iomanip> #include <iostream> #include <map> #include <queue> #include <set> #include <stack> #include <string> #include <unordered_map> #include <unordered_set> #in...
[["-", 0, 30, 0, 43, 49, 50, 51, 16, 31, 13], ["+", 0, 30, 0, 43, 49, 50, 51, 16, 31, 13], ["-", 0, 9, 0, 57, 15, 339, 51, 16, 17, 47], ["+", 0, 9, 0, 57, 15, 339, 51, 16, 17, 20]]
1
296
#include <bits/stdc++.h> #define fi first #define se second #define pb push_back using namespace std; typedef long long ll; typedef pair<int, int> pii; const int maxn = 105; int n, m; int niz[maxn]; ll sum; int main() { cin >> n >> m; for (int i = 0; i < n; i++) { cin >> niz[i]; sum += niz[i]; } double ...
#include <bits/stdc++.h> #define fi first #define se second #define pb push_back using namespace std; typedef long long ll; typedef pair<int, int> pii; const int maxn = 105; int n, m; int niz[maxn]; ll sum; int main() { cin >> n >> m; for (int i = 0; i < n; i++) { cin >> niz[i]; sum += niz[i]; } double ...
[["-", 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
164
n,m = map(int, input().split()) l = list(map(int, input().split())) limit = sum(l)//(4*m) l.sort(reverse=True) if l[m-1] < limit: print("No") else: print("Yes")
n,m = map(int, input().split()) l = list(map(int, input().split())) limit = sum(l)/(4*m) l.sort(reverse=True) if l[m-1] < limit: 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
77
import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.util.Arrays; import java.util.Collections; public class Main { public static void main(String[] args) throws IOException { BufferedReader in = new BufferedReader(new InputStreamReader(System.in)); String...
import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.util.Arrays; import java.util.Collections; public class Main { public static void main(String[] args) throws IOException { BufferedReader in = new BufferedReader(new InputStreamReader(System.in)); String...
[["+", 15, 15, 0, 16, 12, 16, 31, 74, 0, 24], ["+", 0, 16, 12, 16, 31, 74, 39, 511, 0, 512], ["+", 15, 15, 0, 16, 12, 16, 31, 74, 0, 25]]
3
251
#include <algorithm> #include <iostream> using namespace std; int main() { int N, M; int sum = 0; int A[110]; cin >> N >> M; for (int i = 0; i < N; i++) { cin >> A[i]; sum += A[i]; } sort(A, A + N, greater<int>()); if (A[M - 1] >= (sum / (4 * M))) { cout << "Yes" << endl; } else { co...
#include <algorithm> #include <iostream> using namespace std; int main() { int N, M; double sum = 0; int A[110]; cin >> N >> M; for (int i = 0; i < N; i++) { cin >> A[i]; sum += A[i]; } sort(A, A + N, greater<int>()); if (A[M - 1] >= (sum / (4 * M))) { cout << "Yes" << endl; } else { ...
[["-", 0, 30, 0, 14, 8, 9, 0, 43, 39, 40], ["+", 0, 30, 0, 14, 8, 9, 0, 43, 39, 40]]
1
122
#include <algorithm> #include <iostream> #include <vector> using namespace std; int main() { int n, m, a; vector<int> v; string ans = "Yes"; cin >> n >> m; int t = 0; for (int i = 0; i < n; ++i) { cin >> a; t += a; v.push_back(a); } sort(v.begin(), v.end()); if (v[n - m] < t / (4 * m)) {...
#include <algorithm> #include <iostream> #include <vector> using namespace std; int main() { int n, m, a; vector<int> v; string ans = "Yes"; cin >> n >> m; float t = 0; for (int i = 0; i < n; ++i) { cin >> a; t += a; v.push_back(a); } sort(v.begin(), v.end()); if (v[n - m] < t / (4 * m))...
[["-", 0, 30, 0, 14, 8, 9, 0, 43, 39, 40], ["+", 0, 30, 0, 14, 8, 9, 0, 43, 39, 40]]
1
124
n, m = map(int, input().split()) input_list = [0] * n input_list_str = input().split() input_list = [int(s) for s in input_list_str] input_list = sorted(input_list, reverse=True) vote_sum = sum(input_list) vote_standard = int(vote_sum / (4 * m)) flag = True for i in range(m): if input_list[i] < vote_standard: ...
n, m = map(int, input().split()) input_list = [0] * n input_list_str = input().split() input_list = [int(s) for s in input_list_str] input_list = sorted(input_list, reverse=True) vote_sum = sum(input_list) vote_standard = vote_sum / (4 * m) flag = True for i in range(m): if input_list[i] < vote_standard: ...
[["-", 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
112
#include <bits/stdc++.h> using namespace std; int array_sum_from_i(vector<int> &data, int i) { // ベースケース if (i == data.size()) { return 0; // 対象の要素がないので総和は0 } // 再帰ステップ int s = array_sum_from_i(data, i + 1); // i+1番目以降の要素の総和 return data.at(i) + s; // 「i番目以降の要素の総和」=「i番目の要素」+ s } // dataの全ての要素の総和を計算する in...
#include <bits/stdc++.h> using namespace std; int array_sum_from_i(vector<int> &data, int i) { // ベースケース if (i == data.size()) { return 0; // 対象の要素がないので総和は0 } // 再帰ステップ int s = array_sum_from_i(data, i + 1); // i+1番目以降の要素の総和 return data.at(i) + s; // 「i番目以降の要素の総和」=「i番目の要素」+ s } // dataの全ての要素の総和を計算する in...
[["+", 0, 57, 15, 339, 51, 16, 12, 16, 31, 13], ["+", 0, 57, 15, 339, 51, 16, 12, 16, 17, 72], ["-", 51, 16, 12, 16, 12, 23, 0, 16, 31, 13], ["-", 51, 16, 12, 16, 12, 23, 0, 16, 17, 72]]
1
273
n, m = map(int, input().split()) a = list(map(int, input().split())) sum_a = sum(a) l = [] for i in range(n): if a[i] < sum_a // (4*m): continue else: l.append(a[i]) if len(l) >= m: print("Yes") else: print("No")
n, m = map(int, input().split()) a = list(map(int, input().split())) sum_a = sum(a) l = [] for i in range(n): if a[i] < sum_a / (4*m): continue else: l.append(a[i]) if len(l) >= m: print("Yes") else: print("No")
[["-", 8, 196, 0, 57, 15, 666, 0, 657, 17, 676], ["+", 8, 196, 0, 57, 15, 666, 0, 657, 17, 85]]
5
99
#include <algorithm> #include <iostream> #include <map> #include <math.h> #include <numeric> #include <queue> #include <set> #include <sstream> #include <stack> #include <utility> #include <vector> typedef long long ll; const int dx[8] = {1, 0, -1, 0, 1, -1, -1, 1}; const int dy[8] = {0, 1, 0, -1, 1, 1, -1, -1}; const...
#include <algorithm> #include <iostream> #include <map> #include <math.h> #include <numeric> #include <queue> #include <set> #include <sstream> #include <stack> #include <utility> #include <vector> typedef long long ll; const int dx[8] = {1, 0, -1, 0, 1, -1, -1, 1}; const int dy[8] = {0, 1, 0, -1, 1, 1, -1, -1}; const...
[["-", 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], ["+", 8, 9, 0, 1, 0, 11, 12, 74, 0, 24], ["+", 0, 1, 0, 11, 12, 74, 39, 77, 39, 40], ["+", 8, 9, 0, 1, 0, 11, 12, 74, 0, 25]]
1
697
#include <iostream> #include <vector> int main() { int N, M; std::cin >> N >> M; std::vector<int> A(N); long int sum = 0; for (int i = 0; i < N; ++i) { std::cin >> A[i]; sum += A[i]; } int count = 0; for (int i = 0; i < N; ++i) { if (4 * M * A[i] > sum) { ++count; } } if (...
#include <iostream> #include <vector> int main() { int N, M; std::cin >> N >> M; std::vector<int> A(N); long int sum = 0; for (int i = 0; i < N; ++i) { std::cin >> A[i]; sum += A[i]; } int count = 0; for (int i = 0; i < N; ++i) { if (4 * M * A[i] >= sum) { ++count; } } if ...
[["-", 8, 9, 0, 57, 15, 339, 51, 16, 17, 47], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 17, 20]]
1
141
arrayNM = list(map(int, input().split())) array = list(map(int, input().split())) soutoku = 0 for num in array: soutoku += num tokuhyousuu = soutoku / (4 * float(array[1])) ninnkiCounter = 0 for num in array: if (float(num) >= tokuhyousuu): ninnkiCounter += 1 if (arrayNM[1] < ninnkiCounter): print("Yes"...
arrayNM = list(map(int, input().split())) array = list(map(int, input().split())) soutoku = 0 for num in array: soutoku += num tokuhyousuu = soutoku / (4 * float(arrayNM[1])) ninnkiCounter = 0 for num in array: if (float(num) >= tokuhyousuu): ninnkiCounter += 1 if (arrayNM[1] <= ninnkiCounter): print("Y...
[["-", 0, 657, 12, 652, 3, 4, 0, 206, 51, 22], ["+", 0, 657, 12, 652, 3, 4, 0, 206, 51, 22], ["-", 0, 656, 0, 57, 15, 23, 0, 666, 667, 18], ["+", 0, 656, 0, 57, 15, 23, 0, 666, 667, 19]]
5
105
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 c[] = new int[n]; int count = 0; for (int i = 0; i < n; i++) { c[i] = scan.nextInt(); count += c[i];...
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 c[] = new int[n]; double count = 0; for (int i = 0; i < n; i++) { c[i] = scan.nextInt(); count += c[...
[["-", 0, 195, 8, 196, 0, 503, 39, 506, 0, 507], ["+", 0, 195, 8, 196, 0, 503, 39, 511, 0, 512]]
3
176
import java.util.*; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int n = sc.nextInt(); int m = sc.nextInt(); int a[] = new int[n]; int x = 0; int aa = 0; for (int i = 0; i < n; i++) { a[i] = sc.nextInt(); aa += a[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(); int a[] = new int[n]; int x = 0; int aa = 0; for (int i = 0; i < n; i++) { a[i] = sc.nextInt(); aa += a[i]; } ...
[["+", 0, 16, 31, 23, 0, 16, 31, 74, 0, 24], ["+", 31, 23, 0, 16, 31, 74, 39, 511, 0, 512], ["+", 0, 16, 31, 23, 0, 16, 31, 74, 0, 25]]
3
179
import java.util.*; import java.util.Arrays; import java.util.Collections; public class Main { public static void main(String[] args) { Scanner scan = new Scanner(System.in); int n = scan.nextInt(); int m = scan.nextInt(); int list[] = new int[n]; long sum = 0; boolean flag = true; for (...
import java.util.*; import java.util.Arrays; import java.util.Collections; public class Main { public static void main(String[] args) { Scanner scan = new Scanner(System.in); int n = scan.nextInt(); int m = scan.nextInt(); int list[] = new int[n]; double sum = 0; boolean flag = true; for...
[["-", 0, 195, 8, 196, 0, 503, 39, 506, 0, 96], ["+", 0, 195, 8, 196, 0, 503, 39, 511, 0, 512]]
3
207
#include "bits/stdc++.h" using namespace std; #define rep(i, n) for (int i = 0; i < (int)(n); i++) int main() { int n, a, cnt = 0; double sum = 0, m; double judge; bool result = true; vector<long long> ranking; cin >> n >> m >> a; rep(i, n) { cin >> a; ranking.push_back(a); sum += a; } j...
#include "bits/stdc++.h" using namespace std; #define rep(i, n) for (int i = 0; i < (int)(n); i++) int main() { int n, a, cnt = 0; double sum = 0, m; double judge; bool result = true; vector<long long> ranking; cin >> n >> m; rep(i, n) { cin >> a; ranking.push_back(a); sum += a; } judge ...
[["-", 0, 14, 8, 9, 0, 1, 0, 16, 17, 152], ["-", 0, 14, 8, 9, 0, 1, 0, 16, 12, 22], ["-", 0, 14, 49, 53, 54, 55, 0, 56, 39, 78], ["+", 0, 14, 49, 53, 54, 55, 0, 56, 39, 78], ["-", 8, 9, 0, 57, 15, 339, 51, 16, 17, 60], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 17, 20]]
1
173
#include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < (int)(n); i++) typedef long long ll; using namespace std; int main() { int n, m; cin >> n >> m; vector<int> a(n); int sum = 0; for (int i = 0; i < n; i++) { cin >> a[i]; sum += a[i]; } int count = 0; for (int i = 0; i < n; i++) { ...
#include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < (int)(n); i++) typedef long long ll; using namespace std; int main() { int n, m; cin >> n >> m; vector<int> a(n); int sum = 0; for (int i = 0; i < n; i++) { cin >> a[i]; sum += a[i]; } int count = 0; for (int i = 0; i < n; i++) { ...
[["-", 8, 9, 0, 57, 15, 339, 51, 16, 17, 47], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 17, 18], ["+", 0, 57, 15, 339, 51, 16, 31, 16, 31, 22], ["+", 0, 57, 15, 339, 51, 16, 31, 16, 17, 33]]
1
149
#include <math.h> #include <stdio.h> void main() { int i, j, n, m, votes = 0, c = 0, k = 0; scanf("%d%d", &n, &m); int a[n]; for (i = 0; i < n; i++) { scanf("%d", &a[i]); votes += a[i]; } k = ceil(votes / (4 * m)); for (j = 0; j < n; j++) { if (a[j] >= k) { c = c + 1; if (c == m) ...
#include <math.h> #include <stdio.h> void main() { int i, j, n, m, votes = 0, c = 0, k = 0; scanf("%d%d", &n, &m); int a[n]; for (i = 0; i < n; i++) { scanf("%d", &a[i]); votes += a[i]; } k = ceil(1.0 * votes / (4 * m)); for (j = 0; j < n; j++) { if (a[j] >= k) { c = c + 1; if (c ...
[["+", 12, 2, 3, 4, 0, 16, 31, 16, 31, 13], ["+", 12, 2, 3, 4, 0, 16, 31, 16, 17, 48]]
0
160
// warm heart, wagging tail,and a smile just for you! // ███████████ // ███╬╬╬╬╬╬╬╬╬╬███ // ███╬╬╬╬╬████╬╬╬╬╬╬███ // ...
// warm heart, wagging tail,and a smile just for you! // ███████████ // ███╬╬╬╬╬╬╬╬╬╬███ // ███╬╬╬╬╬████╬╬╬╬╬╬███ // ...
[["+", 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
303
#include <bits/stdc++.h> using namespace std; int main() { int n, m, i, j = 0, sum = 0; cin >> n >> m; int arr[n + 1]; for (i = 0; i < n; i++) { cin >> arr[i]; } for (i = 0; i < n; i++) { sum = sum + arr[i]; } for (i = 0; i < n; i++) { if (arr[i] >= (sum / (4 * m))) j++; } j >= m ?...
#include <bits/stdc++.h> using namespace std; int main() { int n, m, i, j = 0, sum = 0; cin >> n >> m; int arr[n + 1]; for (i = 0; i < n; i++) { cin >> arr[i]; } for (i = 0; i < n; i++) { sum = sum + arr[i]; } for (i = 0; i < n; i++) { if (arr[i] >= (double(sum) / (4 * m))) j++; } ...
[["+", 51, 16, 12, 23, 0, 16, 31, 2, 63, 40], ["+", 12, 23, 0, 16, 31, 2, 3, 4, 0, 24], ["+", 12, 23, 0, 16, 31, 2, 3, 4, 0, 25]]
1
142
#include <iostream> #include <string.h> #include <vector> #define rep(i, n) for (int i = 0; i < (n); i++) using namespace std; int main(void) { // input int n, m; cin >> n >> m; vector<int> vote(n); rep(i, n) cin >> vote[i]; int sum = 0; rep(i, n) sum += vote[i]; int deadline = sum / (4 * m); int...
#include <iostream> #include <string.h> #include <vector> #define rep(i, n) for (int i = 0; i < (n); i++) using namespace std; int main(void) { // input int n, m; cin >> n >> m; vector<int> vote(n); rep(i, n) cin >> vote[i]; int sum = 0; rep(i, n) sum += vote[i]; float deadline = (float)sum / (4 * ...
[["-", 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, 74, 0, 24], ["+", 49, 50, 51, 16, 31, 74, 39, 77, 39, 40], ["+", 0, 43, 49, 50, 51, 16, 31, 74, 0, 25]]
1
145
// BISMILLAH #include <bits/stdc++.h> using namespace std; int main() { int n, m, total = 0, countt = 0; cin >> n >> m; int arr[n]; float result = 0.0, flag = 0; for (int i = 0; i < n; i++) { cin >> arr[i]; total += arr[i]; } // cout<<total<<endl; result = (float)((float)total / ((float)4 * (fl...
// BISMILLAH #include <bits/stdc++.h> using namespace std; int main() { int n, m, total = 0, countt = 0; cin >> n >> m; int arr[n]; float result = 0.0, flag = 0; for (int i = 0; i < n; i++) { cin >> arr[i]; total += arr[i]; } // cout<<total<<endl; result = (float)((float)total / ((float)4 * (fl...
[["-", 8, 9, 0, 57, 15, 339, 51, 16, 17, 47], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 17, 20]]
1
157
import java.util.ArrayList; import java.util.Collections; import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner in = new Scanner(System.in); int n = in.nextInt(); int m = in.nextInt(); int sum = 0; boolean isYes = true; ArrayList<Integer> nums = new Ar...
import java.util.ArrayList; import java.util.Collections; import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner in = new Scanner(System.in); int n = in.nextInt(); int m = in.nextInt(); int sum = 0; boolean isYes = true; ArrayList<Integer> nums = new Ar...
[["-", 0, 16, 12, 16, 12, 23, 0, 16, 31, 499], ["+", 0, 16, 12, 16, 12, 23, 0, 16, 31, 515]]
3
217
N,M = map(int,input().split()) A = list(map(int,input().split())) A.sort() if A[-M]/sum(A) < 1/(2*M) : print("No") else: print("Yes")
N,M = map(int,input().split()) A = list(map(int,input().split())) A.sort() if A[-M]/sum(A) < 1/(4*M) : print("No") else: print("Yes")
[["-", 15, 666, 0, 657, 12, 23, 0, 657, 31, 612], ["+", 15, 666, 0, 657, 12, 23, 0, 657, 31, 612]]
5
72
#include <bits/stdc++.h> // #include <vector.h> #define rep(i, n) for (int i = 0; i < (int)(n); i++) using namespace std; int main() { int n, m; cin >> n >> m; vector<int> a(n); int asum = 0; rep(i, n) { cin >> a[i]; asum += a[i]; } int border = asum / (4 * m); sort(a.begin(), a.end(), greater<...
#include <bits/stdc++.h> // #include <vector.h> #define rep(i, n) for (int i = 0; i < (int)(n); i++) using namespace std; int main() { int n, m; cin >> n >> m; vector<int> a(n); int asum = 0; rep(i, n) { cin >> a[i]; asum += a[i]; } int border = (asum - 1) / (4 * m); sort(a.begin(), a.end(), gr...
[["+", 0, 43, 49, 50, 51, 16, 31, 23, 0, 24], ["+", 49, 50, 51, 16, 31, 23, 0, 16, 17, 33], ["+", 49, 50, 51, 16, 31, 23, 0, 16, 12, 13], ["+", 0, 43, 49, 50, 51, 16, 31, 23, 0, 25]]
1
132
#include <stdio.h> #include <stdlib.h> int compareInt(const void *a, const void *b) { int aNum = *(int *)a; int bNum = *(int *)b; return bNum - aNum; } int main(void) { int i, j; int x = 0; int k[100] = {0}; scanf("%d %d", &i, &j); for (int l = 0; l < i; l++) { scanf("%d ", &k[l]); x += k[l];...
#include <stdio.h> #include <stdlib.h> int compareInt(const void *a, const void *b) { int aNum = *(int *)a; int bNum = *(int *)b; return bNum - aNum; } int main(void) { int i, j; int x = 0; int k[100] = {0}; scanf("%d %d", &i, &j); for (int l = 0; l < i; l++) { scanf("%d ", &k[l]); x += k[l];...
[["+", 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
173
#include <bits/stdc++.h> using namespace std; typedef long long ll; typedef vector<int> vi; typedef vector<vi> vvi; typedef pair<int, int> pi; typedef vector<pi> vp; #define pb push_back #define mp make_pair #define fora(i, a, n) for (int i = a; i < n; i++) #define forb(i, a, n) for (int i = a; i >= (n); --i) #define...
#include <bits/stdc++.h> using namespace std; typedef long long ll; typedef vector<int> vi; typedef vector<vi> vvi; typedef pair<int, int> pi; typedef vector<pi> vp; #define pb push_back #define mp make_pair #define fora(i, a, n) for (int i = a; i < n; i++) #define forb(i, a, n) for (int i = a; i >= (n); --i) #define...
[["-", 0, 30, 0, 14, 8, 9, 0, 43, 39, 78], ["+", 0, 30, 0, 14, 8, 9, 0, 43, 39, 40], ["-", 0, 14, 8, 9, 0, 9, 0, 43, 39, 40], ["+", 0, 14, 8, 9, 0, 9, 0, 43, 39, 40], ["+", 8, 9, 0, 9, 0, 57, 75, 76, 0, 95]]
1
205
#include <iostream> // g++ hello.cpp && ./a.out using namespace std; int main() { int N, M; int total = 0; cin >> N >> M; int arr[N]; for (int i = 0; i < N; i++) { cin >> arr[i]; total += arr[i]; } // cout <<total <<" " << M <<endl; int ans = 0; float notless = total * (1.0 / (4.0 * M)); fo...
// #include <iostream> // // g++ hello.cpp && ./a.out // using namespace std; // int reverse(int n) { // int rev,ans = 0; // while(n != 0) { // rev = n % 10; // ans = (ans * 10) + rev; // n = n / 10; // } // return ans; // } // int main() { // int T; // cin >> T; // int N; // while(T--) { // cin >> N; ...
[["-", 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; typedef long long int ll; int main() { ll n, m; cin >> n >> m; vector<ll> v(n); ll sum = 0; for (ll i = 0; i < n; i++) { cin >> v[i]; sum += v[i]; } ll x = 4 * m; ll factor = 0; if (sum % x == 0) { factor = sum / x; } else { factor = sum...
#include <bits/stdc++.h> using namespace std; typedef long long int ll; int main() { ll n, m; cin >> n >> m; vector<ll> v(n); ll sum = 0; for (ll i = 0; i < n; i++) { cin >> v[i]; sum += v[i]; } ll x = 4 * m; ll factor = 0; if (sum % x == 0) { factor = sum / x; } else { factor = sum...
[["-", 8, 9, 0, 57, 15, 339, 51, 16, 17, 47], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 17, 20]]
1
170
#include <bits/stdc++.h> #define ll long long #define f first #define s second #define pb push_back #define mod 1000000007 #define hell 998244353 #define inf 1000000000000000000LL using namespace std; ll n, k, m; // ll dp[15][1005]; void solve() { ll X, Y, Z; cin >> n >> m; vector<int> v(n); ll sum = 0; for (...
#include <bits/stdc++.h> #define ll long long #define f first #define s second #define pb push_back #define mod 1000000007 #define hell 998244353 #define inf 1000000000000000000LL using namespace std; ll n, k, m; // ll dp[15][1005]; void solve() { ll X, Y, Z; cin >> n >> m; vector<double> v(n); double sum = 0; ...
[["-", 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, 78], ["+", 0, 30, 0, 14, 8, 9, 0, 43, 39, 40], ["+", 49, 50, 51, 23, 0, 16, 12, 74, 0, 24], ["+", 51, 23, 0, 16, 12, 74, 39, 77, 39, 40], ["+", 49, 50, 51, 23, 0, 16, 12, 74, 0, 25]]
1
196
import java.util.Scanner; class Main { public static void main(String[] args) { Scanner s = new Scanner(System.in); int n = s.nextInt(), m = s.nextInt(); Integer[] arr = new Integer[n]; int sum = 0; for (int i = 0; i < n; i++) { arr[i] = s.nextInt(); sum += arr[i]; } double di...
import java.util.Scanner; class Main { public static void main(String[] args) { Scanner s = new Scanner(System.in); int n = s.nextInt(), m = s.nextInt(); Integer[] arr = new Integer[n]; int sum = 0; for (int i = 0; i < n; i++) { arr[i] = s.nextInt(); sum += arr[i]; } double di...
[["-", 0, 1, 0, 492, 3, 4, 0, 5, 0, 491], ["+", 0, 1, 0, 492, 3, 4, 0, 5, 0, 491]]
3
182
N,M=(int(x) for x in input().split()) A = list(map(int, input().split())) count=0 sum=0 for i in range(N): sum+=A[i] for i in range(N): if(A[i])>(sum * (1/(4*M))): count=count+1 if(count>=M): print("Yes") else: print("No")
N,M=(int(x) for x in input().split()) A = list(map(int, input().split())) count=0 sum=0 for i in range(N): sum+=A[i] for i in range(N): if(A[i])>=(sum * (1/(4*M))): count=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
113
n, m = gets.split.map(&:to_i) goods = gets.split.map(&:to_i) votes = goods.inject(:+) popular_goods = [] def judge(target, sum, m) if target >= sum / (4 * m) 1 else 0 end end goods.each do |good| popular_goods.push(judge(good, votes, m)) end if popular_goods.inject(:+) >= m puts "Yes" else puts "...
n, m = gets.split.map(&:to_i) goods = gets.split.map(&:to_i) votes = goods.inject(:+) popular_goods = [] def judge(target, sum, m) if target >= sum.to_f / (4 * m) 1 else 0 end end goods.each do |good| popular_goods.push(judge(good, votes, m)) end if popular_goods.inject(:+) >= m puts "Yes" else p...
[["+", 0, 121, 15, 738, 12, 738, 31, 652, 17, 131], ["+", 0, 121, 15, 738, 12, 738, 31, 652, 735, 22]]
4
100
#include <math.h> #include <stdio.h> #include <stdlib.h> #include <string.h> int compr(const void *a, const void *b) { //昇順 return *(int *)b - *(int *)a; } int main(void) { int n, m, l; int a[120] = {0}; scanf("%d %d", &n, &m); int i, max = 0; for (i = 0; i < n; i++) { scanf("%d", &l); a[i] = l; ...
#include <math.h> #include <stdio.h> #include <stdlib.h> #include <string.h> int compr(const void *a, const void *b) { //昇順 return *(int *)b - *(int *)a; } int main(void) { int n, m, l; int a[120] = {0}; scanf("%d %d", &n, &m); int i, max = 0; for (i = 0; i < n; i++) { scanf("%d", &l); a[i] = l; ...
[["-", 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, 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, 23, 0, 16, 17, 47], ["+", 8, 9, 0, 57, 15, 23, 0, 16, 17, 20]]
0
175
#include <algorithm> #include <cstdio> #include <cstring> using namespace std; int arr[10007]; int main() { int n, m, sum = 0, ans = 0; scanf("%d %d", &n, &m); for (int i = 1; i <= n; i++) { scanf("%d", &arr[i]); sum += arr[i]; } for (int i = 1; i <= n; i++) { if (4 * arr[i] * i >= sum) ans...
#include <algorithm> #include <cstdio> #include <cstring> using namespace std; int arr[10007]; int main() { int n, m, sum = 0, ans = 0; scanf("%d %d", &n, &m); for (int i = 1; i <= n; i++) { scanf("%d", &arr[i]); sum += arr[i]; } for (int i = 1; i <= n; i++) { if (4 * arr[i] * m >= sum) ans...
[["-", 0, 57, 15, 339, 51, 16, 31, 16, 12, 22], ["+", 0, 57, 15, 339, 51, 16, 31, 16, 12, 22]]
1
140
n, m = map(int,input().split()) a = list(map(int,input().split())) #総投票数 s = sum(a) a.sort(reverse=True) b = 0 for i in range(m): if a[i] > s/(4*m) : b += 1 if b == m : print("Yes") else : print("No")
n, m = map(int,input().split()) a = list(map(int,input().split())) #総投票数 s = sum(a) a.sort(reverse=True) b = 0 for i in range(m): if a[i] >= s/(4*m) : b += 1 if b == 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
95
n, m = map(int, input().split()) aaa = list(map(int, input().split())) border = sum(aaa) // (4 * m) selectable = sum(1 for a in aaa if a >= border) print('Yes' if selectable >= m else 'No')
n, m = map(int, input().split()) aaa = list(map(int, input().split())) border = sum(aaa) / (4 * m) selectable = sum(1 for a in aaa if a >= border) print('Yes' if selectable >= m else 'No')
[["-", 0, 656, 0, 1, 0, 662, 12, 657, 17, 676], ["+", 0, 656, 0, 1, 0, 662, 12, 657, 17, 85]]
5
73
#include <bits/stdc++.h> using namespace std; int main() { int n, m; cin >> n >> m; vector<int> a(n); int sum = 0; for (int i = 0; i < n; ++i) { cin >> a[i]; sum += a[i]; } int lim = sum / (4 * m); int cnt = 0; for (int i = 0; i < n; ++i) { if (a[i] >= lim) ++cnt; } if (cnt >...
#include <bits/stdc++.h> using namespace std; int main() { int n, m; cin >> n >> m; vector<int> a(n); int sum = 0; for (int i = 0; i < n; ++i) { cin >> a[i]; sum += a[i]; } double lim = (double)sum / (4 * m); int cnt = 0; for (int i = 0; i < n; ++i) { if (a[i] >= lim) ++cnt; } ...
[["-", 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, 74, 0, 24], ["+", 49, 50, 51, 16, 31, 74, 39, 77, 39, 40], ["+", 0, 43, 49, 50, 51, 16, 31, 74, 0, 25]]
1
134
N,M = list(map(int, input().split())) A = list(map(int, input().split())) print(A) Asum = sum(A) for i in range(M): Amax = max(A) max_index = A.index(Amax) A.pop(max_index) if Amax < Asum/4/M: print('No') else: print('Yes')
N,M = list(map(int, input().split())) A = list(map(int, input().split())) Asum = sum(A) for i in range(M): Amax = max(A) max_index = A.index(Amax) A.pop(max_index) if Amax < Asum/4/M: print('No') else: print('Yes')
[["-", 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
97
#include <algorithm> #include <iostream> #include <numeric> #include <vector> int main(int, char **) { double m, n; std::cin >> n >> m; std::vector<double> a(n); for (int i = 0; i < n; ++i) { std::cin >> a.at(i); } const double total = std::accumulate(a.begin(), a.end(), 0); const double kagen = total...
#include <algorithm> #include <iostream> #include <numeric> #include <vector> int main(int, char **) { double m, n; std::cin >> n >> m; std::vector<double> a(n); for (int i = 0; i < n; ++i) { std::cin >> a.at(i); } const double total = std::accumulate(a.begin(), a.end(), 0); const double kagen = total...
[["-", 0, 14, 8, 9, 0, 1, 0, 27, 17, 68], ["-", 0, 14, 8, 9, 0, 1, 0, 27, 28, 22], ["-", 0, 30, 0, 14, 8, 9, 0, 1, 0, 35]]
1
197
a,b=map(int,input().split()) l=list(map(int,input().split())) t=sum(l)//(4*b) ans = [i for i in l if i>t] print('Yes' if len(ans)>=b else 'No')
a,b=map(int,input().split()) l=list(map(int,input().split())) t=sum(l)/(4*b) ans = [i for i in l if i>=t] print('Yes' if len(ans)>=b else 'No')
[["-", 0, 656, 0, 1, 0, 662, 12, 657, 17, 676], ["+", 0, 656, 0, 1, 0, 662, 12, 657, 17, 85], ["-", 0, 662, 12, 658, 0, 678, 0, 666, 667, 47], ["+", 0, 662, 12, 658, 0, 678, 0, 666, 667, 20]]
5
75
N, M = list(map(int, input().split())) A = list(map(int, input().split())) A.sort(reverse=True) if A[M-1] > (1 / (4*M)) * sum(A) : print("Yes") else: print("No")
N, M = list(map(int, input().split())) A = list(map(int, input().split())) A.sort(reverse=True) if A[M-1] >= (1 / (4*M)) * sum(A) : 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
81
#include <algorithm> #include <bits/stdc++.h> #include <cstdio> #include <iostream> #include <string> #include <vector> using namespace std; bool cmp(int a, int b) { return a > b; } int main() { ios::sync_with_stdio(false); cin.tie(0); int n, m; cin >> n >> m; vector<int> val(n); int sum = 0; for (in...
#include <algorithm> #include <bits/stdc++.h> #include <cstdio> #include <iostream> #include <string> #include <vector> using namespace std; bool cmp(int a, int b) { return a > b; } int main() { ios::sync_with_stdio(false); cin.tie(0); int n, m; cin >> n >> m; vector<int> val(n); int sum = 0; for (in...
[["-", 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, 2, 63, 22], ["+", 0, 43, 49, 50, 51, 16, 31, 2, 63, 40], ["+", 49, 50, 51, 16, 31, 2, 3, 4, 0, 25], ["-", 51, 2, 3, 4, 0, 16, 12, 23, 0, 25]]
1
200
#include <bits/stdc++.h> using namespace std; int main() { int N = 0; int M = 0; vector<int> A; vector<int> B; int a = 0; double sum = 0.0; double condition = 0.0; cin >> N; cin >> M; for (int i = 0; i < N; i++) { cin >> a; A.push_back(a); sum += a; } double c = 0.0; c = 4 * M;...
#include <bits/stdc++.h> using namespace std; int main() { int N = 0; int M = 0; vector<int> A; vector<int> B; int a = 0; double sum = 0.0; double condition = 0.0; cin >> N; cin >> M; for (int i = 0; i < N; i++) { cin >> a; A.push_back(a); sum += a; } double c = 0.0; c = 4 * M;...
[["-", 8, 9, 0, 57, 15, 339, 51, 16, 17, 47], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 17, 20]]
1
172
#include <bits/stdc++.h> using namespace std; typedef long long ll; const int maxn = 2e5 + 10; int a[2020]; int main() { int n, m; cin >> n >> m; ll sum = 0; for (int i = 1; i <= n; i++) { cin >> a[i]; sum += a[i]; } int cnt = 0; for (int i = 1; i <= n; i++) { if (a[i] * 4 * m > sum) cnt...
#include <bits/stdc++.h> using namespace std; typedef long long ll; const int maxn = 2e5 + 10; int a[2020]; int main() { int n, m; cin >> n >> m; ll sum = 0; for (int i = 1; i <= n; i++) { cin >> a[i]; sum += a[i]; } int cnt = 0; for (int i = 1; i <= n; i++) { if (a[i] * 4 * m >= sum) cn...
[["-", 8, 9, 0, 57, 15, 339, 51, 16, 17, 47], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 17, 20]]
1
149
#include <bits/stdc++.h> using namespace std; int main() { int n, m; cin >> n >> m; vector<int> arr; for (int i = 0; i < n; i++) { int temp; cin >> temp; arr.push_back(temp); } int flag = 0; int sum = accumulate(arr.begin(), arr.end(), 0); sort(arr.begin(), arr.end(), greater<int>()); for ...
#include <bits/stdc++.h> using namespace std; int main() { int n, m; cin >> n >> m; vector<int> arr; for (int i = 0; i < n; i++) { int temp; cin >> temp; arr.push_back(temp); } int flag = 0; int sum = accumulate(arr.begin(), arr.end(), 0); sort(arr.begin(), arr.end(), greater<int>()); for ...
[["+", 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
165
def resolve(): N, M, *A = map(int, open(0).read().split()) vote = sum(A) / (4*M) num = list(filter(lambda x: x > vote, A)) num = len(num) if num >= M: print("Yes") else: print("No") resolve()
def resolve(): N, M, *A = map(int, open(0).read().split()) vote = sum(A) * (1 / (4*M)) num = list(filter(lambda x: x >= vote, A)) num = len(num) if num >= M: print("Yes") else: print("No") resolve()
[["+", 8, 196, 0, 1, 0, 662, 12, 657, 17, 48], ["+", 0, 1, 0, 662, 12, 657, 12, 23, 0, 24], ["+", 0, 662, 12, 657, 12, 23, 0, 657, 31, 612], ["+", 12, 657, 12, 23, 0, 657, 12, 23, 0, 25], ["-", 0, 652, 3, 4, 0, 670, 8, 666, 667, 47], ["+", 0, 652, 3, 4, 0, 670, 8, 666, 667, 20]]
5
85
#include <bits/stdc++.h> using namespace std; void PDF(int B[], int o, int k) { int c, y, r, s = 0, t = 0, i; float l; l = (float)1 / (4 * k); for (i = 0; i < o; i++) { s = s + B[i]; } r = s * l; for (i = 0; i < o; i++) { if (B[i] >= r) { t++; } } if (t >= k) { cout << "Yes" << e...
#include <bits/stdc++.h> using namespace std; void PDF(int B[], int o, int k) { int c, y, s = 0, t = 0, i; float l, r; l = (float)1 / (4 * k); for (i = 0; i < o; i++) { s = s + B[i]; } r = s * l; for (i = 0; i < o; i++) { if (B[i] >= r) { t++; } } if (t >= k) { cout << "Yes" << e...
[["-", 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]]
1
204
#include <bits/stdc++.h> using namespace std; typedef long long int ll; typedef long int li; const ll mod = 1000000007; const ll inf = 1000000000000000000; typedef vector<int> vi; typedef vector<li> vli; typedef vector<ll> vll; typedef vector<string> vs; typedef vector<vi> vvi; typedef vector<vli> vvli; typedef vect...
#include <bits/stdc++.h> using namespace std; typedef long long int ll; typedef long int li; const ll mod = 1000000007; const ll inf = 1000000000000000000; typedef vector<int> vi; typedef vector<li> vli; typedef vector<ll> vll; typedef vector<string> vs; typedef vector<vi> vvi; typedef vector<vli> vvli; typedef vect...
[["-", 8, 9, 0, 57, 15, 339, 51, 16, 12, 22], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 12, 22]]
1
333
#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(), greater<int>()); int sum = accumulate(A.begin(), A.end(), 0); double thr = ((double)sum) / (4.0 * M); string ret = ((double)A[M ...
#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(), greater<int>()); int sum = accumulate(A.begin(), A.end(), 0); double thr = ((double)sum) / (4.0 * M); string ret = ((double)A[M...
[["-", 49, 50, 51, 41, 15, 23, 0, 16, 17, 47], ["+", 49, 50, 51, 41, 15, 23, 0, 16, 17, 20]]
1
143
import java.util.ArrayList; import java.util.List; import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner scanner = new Scanner(System.in); List<Integer> list = new ArrayList<Integer>(); int n = scanner.nextInt(); int m = scanner.nextInt(); int sumVotes ...
import java.util.ArrayList; import java.util.List; import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner scanner = new Scanner(System.in); List<Integer> list = new ArrayList<Integer>(); int n = scanner.nextInt(); int m = scanner.nextInt(); int sumVotes =...
[["-", 0, 195, 8, 196, 0, 503, 39, 506, 0, 507], ["+", 0, 195, 8, 196, 0, 503, 39, 511, 0, 512], ["-", 51, 23, 0, 16, 12, 23, 0, 16, 31, 499], ["+", 51, 23, 0, 16, 12, 23, 0, 16, 31, 515], ["+", 0, 57, 15, 15, 0, 16, 31, 74, 0, 24], ["+", 15, 15, 0, 16, 31, 74, 39, 511, 0, 512], ["+", 0, 57, 15, 15, 0, 16, 31, 74, 0, 2...
3
191
#include <iostream> using namespace std; int main() { int N, M, a[1002], sel = 0, sum = 0; std::cin >> N >> M; for (int i = 1; i <= N; i++) { std::cin >> a[i]; sum += a[i]; } sum = sum / (4 * M); for (int i = 1; i <= N; i++) { if (a[i] >= sum) sel++; if (sel == M) break; } ...
#include <iostream> using namespace std; int main() { float N, M, a[1002], sel = 0, sum = 0; std::cin >> N >> M; for (int i = 1; i <= N; i++) { std::cin >> a[i]; sum += a[i]; } sum = sum / (4 * M); for (int i = 1; i <= N; i++) { if (a[i] >= sum) sel++; if (sel == M) break; ...
[["-", 0, 30, 0, 14, 8, 9, 0, 43, 39, 40], ["+", 0, 30, 0, 14, 8, 9, 0, 43, 39, 40]]
1
139
#include <iostream> using namespace std; int main() { int n, m, A[105]; int vsum = 0, count = 0; cin >> n >> m; for (int i = 0; i < n; i++) { cin >> A[i]; vsum += A[i]; } for (int i = 0; i < n; i++) { if (vsum / (4 * m) < A[i] && vsum % (4 * m)) count++; if (vsum / (4 * m) <= A[i] ...
#include <iostream> using namespace std; int main() { int n, m, A[105]; int vsum = 0, count = 0; cin >> n >> m; for (int i = 0; i < n; i++) { cin >> A[i]; vsum += A[i]; } for (int i = 0; i < n; i++) { if (vsum / (4 * m) < A[i] && vsum % (4 * m)) count++; else if (vsum / (4 * m) <= ...
[["+", 0, 7, 8, 9, 0, 57, 75, 76, 0, 95], ["-", 0, 57, 15, 339, 51, 16, 12, 16, 17, 72], ["-", 0, 57, 15, 339, 51, 16, 12, 16, 12, 13], ["+", 0, 57, 15, 339, 51, 16, 12, 16, 17, 60], ["+", 0, 57, 15, 339, 51, 16, 12, 16, 12, 13]]
1
163
import java.util.Arrays; 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[] shohinArray = new int[n]; for (int i = 0; i < n; i++) { shohinArray[i] = sc.nextInt(); ...
import java.util.Arrays; 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[] shohinArray = new int[n]; for (int i = 0; i < n; i++) { shohinArray[i] = sc.nextInt(); ...
[["-", 49, 200, 51, 16, 31, 23, 0, 16, 12, 499], ["+", 49, 200, 51, 16, 31, 23, 0, 16, 12, 499], ["-", 8, 196, 0, 503, 49, 200, 51, 16, 31, 499], ["+", 8, 196, 0, 503, 49, 200, 51, 16, 31, 499]]
3
193
n,m = map(int, input().split()) a = list(map(int, input().split())) a_sort = sorted(a, reverse=True) if a_sort[m-1] >= sum(a)// (4*m): print("Yes") else: print("No")
n,m = map(int, input().split()) a = list(map(int, input().split())) a_sort = sorted(a, reverse=True) if a_sort[m-1] >= sum(a) / (4*m): print("Yes") else: print("No")
[["-", 0, 656, 0, 57, 15, 666, 0, 657, 17, 676], ["+", 0, 656, 0, 57, 15, 666, 0, 657, 17, 85]]
5
76
#include <algorithm> #include <iostream> #include <vector> int main() { int m, n; std::cin >> n >> m; std::vector<int> v; int sum = 0; for (int i = 0; i < n; i++) { int t; std::cin >> t; v.push_back(t); sum = sum + t; } std::sort(v.rbegin(), v.rend()); if (v[m - 1] >= sum / (4 * m)) { ...
#include <algorithm> #include <iostream> #include <vector> int main() { int m, n; std::cin >> n >> m; std::vector<int> v; float sum = 0; for (int i = 0; i < n; i++) { int t; std::cin >> t; v.push_back(t); sum = sum + t; } std::sort(v.rbegin(), v.rend()); if (v[m - 1] >= sum / (4 * m)) { ...
[["-", 0, 30, 0, 14, 8, 9, 0, 43, 39, 40], ["+", 0, 30, 0, 14, 8, 9, 0, 43, 39, 40]]
1
142
import java.util.*; public class Main { public static void main(String[] args) { Scanner scanner = new Scanner(System.in); int N = scanner.nextInt(); int M = scanner.nextInt(); Integer[] nums = new Integer[N]; int sum = 0; for (int i = 0; i < nums.length; i++) { int a = scanner.nextInt...
import java.util.*; public class Main { public static void main(String[] args) { Scanner scanner = new Scanner(System.in); int N = scanner.nextInt(); int M = scanner.nextInt(); Integer[] nums = new Integer[N]; int sum = 0; for (int i = 0; i < nums.length; i++) { int a = scanner.nextInt...
[["-", 49, 200, 51, 16, 12, 23, 0, 16, 31, 499], ["+", 49, 200, 51, 16, 12, 23, 0, 16, 31, 515]]
3
175
#include <bits/stdc++.h> using namespace std; int main() { int n, m, sum; cin >> n >> m; vector<int> vec(n); sum = 0; for (int i = 0; i < n; i++) { cin >> vec.at(i); sum += vec.at(i); } sort(vec.begin(), vec.end(), greater<int>()); if (vec.at(m - 1) < sum / (4 * m)) { cout << "No" << end...
#include <bits/stdc++.h> using namespace std; int main() { int n, m, sum; cin >> n >> m; vector<int> vec(n); sum = 0; for (int i = 0; i < n; i++) { cin >> vec.at(i); sum += vec.at(i); } sort(vec.begin(), vec.end(), greater<int>()); if (vec.at(m - 1) * 4 * m < sum) { cout << "No" << endl;...
[["-", 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
134
N,M=map(int,input().split()) A=list(map(int,input().split())) ALL=sum(A) ave=ALL/(4*M) count=0 for i in range(N): if(A[i]>=ave): count+=1 else: pass if(count>M): print("Yes") else: print("No")
N,M=map(int,input().split()) A=list(map(int,input().split())) ALL=sum(A) ave=ALL/(4*M) count=0 for i in range(N): if(A[i]>=ave): count+=1 else: pass if(count>=M): print("Yes") else: print("No")
[["-", 0, 656, 0, 57, 15, 23, 0, 666, 667, 47], ["+", 0, 656, 0, 57, 15, 23, 0, 666, 667, 20]]
5
96
#include <bits/stdc++.h> 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.at(i); } int sum = 0; for (int i = 0; i < N; i++) { sum += A.at(i); } int cnt = 0; for (int i = 0; i < N; i++) { if (A.at(i) >= sum / (4 *...
#include <bits/stdc++.h> 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.at(i); } int sum = 0; for (int i = 0; i < N; i++) { sum += A.at(i); } int cnt = 0; for (int i = 0; i < N; i++) { if (A.at(i) >= (float)sum...
[["+", 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
155
N, M = map(int, input().split()) A = list(map(int, input().split())) cnt = 0 cnt1 = 0 for i in range(N): cnt = cnt + A[i] for i in range(N): if A[i] / cnt > 1 / 4 / M: cnt1 = cnt1 + 1 if cnt1 > M: print('Yes') else: print('No')
N, M = map(int, input().split()) A = list(map(int, input().split())) cnt = 0 cnt1 = 0 for i in range(N): cnt = cnt + A[i] for i in range(N): if A[i] / cnt >= 1 / 4 / M: cnt1 = cnt1 + 1 if cnt1 >= 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], ["-", 36, 36, 0, 656, 0, 57, 15, 666, 667, 47], ["+", 36, 36, 0, 656, 0, 57, 15, 666, 667, 20]]
5
101
import numpy as np tmp = list(map(int, input().split())) N = tmp[0] M = tmp[1] i = list(map(int, input().split())) i = np.array(i) i = np.sort(i)[::-1] souwa = np.sum(i) if i[M] < (souwa * (1/(4*M))): print("No") else: print("Yes") # print(i[0]) #出力:i_1 # print(i[1]) #出力:i_2
import numpy as np tmp = list(map(int, input().split())) N = tmp[0] M = tmp[1] i = list(map(int, input().split())) i = np.array(i) i = np.sort(i)[::-1] souwa = np.sum(i) if i[M-1] < (souwa * (1/(4*M))): print("No") else: print("Yes") # print(i[0]) #出力:i_1 # print(i[1]) #出力:i_2
[["+", 0, 57, 15, 666, 0, 206, 206, 657, 17, 33], ["+", 0, 57, 15, 666, 0, 206, 206, 657, 12, 612]]
5
116
#include <stdio.h> int main(void) { int N, M; int A[100]; int limen; int sumVote = 0; int ok = 0; scanf("%d %d", &N, &M); for (int i = 0; i < N; i++) { scanf("%d", &A[i]); sumVote += A[i]; } limen = sumVote / (4 * M); for (int i = 0; i < N; i++) { if (A[i] >= limen) ok++; ...
#include <stdio.h> int main(void) { int N, M; int A[100]; float limen; int sumVote = 0; int ok = 0; scanf("%d %d", &N, &M); for (int i = 0; i < N; i++) { scanf("%d", &A[i]); sumVote += A[i]; } limen = sumVote / (4.0 * M); for (int i = 0; i < N; i++) { if (A[i] >= limen) ok++;...
[["-", 0, 30, 0, 14, 8, 9, 0, 43, 39, 40], ["+", 0, 30, 0, 14, 8, 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]]
1
154
N,M=(int(x) for x in input().split()) A = list(map(int, input().split())) list.sort(A,reverse = True) s=float(sum(A)/(4*M)) check=0 for i in range(0, M): if A[i]<=s: check=1 if check ==1: print('No') else: print('Yes')
N,M=(int(x) for x in input().split()) A = list(map(int, input().split())) list.sort(A,reverse = True) s=float(sum(A)/(4*M)) check=0 for i in range(0, M): if A[i]<s: check=1 if check ==1: 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
105
def main(): N,M = map(int,input().split()) A = list(map(int,input().split())) G = sum(A) list.sort(A, reverse=True) i = 0 while i < M: if A[i] / G < 1 / 4 * M: return "No" break i += 1 return "Yes" print(main())
def main(): N,M = map(int,input().split()) A = list(map(int,input().split())) G = sum(A) list.sort(A, reverse=True) i = 0 while i < M: if A[i] / G < 1 / (4 * M): return "No" break i += 1 return "Yes" print(main())
[["+", 0, 57, 15, 666, 0, 657, 12, 23, 0, 24], ["+", 0, 57, 15, 666, 0, 657, 12, 23, 0, 25]]
5
94
#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]; int sum = 0; for (int i = 0; i < n; i++) sum += a[i]; int count = 0; double border = sum / (4 * m); for (int i = 0; i < n; i++) { if (a[i] >= bor...
#include <bits/stdc++.h> using namespace std; int main() { int n, m; cin >> n >> m; vector<double> a(n); for (int i = 0; i < n; i++) cin >> a[i]; double sum = 0; for (int i = 0; i < n; i++) sum += a[i]; int count = 0; double border = sum / (4 * m); for (int i = 0; i < n; i++) { if (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
146
input_d21 = list(map(int, input().split())) input_d22 = list(map(int, input().split())) N = input_d21[0] M = input_d21[1] A = input_d22 sohyo = sum(A) zyoken = float(sohyo) // (4 * M) A = sorted(A, reverse=True) if A[M-1] >= zyoken: print('Yes') else: print('No')
input_d21 = list(map(int, input().split())) input_d22 = list(map(int, input().split())) N = input_d21[0] M = input_d21[1] A = input_d22 sohyo = sum(A) zyoken = float(sohyo) / float(4 * M) A = sorted(A, reverse=True) if A[M-1] >= zyoken: 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, 1, 0, 662, 12, 657, 12, 652, 63, 22]]
5
101
#include <bits/stdc++.h> using namespace std; int main() { int n, m; cin >> n >> m; int a[n]; int sum = 0; int ca = 1; for (int i = 0; i < n; ++i) { cin >> a[i]; sum += a[i]; } sort(a, a + n, greater<>()); double b = sum / (4 * m); for (int i = 0; i < m; ++i) { if (a[i] < b) { ca...
#include <bits/stdc++.h> using namespace std; int main() { int n, m; cin >> n >> m; int a[n]; int sum = 0; int ca = 1; for (int i = 0; i < n; ++i) { cin >> a[i]; sum += a[i]; } sort(a, a + n, greater<>()); double b = (double)sum / (double)(4 * m); for (int i = 0; i < m; ++i) { if (a[i]...
[["+", 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
154
#include <bits/stdc++.h> using namespace std; int main() { int n, m; cin >> n >> m; int a[n], sum = 0; for (int i = 0; i < n; i++) { cin >> a[i]; sum += a[i]; } int tmp = sum / (4 * m); int cnt = 0; for (int i = 0; i < n; i++) { if (a[i] >= tmp) cnt++; } if (cnt >= m) cout << ...
#include <bits/stdc++.h> using namespace std; int main() { int n, m; cin >> n >> m; int a[n], sum = 0; for (int i = 0; i < n; i++) { cin >> a[i]; sum += a[i]; } int tmp = ceil((float)sum / (4 * m)); int cnt = 0; for (int i = 0; i < n; i++) { if (a[i] >= tmp) cnt++; } if (cnt >= m)...
[["+", 8, 9, 0, 43, 49, 50, 51, 2, 63, 22], ["+", 0, 43, 49, 50, 51, 2, 3, 4, 0, 24], ["+", 51, 2, 3, 4, 0, 16, 31, 74, 0, 24], ["+", 3, 4, 0, 16, 31, 74, 39, 77, 39, 40], ["+", 51, 2, 3, 4, 0, 16, 31, 74, 0, 25], ["+", 51, 2, 3, 4, 0, 16, 12, 23, 0, 25]]
1
126
#include <algorithm> #include <iostream> #include <map> #include <math.h> #include <queue> #include <set> #include <stdlib.h> #include <string.h> #include <string> #include <tuple> #include <vector> #define rep(i, n) for (int i = 0; i < (n); ++i) using namespace std; #define PI 3.14159265358979 typedef long long int ll...
#include <algorithm> #include <iostream> #include <map> #include <math.h> #include <queue> #include <set> #include <stdlib.h> #include <string.h> #include <string> #include <tuple> #include <vector> #define rep(i, n) for (int i = 0; i < (n); ++i) using namespace std; #define PI 3.14159265358979 typedef long long int ll...
[["-", 0, 16, 12, 23, 0, 41, 15, 16, 17, 47], ["+", 0, 16, 12, 23, 0, 41, 15, 16, 17, 20]]
1
160
#include <algorithm> #include <iostream> #include <string> using namespace std; int main(void) { int n, m; int A[100]; cin >> n >> m; for (int i = 0; i < n; i++) { cin >> A[i]; } int sum = 0; for (int i = 0; i < n; i++) { sum += A[i]; } std::sort(A, A + n, std::greater<>()); for (int i...
#include <algorithm> #include <iostream> #include <string> using namespace std; int main(void) { int n, m; int A[100]; cin >> n >> m; for (int i = 0; i < n; i++) { cin >> A[i]; } int sum = 0; for (int i = 0; i < n; i++) { sum += A[i]; } std::sort(A, A + n, std::greater<>()); for (int i...
[["+", 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], ["-", 51, 16, 12, 16, 12, 23, 0, 16, 31, 13], ["+", 51, 16, 12, 16, 12, 23, 0, 16, 31, 13]]
1
166
#include <bits/stdc++.h> using namespace std; #define ll long long #define endl '\n' #ifndef _WINDOWS // no getchar_unlocked on Windows so just call getchar #define getchar getchar_unlocked #endif template <typename Func> inline void loop(int e, Func &&f) { for (int i = 0; i < e; i++) { std::forward<Func>(f)(i)...
#include <bits/stdc++.h> using namespace std; #define ll long long #define endl '\n' #ifndef _WINDOWS // no getchar_unlocked on Windows so just call getchar #define getchar getchar_unlocked #endif template <typename Func> inline void loop(int e, Func &&f) { for (int i = 0; i < e; i++) { std::forward<Func>(f)(i)...
[["-", 0, 14, 8, 9, 0, 1, 0, 11, 31, 22], ["+", 0, 30, 0, 14, 8, 9, 0, 43, 39, 40], ["+", 0, 14, 8, 9, 0, 43, 49, 50, 49, 22], ["+", 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, 12, 22], ["+", 8, 9,...
1
317
/* package codechef; // don't place package name! */ import java.io.*; import java.lang.*; import java.util.*; /* Name of the class has to be "Main" only if the class is public. */ public class Main { public static void main(String[] args) throws java.lang.Exception { try { Scanner sc = new Scanner(System...
/* package codechef; // don't place package name! */ import java.io.*; import java.lang.*; import java.util.*; /* Name of the class has to be "Main" only if the class is public. */ public class Main { public static void main(String[] args) throws java.lang.Exception { try { Scanner sc = new Scanner(System...
[["-", 8, 196, 0, 57, 15, 15, 0, 16, 17, 47], ["+", 8, 196, 0, 57, 15, 15, 0, 16, 17, 20]]
3
208