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 <iostream> #include <numeric> #include <vector> #define rep(i, n) for (int i = 0; i < n; i++) using namespace std; int main() { int n, m; int threshold = 0; cin >> n >> m; vector<int> vote(n, 0); rep(i, n) cin >> vote[i]; threshold = accumulate(vote.begin(), vote.end(), 0); threshold = threshold ...
#include <iostream> #include <numeric> #include <vector> #define rep(i, n) for (int i = 0; i < n; i++) using namespace std; int main() { int n, m; float threshold = 0; cin >> n >> m; vector<int> vote(n, 0); rep(i, n) cin >> vote[i]; threshold = accumulate(vote.begin(), vote.end(), 0); threshold = threshol...
[["-", 0, 30, 0, 14, 8, 9, 0, 43, 39, 40], ["+", 0, 30, 0, 14, 8, 9, 0, 43, 39, 40]]
1
144
#include <bits/stdc++.h> using namespace std; #define rep(i, n) for (int i = 0; i < (int)(n); i++) typedef long long ll; int main() { int n, m; cin >> n >> m; vector<int> a(n); rep(i, n) cin >> a[i]; double suma = 0; rep(i, n) suma += a[i]; suma = suma / (4 * m); int cnt = 0; rep(i, n) { if (a[...
#include <bits/stdc++.h> using namespace std; #define rep(i, n) for (int i = 0; i < (int)(n); i++) typedef long long ll; int main() { int n, m; cin >> n >> m; vector<int> a(n); rep(i, n) cin >> a[i]; double suma = 0; rep(i, n) suma += a[i]; suma = suma / (4 * m); int cnt = 0; rep(i, n) { if (a[...
[["-", 8, 9, 0, 57, 15, 339, 51, 16, 17, 47], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 17, 20]]
1
141
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 A[] = new int[N]; for (int i = 0; i < N; i++) { A[i] = sc.nextInt(); } for (int i = 0; i < N; i++) { f...
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 A[] = new int[N]; for (int i = 0; i < N; i++) { A[i] = sc.nextInt(); } for (int i = 0; i < N; i++) { f...
[["-", 0, 195, 8, 196, 0, 503, 39, 506, 0, 507], ["+", 0, 195, 8, 196, 0, 503, 39, 511, 0, 512]]
3
240
#include <cstdio> int main() { int n, m, sum = 0, ans = 0; scanf("%d%d", &n, &m); int a[n]; for (int i = 0; i < n; i++) { scanf("%d", &a[i]); sum = sum + a[i]; } sum = sum / (m * 4); for (int i = 0; i < n; i++) { if (a[i] >= sum) ans++; } if (ans >= m) printf("Yes\n"); else ...
#include <cstdio> int main() { int n, m, ans = 0; double sum = 0; scanf("%d%d", &n, &m); int a[n]; for (int i = 0; i < n; i++) { scanf("%d", &a[i]); sum = sum + a[i]; } sum = sum / (m * 4); for (int i = 0; i < n; i++) { if (a[i] >= sum) ans++; } if (ans >= m) printf("Yes\n"); ...
[["-", 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]]
1
139
n,m = [int(v) for v in input().split()] a = [int(v) for v in input().split()] all_a = sum(a) flag = True a.sort(reverse=True) for i in range(m): if a[i] <= (all_a / (4 * m)): flag = False if flag: print("Yes") else: print("No")
n,m = [int(v) for v in input().split()] a = [int(v) for v in input().split()] all_a = sum(a) flag = True a.sort(reverse=True) for i in range(m): if a[i] < (all_a / (4 * m)): flag = False if flag: print("Yes") else: print("No")
[["-", 0, 7, 8, 196, 0, 57, 15, 666, 667, 19], ["+", 0, 7, 8, 196, 0, 57, 15, 666, 667, 18]]
5
99
#include <bits/stdc++.h> using namespace std; int main() { int n, m; cin >> n >> m; int a[n]; int count = 0; for (int i = 0; i < n; i++) { cin >> a[i]; count = count + a[i]; } double cond = count / (m * 4); sort(a, a + n, greater<>()); if (a[m - 1] >= cond) { cout << "Yes" << endl; ...
#include <bits/stdc++.h> using namespace std; int main() { int n, m; cin >> n >> m; int a[n]; double count = 0; for (int i = 0; i < n; i++) { cin >> a[i]; count = count + a[i]; } double cond = count / (m * 4); sort(a, a + n, greater<>()); if (a[m - 1] >= cond) { cout << "Yes" << endl; ...
[["-", 0, 30, 0, 14, 8, 9, 0, 43, 39, 40], ["+", 0, 30, 0, 14, 8, 9, 0, 43, 39, 40]]
1
127
#include <bits/stdc++.h> using namespace std; int main() { int N, M, l = 0, k = 0; cin >> N >> M; vector<int> item(N); for (int i = 0; i < N; i++) { cin >> item.at(i); k += item.at(i); } for (int j = 0; j < N; j++) { if (item.at(j) >= k / (4 * M)) { l += 1; } } if (l >= M) { c...
#include <bits/stdc++.h> using namespace std; int main() { double N, M, l = 0, k = 0; cin >> N >> M; vector<int> item(N); for (int i = 0; i < N; i++) { cin >> item.at(i); k += item.at(i); } for (int j = 0; j < N; j++) { if (item.at(j) >= k / (4 * M)) { l += 1; } } if (l >= M) { ...
[["-", 0, 30, 0, 14, 8, 9, 0, 43, 39, 40], ["+", 0, 30, 0, 14, 8, 9, 0, 43, 39, 40]]
1
140
#include <bits/stdc++.h> #define ll long long #define vi vector<int> #define vll vector<long long> #define si set<int> #define stk stack<int> #define que queue<int> #define pb push_back #define ff first #define ss second #define pii pair<int, int> #define pll pair<ll, ll> #define IOS ...
#include <bits/stdc++.h> #define ll long long #define vi vector<int> #define vll vector<long long> #define si set<int> #define stk stack<int> #define que queue<int> #define pb push_back #define ff first #define ss second #define pii pair<int, int> #define pll pair<ll, ll> #define IOS ...
[["+", 51, 16, 12, 16, 12, 74, 39, 77, 39, 40], ["+", 15, 339, 51, 16, 12, 16, 12, 74, 0, 25], ["+", 51, 16, 12, 16, 12, 74, 51, 23, 0, 24]]
1
206
#include <bits/stdc++.h> using namespace std; int main() { int n, m; string ans = "No"; cin >> n >> m; vector<int> a(n, 0); int total = 0; for (int i = 0; i < n; i++) { cin >> a[i]; total += a[i]; } int c = 0; for (int i = 0; i < n; i++) { if (a[i] >= total / (4 * m)) { c++; ...
#include <bits/stdc++.h> using namespace std; int main() { int n, m; string ans = "No"; cin >> n >> m; vector<int> a(n, 0); int total = 0; for (int i = 0; i < n; i++) { cin >> a[i]; total += a[i]; } int c = 0; for (int i = 0; i < n; i++) { if (a[i] >= (double)total / (4 * m)) { ...
[["+", 15, 339, 51, 16, 12, 16, 31, 74, 0, 24], ["+", 51, 16, 12, 16, 31, 74, 39, 77, 39, 40], ["+", 15, 339, 51, 16, 12, 16, 31, 74, 0, 25]]
1
139
#include <bits/stdc++.h> using namespace std; int main() { int A; double B; cin >> A >> B; vector<int> num(A); for (int i = 0; i < A; i++) { cin >> num.at(i); } double sum = 0; for (int i = 0; i < A; i++) { sum += num.at(i); } double ssum = sum / (4 * B); int ccount = 0; sort(num.be...
#include <bits/stdc++.h> using namespace std; int main() { int A; double B; cin >> A >> B; vector<int> num(A); for (int i = 0; i < A; i++) { cin >> num.at(i); } double sum = 0; for (int i = 0; i < A; i++) { sum += num.at(i); } double ssum = sum / (4 * B); int ccount = 0; sort(num.be...
[["-", 8, 9, 0, 57, 15, 339, 51, 11, 17, 32], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 17, 60]]
1
193
N, M = map(int, input().split()) A = list(map(int, input().split())) total, count = 0, 0 for i in range(N): total += A[i] for i in range(N): if(A[i] >= (total//(M*4))): count+=1 if(count>=M): print("Yes") else: print("No")
N, M = map(int, input().split()) A = list(map(int, input().split())) total, count = 0, 0 for i in range(N): total += A[i] for i in range(N): if(A[i] >= total/(M*4)): count+=1 if(count>=M): print("Yes") else: print("No")
[["-", 0, 57, 15, 23, 0, 666, 0, 23, 0, 24], ["-", 15, 23, 0, 666, 0, 23, 0, 657, 17, 676], ["+", 0, 57, 15, 23, 0, 666, 0, 657, 17, 85], ["-", 0, 666, 0, 23, 0, 657, 12, 23, 0, 25]]
5
104
#include <iostream> using namespace std; int main() { int N, M; cin >> N >> M; int A[N]; int count = 0; int sum = 0; for (int i = 0; i < N; i++) { cin >> A[i]; sum += A[i]; } for (int i = 0; i < N; i++) { if (sum / (4 * M) > A[i]) { count++; } } if (N - count < M) { co...
#include <iostream> using namespace std; int main() { int N; long double M; cin >> N >> M; int A[N]; int count = 0; long double sum = 0; for (int i = 0; i < N; i++) { cin >> A[i]; sum += A[i]; } for (int i = 0; i < N; i++) { if (sum / (4 * M) > A[i]) { count++; } } if (N...
[["-", 0, 30, 0, 14, 8, 9, 0, 43, 0, 21], ["+", 0, 30, 0, 14, 8, 9, 0, 43, 0, 35], ["+", 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]]
1
136
N, M = map(int, input().split()) List = list(map(int, input().split())) total = 0 for n in range(N): total += List[n] limit = total/(4*M) count = 0 for n in range(N): if List[n] >= limit: count += 1 if count >= M: print("yes") else: print("no")
N, M = map(int, input().split()) List = list(map(int, input().split())) total = 0 for n in range(N): total += List[n] limit = total/(4*M) count = 0 for n in range(N): if List[n] >= limit: count += 1 if count >= M: print("Yes") else: print("No")
[["-", 0, 1, 0, 652, 3, 4, 0, 557, 0, 6], ["+", 0, 1, 0, 652, 3, 4, 0, 557, 0, 6]]
5
100
#include <bits/stdc++.h> using namespace std; using ll = long long int; int main() { int N, M; cin >> N >> M; vector<int> A(N, 0); 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); } sort(A.begin(), A.end()); reverse(A.begin(), A.e...
#include <bits/stdc++.h> using namespace std; using ll = long long int; int main() { int N, M; cin >> N >> M; vector<int> A(N, 0); 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); } sort(A.begin(), A.end()); reverse(A.begin(), A.e...
[["+", 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
181
import java.util.ArrayList; import java.util.Scanner; public class Main { public static void main(String[] args) { // TODO 自動生成されたメソッド・スタブ Scanner sc = new Scanner(System.in); int N = sc.nextInt(); int M = sc.nextInt(); long totalNum = 0; ArrayList<Integer> numListN = new ArrayList<Intege...
import java.util.ArrayList; import java.util.Scanner; public class Main { public static void main(String[] args) { // TODO 自動生成されたメソッド・スタブ Scanner sc = new Scanner(System.in); int N = sc.nextInt(); int M = sc.nextInt(); double totalNum = 0; ArrayList<Integer> numListN = new ArrayList<Inte...
[["-", 0, 195, 8, 196, 0, 503, 39, 506, 0, 96], ["+", 0, 195, 8, 196, 0, 503, 39, 511, 0, 512]]
3
294
#include <iostream> #include <stdio.h> #include <string> using namespace std; int main() { int n, m, i, x[100], s = 0, k = 0; cin >> n >> m; for (i = 0; i < n; i++) { cin >> x[i]; s = s + x[i]; } for (i = 0; i < n; i++) if (x[i] * 4 * (i + 1) >= s) k++; if (k >= m) cout << "Yes"; els...
#include <iostream> #include <stdio.h> #include <string> using namespace std; int main() { int n, m, i, x[100], s = 0, k = 0; cin >> n >> m; for (i = 0; i < n; i++) { cin >> x[i]; s = s + x[i]; } for (i = 0; i < n; i++) if (x[i] * 4 * m >= s) k++; if (k >= m) cout << "Yes"; else ...
[["-", 15, 339, 51, 16, 31, 16, 12, 23, 0, 24], ["-", 51, 16, 31, 16, 12, 23, 0, 16, 31, 22], ["-", 51, 16, 31, 16, 12, 23, 0, 16, 17, 72], ["-", 51, 16, 31, 16, 12, 23, 0, 16, 12, 13], ["-", 15, 339, 51, 16, 31, 16, 12, 23, 0, 25], ["+", 8, 57, 15, 339, 51, 16, 31, 16, 12, 22]]
1
125
#include <algorithm> #include <cmath> #include <iostream> #include <set> #include <string> #include <vector> using namespace std; int main() { int N, M; cin >> N >> M; vector<int> A(N); int sum = 0; for (int i = 0; i < N; i++) { cin >> A[i]; sum += A[i]; } // cout << "s" <<sum << endl; sort(...
#include <algorithm> #include <cmath> #include <iostream> #include <set> #include <string> #include <vector> using namespace std; int main() { int N, M; cin >> N >> M; vector<int> A(N); double sum = 0; for (int i = 0; i < N; i++) { cin >> A[i]; sum += A[i]; } // cout << "s" <<sum << endl; so...
[["-", 0, 30, 0, 14, 8, 9, 0, 43, 39, 40], ["+", 0, 30, 0, 14, 8, 9, 0, 43, 39, 40], ["+", 0, 57, 15, 339, 51, 16, 12, 74, 0, 24], ["+", 15, 339, 51, 16, 12, 74, 39, 77, 39, 40], ["+", 0, 57, 15, 339, 51, 16, 12, 74, 0, 25]]
1
138
n,m=map(int,input().split()) a=list(map(int,input().split())) ans=0 for i in range(n): if a[i]>=sum(a)//4//m: ans+=1 if ans>=m: print("Yes") else: print("No")
n,m=map(int,input().split()) a=list(map(int,input().split())) ans=0 for i in range(n): if a[i]>=sum(a)/4/m: #以上なら選ぶ ans+=1 if ans>=m: print("Yes") else: print("No")
[["-", 0, 57, 15, 666, 0, 657, 31, 657, 17, 676], ["+", 0, 57, 15, 666, 0, 657, 31, 657, 17, 85], ["-", 8, 196, 0, 57, 15, 666, 0, 657, 17, 676], ["+", 8, 196, 0, 57, 15, 666, 0, 657, 17, 85]]
5
81
n,m = map(int, input().split()) i = list(map(int, input().split())) j=sorted(i, reverse=True) # print(n) # print(m) # print(i) # print(j) # print(j[m-1]) # print(sum(i)) # print(sum(i)/(4*m)) if j[m-1]>sum(i)/(4*m): print("Yes") else: print("No")
n,m = map(int, input().split()) i = list(map(int, input().split())) j=sorted(i, reverse=True) if j[m-1]>=sum(i)/(4*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
83
n, m = map(int, input().split()) a = list(map(int, input().split())) t = sum(a)// (4 * m) c = [i for i in a if i >= t] if len(c) >= m: print('Yes') else: print('No')
n, m = map(int, input().split()) a = list(map(int, input().split())) t = sum(a)/ (4 * m) c = [i for i in a if i >= t] if len(c) >= 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
80
#include <algorithm> #include <bits/stdc++.h> #include <vector> using namespace std; int main() { ios_base::sync_with_stdio(false); cin.tie(NULL); int n, m; cin >> n >> m; int k; vector<int> v; int sum = 0; for (int i = 0; i < n; i++) { cin >> k; v.push_back(k); sum += k; } sort(v.begi...
#include <algorithm> #include <bits/stdc++.h> #include <vector> using namespace std; int main() { ios_base::sync_with_stdio(false); cin.tie(NULL); int n, m; cin >> n >> m; int k; vector<int> v; float sum = 0; for (int i = 0; i < n; i++) { cin >> k; v.push_back(k); sum += k; // cout<<v[...
[["-", 0, 30, 0, 14, 8, 9, 0, 43, 39, 40], ["+", 0, 30, 0, 14, 8, 9, 0, 43, 39, 40]]
1
143
#include <bits/stdc++.h> #define rep(i, a, n) for (int i = (int)(a); i <= (int)(n); ++i) #define rrep(i, a, n) for (int i = (int)(a); i >= (int)(n); --i) #define debug(x) cerr << #x << " = " << x << "\n" #define debugv(x) \ rep(f, 0, (x.size() - 1)) cerr <<...
#include <bits/stdc++.h> #define rep(i, a, n) for (int i = (int)(a); i <= (int)(n); ++i) #define rrep(i, a, n) for (int i = (int)(a); i >= (int)(n); --i) #define debug(x) cerr << #x << " = " << x << "\n" #define debugv(x) \ rep(f, 0, (x.size() - 1)) cerr <<...
[["-", 8, 9, 0, 57, 15, 339, 51, 16, 17, 20], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 17, 47]]
1
300
#include <bits/stdc++.h> using namespace std; int n, m; int a[1100]; bool cmp(int x, int y) { return x >= y; } int main() { int sum = 0; scanf("%d%d", &n, &m); for (int i = 0; i < n; i++) { scanf("%d", &a[i]); sum += a[i]; } sort(a, a + n, cmp); if (a[m - 1] >= sum / (4 * m)) printf("Yes\n"); ...
#include <bits/stdc++.h> using namespace std; int n, m; int a[1100]; bool cmp(int x, int y) { return x >= y; } int main() { int sum = 0; scanf("%d%d", &n, &m); for (int i = 0; i < n; i++) { scanf("%d", &a[i]); sum += a[i]; } sort(a, a + n, cmp); if (a[m - 1] >= sum * 1.0 / (4 * m)) printf("Yes...
[["+", 15, 339, 51, 16, 12, 16, 31, 16, 17, 48], ["+", 15, 339, 51, 16, 12, 16, 31, 16, 12, 13]]
1
138
// // popular_vote.cpp // learningCplusplus // // Created by Tran Duc Chinh on 2020/04/04. // Copyright © 2020 Tran Duc Chinh. All rights reserved. // #include <iostream> int main(int argc, const char *argv[]) { int m, n; std::cin >> n >> m; int a[n]; int sum = 0; for (int i = 0; i < n; i++) { std::...
// // popular_vote.cpp // learningCplusplus // // Created by Tran Duc Chinh on 2020/04/04. // Copyright © 2020 Tran Duc Chinh. All rights reserved. // #include <iostream> int main(int argc, const char *argv[]) { int m, n; std::cin >> n >> m; int a[n]; int sum = 0; for (int i = 0; i < n; i++) { std::...
[["-", 8, 9, 0, 57, 15, 339, 51, 11, 17, 32], ["-", 0, 57, 15, 339, 51, 11, 12, 16, 31, 22], ["-", 0, 57, 15, 339, 51, 11, 12, 16, 17, 85], ["+", 0, 57, 15, 339, 51, 16, 31, 16, 17, 48], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 17, 20], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 12, 22]]
1
156
#include <bits/stdc++.h> #define int64 long long #define all(x) (x).begin(), (x).end() using namespace std; int main() { int64 N, M; cin >> N >> M; vector<int64> A(N, 0); for (int64 i = 0; i < N; i++) { cin >> A[i]; } int64 sumVote = (int64)accumulate(all(A), 0); int64 minVote = (int64)(sumVote / (...
#include <bits/stdc++.h> #define int64 long long #define all(x) (x).begin(), (x).end() using namespace std; int main() { int64 N, M; cin >> N >> M; vector<int64> A(N, 0); for (int64 i = 0; i < N; i++) { cin >> A[i]; } int64 sumVote = (int64)accumulate(all(A), 0); double minVote = (sumVote / (4.0 * ...
[["-", 0, 30, 0, 14, 8, 9, 0, 43, 39, 78], ["+", 0, 30, 0, 14, 8, 9, 0, 43, 39, 40], ["-", 0, 43, 49, 50, 51, 2, 63, 23, 0, 24], ["-", 0, 43, 49, 50, 51, 2, 63, 23, 0, 22], ["-", 0, 43, 49, 50, 51, 2, 63, 23, 0, 25]]
1
163
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 max = 0; int a[] = new int[n]; for (int i = 0; i < n; i++) { a[i] = sc.nextInt(); max += a[i]; } sc.close(...
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 max = 0; int a[] = new int[n]; for (int i = 0; i < n; i++) { a[i] = sc.nextInt(); max += a[i]; } sc.close(...
[["+", 15, 15, 0, 16, 31, 16, 31, 23, 0, 24], ["+", 0, 16, 31, 16, 31, 23, 0, 74, 0, 24], ["+", 31, 16, 31, 23, 0, 74, 39, 511, 0, 512], ["+", 0, 16, 31, 16, 31, 23, 0, 74, 0, 25], ["+", 15, 15, 0, 16, 31, 16, 31, 23, 0, 25]]
3
185
n, m = gets.chomp.split(' ').map(&:to_i) arr = gets.chomp.split(' ').map(&:to_i).sort.reverse sum = arr.inject(:+) ok = true (0...m).each do |i| ok = ok && arr[i] * (4 * m) > sum end puts ok ? 'Yes' : 'No'
n, m = gets.chomp.split(' ').map(&:to_i) arr = gets.chomp.split(' ').map(&:to_i).sort.reverse sum = arr.inject(:+) ok = true (0...m).each do |i| ok = ok && arr[i] * (4 * m) >= sum end puts ok ? 'Yes' : 'No'
[["-", 8, 736, 0, 662, 12, 738, 12, 738, 17, 47], ["+", 8, 736, 0, 662, 12, 738, 12, 738, 17, 20]]
4
91
from collections import defaultdict, deque import sys import heapq import bisect import itertools import queue import copy import time sys.setrecursionlimit(10**8) INF = float('inf') mod = 10**9+7 eps = 10**-7 def inp(): return int(sys.stdin.readline()) def inpl(): return list(map(int, sys.stdin.readline().split())) ...
from collections import defaultdict, deque import sys import heapq import bisect import itertools import queue import copy import time sys.setrecursionlimit(10**8) INF = float('inf') mod = 10**9+7 eps = 10**-7 def inp(): return int(sys.stdin.readline()) def inpl(): return list(map(int, sys.stdin.readline().split())) ...
[["-", 0, 7, 8, 196, 0, 57, 15, 666, 667, 47], ["+", 0, 7, 8, 196, 0, 57, 15, 666, 667, 20], ["-", 0, 7, 8, 196, 0, 57, 15, 666, 667, 60], ["+", 36, 36, 0, 656, 0, 57, 15, 666, 667, 20], ["-", 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, 25], ["...
5
170
#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()); cout << (a[n - m] > accumulate(a.begin(), a.end(), 0.0) / (4 * m) ? "Yes" ...
#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()); cout << (a[n - m] >= accumulate(a.begin(), a.end(), 0.0) / (double)(4 * m) ? "Yes" : "No") ...
[["-", 31, 16, 12, 23, 0, 41, 15, 16, 17, 47], ["+", 31, 16, 12, 23, 0, 41, 15, 16, 17, 20], ["+", 0, 41, 15, 16, 12, 16, 12, 74, 0, 24], ["+", 15, 16, 12, 16, 12, 74, 39, 77, 39, 40], ["+", 0, 41, 15, 16, 12, 16, 12, 74, 0, 25]]
1
114
#include <bits/stdc++.h> using namespace std; int main() { int a[105], n, m, s = 0; cin >> n >> m; for (int i = 1; i <= n; i++) { cin >> a[i]; s += a[i]; } sort(a + 1, a + 1 + n); bool f = true; for (int i = n; i >= n - m; i--) if (a[i] * 4 * m < s) f = false; if (f) cout << "Yes...
#include <bits/stdc++.h> using namespace std; int main() { int a[105], n, m, s = 0; cin >> n >> m; for (int i = 1; i <= n; i++) { cin >> a[i]; s += a[i]; } sort(a + 1, a + 1 + n); bool f = true; for (int i = n; i > n - m; i--) if (a[i] * 4 * m < s) f = false; if (f) cout << "Yes"...
[["-", 0, 14, 8, 9, 0, 7, 15, 16, 17, 20], ["+", 0, 14, 8, 9, 0, 7, 15, 16, 17, 47]]
1
133
n,m=map(int,input().split()) a=sorted(list(map(int,input().split())),reverse=1) print("Yes" if 4*m*a[m-1]>sum(a) else "No")
n,m=map(int,input().split()) a=sorted(list(map(int,input().split())),reverse=1) print("Yes" if 4*m*a[m-1]>=sum(a) else "No")
[["-", 0, 652, 3, 4, 0, 41, 0, 666, 667, 47], ["+", 0, 652, 3, 4, 0, 41, 0, 666, 667, 20]]
5
66
#include <bits/stdc++.h> using namespace std; typedef long long ll; typedef long double ld; typedef pair<int, int> Pii; typedef pair<ll, ll> Pll; typedef pair<int, Pii> P1; #define rep(i, n) for (int i = 0; i < n; i++) #define sor(v) sort(v.begin(), v.end()) #define rev(s) reverse(s.begin(), s.end()) #define lb(vec, ...
#include <bits/stdc++.h> using namespace std; typedef long long ll; typedef long double ld; typedef pair<int, int> Pii; typedef pair<ll, ll> Pll; typedef pair<int, Pii> P1; #define rep(i, n) for (int i = 0; i < n; i++) #define sor(v) sort(v.begin(), v.end()) #define rev(s) reverse(s.begin(), s.end()) #define lb(vec, ...
[["-", 0, 57, 15, 339, 51, 16, 12, 74, 0, 24], ["-", 15, 339, 51, 16, 12, 74, 39, 77, 39, 40], ["-", 0, 57, 15, 339, 51, 16, 12, 74, 0, 25]]
1
242
#include <bits/stdc++.h> using namespace std; int main() { int n, m; cin >> n >> m; int a[n + 1]; int s = 0; for (int i = 0; i < n; i++) { cin >> a[i]; s = s + a[i]; } int z = s / (4 * m); int count = 0; for (int i = 0; i < n; i++) { if (a[i] >= z) count++; } if (count == m) { ...
#include <bits/stdc++.h> using namespace std; int main() { int n, m; cin >> n >> m; double a[n + 1]; double s = 0; for (int i = 0; i < n; i++) { cin >> a[i]; s = s + a[i]; } double z = s / (4 * m); int count = 0; for (int i = 0; i < n; i++) { if (a[i] >= z) count++; } if (count >...
[["-", 0, 30, 0, 14, 8, 9, 0, 43, 39, 40], ["+", 0, 30, 0, 14, 8, 9, 0, 43, 39, 40], ["-", 8, 9, 0, 57, 15, 339, 51, 16, 17, 60], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 17, 20]]
1
135
N,M = (int(x) for x in input().split()) a = list(map(int,input().split())) x = sum(a)*1/(4*M) pick = 0 for (a_i) in a: if (a_i) > x: pick += 1 if pick >= M: print("Yes") else: print("No")
N,M = (int(x) for x in input().split()) a = list(map(int,input().split())) x = sum(a)*1/(4*M) pick = 0 for (a_i) in a: if (a_i) >= x: pick += 1 if pick >= M: print("Yes") else: print("No")
[["-", 0, 7, 8, 196, 0, 57, 15, 666, 667, 47], ["+", 0, 7, 8, 196, 0, 57, 15, 666, 667, 20]]
5
90
n,m=[int(x) for x in input().split()] a=[int(x) for x in input().split()] print("Yes" if len([x for x in a if x>sum(a)/(4*m)])>=m else "No")
n,m=[int(x) for x in input().split()] a=[int(x) for x in input().split()] print("Yes" if len([x for x in a if x>=sum(a)/(4*m)])>=m else "No")
[["-", 3, 4, 0, 658, 0, 678, 0, 666, 667, 47], ["+", 3, 4, 0, 658, 0, 678, 0, 666, 667, 20]]
5
74
n,m=[int(x) for x in input().split()] a=[int(x) for x in input().split()] a.sort() a.reverse() ans="Yes" for i in range(m+1): if a[i]<sum(a)/(4*m): ans="No" break; print(ans)
n,m=[int(x) for x in input().split()] a=[int(x) for x in input().split()] a.sort() a.reverse() ans="Yes" for i in range(m): if a[i]<sum(a)/(4*m): ans="No" break; print(ans)
[["-", 0, 7, 12, 652, 3, 4, 0, 657, 17, 72], ["-", 0, 7, 12, 652, 3, 4, 0, 657, 12, 612]]
5
91
#include <bits/stdc++.h> using namespace std; #define rep(i, n) for (int i = 0; i < (n); i++) #define all(v) (v).begin(), (v).end() using ll = long long; using P = pair<int, int>; int main() { int n, m; cin >> n >> m; vector<int> a(n); int sum = 0; rep(i, n) { cin >> a[i]; sum += a[i]; } int cnt ...
#include <bits/stdc++.h> using namespace std; #define rep(i, n) for (int i = 0; i < (n); i++) #define all(v) (v).begin(), (v).end() using ll = long long; using P = pair<int, int>; int main() { double n, m; cin >> n >> m; vector<double> a(n); double sum = 0.0; rep(i, n) { cin >> a[i]; sum += a[i]; }...
[["-", 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, 43, 49, 50, 51, 13], ["+", 0, 14, 8, 9, 0, 43, 49, 50, 51, 13]]
1
148
#include "bits/stdc++.h" #define rep(i, n) for (int i = 0; i < (n); ++i) using namespace std; using li = int64_t; using P = pair<int, int>; int main() { int n, m; vector<int> a; cin >> n >> m; int total = 0; rep(i, n) { int tmp; cin >> tmp; total += tmp; a.emplace_back(tmp); } double b...
#include "bits/stdc++.h" #define rep(i, n) for (int i = 0; i < (n); ++i) using namespace std; using li = int64_t; using P = pair<int, int>; int main() { int n, m; vector<int> a; cin >> n >> m; int total = 0; rep(i, n) { int tmp; cin >> tmp; total += tmp; a.emplace_back(tmp); } double b...
[["-", 0, 43, 49, 50, 51, 16, 31, 74, 51, 22], ["+", 0, 43, 49, 50, 51, 16, 31, 74, 51, 22]]
1
145
#include <bits/stdc++.h> using namespace std; int main() { int m, n; cin >> n >> m; vector<int> a(n); int cnt = 0; int sum = 0; for (int i = 0; i < n; i++) { cin >> a[i]; sum += a[i]; } for (int i = 0; i < n; i++) { if (a[i] >= sum / 4) { cnt++; } } if (cnt >= m) { cout ...
#include <bits/stdc++.h> using namespace std; int main() { int m, n; cin >> n >> m; vector<int> a(n); int cnt = 0; int sum = 0; for (int i = 0; i < n; i++) { cin >> a[i]; sum += a[i]; } for (int i = 0; i < n; i++) { if (a[i] * 4 * m >= sum) { cnt++; } } if (cnt >= m) { c...
[["+", 15, 339, 51, 16, 31, 16, 31, 16, 17, 48], ["+", 15, 339, 51, 16, 31, 16, 31, 16, 12, 13], ["+", 0, 57, 15, 339, 51, 16, 31, 16, 17, 48], ["+", 0, 57, 15, 339, 51, 16, 31, 16, 12, 22], ["-", 0, 57, 15, 339, 51, 16, 12, 16, 17, 85], ["-", 0, 57, 15, 339, 51, 16, 12, 16, 12, 13]]
1
134
N,M = map(int, input().split()) A = list(map(int, input().split())) all=0 for i in range(N): all+=A[i] all = int(all/(4*M)) count=0 for j in range(N): if A[j] >= all: count+=1 if count < M: print('No') else : print('Yes')
N,M = map(int, input().split()) A = list(map(int, input().split())) all=0 for i in range(N): all+=A[i] all = all/(4*M) count=0 for j in range(N): if A[j] >= all: count+=1 if count < M: print('No') else : print('Yes')
[["-", 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
103
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[] A = new int[N]; int wa = 0; for (int i = 0; i < N; i++) { A[i] = sc.nextInt(); wa ...
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[] A = new int[N]; int wa = 0; for (int i = 0; i < N; i++) { A[i] = sc.nextInt(); wa ...
[["-", 0, 195, 8, 196, 0, 503, 39, 506, 0, 507], ["+", 0, 195, 8, 196, 0, 503, 39, 511, 0, 512], ["+", 0, 503, 49, 200, 51, 16, 31, 74, 0, 24], ["+", 49, 200, 51, 16, 31, 74, 39, 511, 0, 512], ["+", 0, 503, 49, 200, 51, 16, 31, 74, 0, 25]]
3
189
#ifdef ConanYu #include "E:\yuzining\code\local.hpp" #else #pragma GCC optimize("-O3") #include <bits/stdc++.h> using namespace std; typedef long long ll; #define debug(...) \ do { \ }...
#ifdef ConanYu #include "E:\yuzining\code\local.hpp" #else #pragma GCC optimize("-O3") #include <bits/stdc++.h> using namespace std; typedef long long ll; #define debug(...) \ do { \ }...
[["-", 8, 9, 0, 57, 15, 339, 51, 16, 17, 47], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 17, 20]]
1
169
n,m = map(int,input().split()) a = sorted(list(map(int,input().split())),reverse=True) print("YNeos"[sum(a[i]<sum(a)/(4*m)for i in range(m))>=m::2])
n,m = map(int,input().split()) a = sorted(list(map(int,input().split())),reverse=True) print("YNeos"[sum(a[i]>=sum(a)/(4*m)for i in range(m))<m::2])
[["-", 0, 666, 0, 652, 3, 668, 8, 666, 667, 18], ["+", 0, 666, 0, 652, 3, 668, 8, 666, 667, 20], ["-", 3, 4, 0, 206, 206, 663, 0, 666, 667, 20], ["+", 3, 4, 0, 206, 206, 663, 0, 666, 667, 18]]
5
78
#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.at(i); sum += A.at(i); } sort(A.begin(), A.end()); reverse(A.begin(), A.end()); bool exist = true; for (int i = 0; i < M; i++) { if (...
#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.at(i); sum += A.at(i); } sort(A.begin(), A.end()); reverse(A.begin(), A.end()); bool exist = true; for (int i = 0; i < M; i++) { if (...
[["-", 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
167
#include <bits/stdc++.h> using namespace std; #define rep(i, n) for (int i = 0; i < (int)(n); i++) #define ll long long int main() { int n, m; cin >> n >> m; vector<int> a(n); ll souhyou = 0; rep(i, n) { cin >> a.at(i); souhyou += a.at(i); } double c = souhyou / (4 * m); int count = 0; rep(i...
#include <bits/stdc++.h> using namespace std; #define rep(i, n) for (int i = 0; i < (int)(n); i++) #define ll long long int main() { int n, m; cin >> n >> m; vector<int> a(n); ll souhyou = 0; rep(i, n) { cin >> a.at(i); souhyou += a.at(i); } double c = souhyou * 1.0 / (4 * m); int count = 0; ...
[["+", 0, 43, 49, 50, 51, 16, 31, 16, 17, 48], ["+", 0, 43, 49, 50, 51, 16, 31, 16, 12, 13]]
1
138
n, m = map(int,input().split()) a = list(map(int,input().split())) a.sort(reverse = True) s = sum(a) if a[m-1] >= s//(4*m): print("Yes") else: print("No")
n, m = map(int,input().split()) a = list(map(int,input().split())) a.sort(reverse = True) s = sum(a) if a[m-1] >= s/(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
77
n,m = map(int,input().split()) a = sorted(list(map(int,input().split())),reverse=True) print("YNeos"[sum([sum(a)/(4*m)>=a[i] for i in range(m)])==m::2])
n,m = map(int,input().split()) a = sorted(list(map(int,input().split())),reverse=True) print("YNeos"[sum([sum(a)/(4*m)<=a[i] for i in range(m)])!=m::2])
[["-", 0, 652, 3, 4, 0, 658, 8, 666, 667, 20], ["+", 0, 652, 3, 4, 0, 658, 8, 666, 667, 19], ["-", 3, 4, 0, 206, 206, 663, 0, 666, 667, 60], ["+", 3, 4, 0, 206, 206, 663, 0, 666, 667, 79]]
5
80
n, m = map(int, input().split()) A = list(map(int, input().split())) borderline = sum(A) / (4 * m) print('Yes' if sorted(A, reverse=True)[m-1] > borderline else 'No')
n, m = map(int, input().split()) A = list(map(int, input().split())) borderline = sum(A) / (4 * m) print('Yes' if sorted(A, reverse=True)[m-1] >= borderline else 'No')
[["-", 0, 652, 3, 4, 0, 41, 0, 666, 667, 47], ["+", 0, 652, 3, 4, 0, 41, 0, 666, 667, 20]]
5
71
n, m = map(int, input().split()) ai = list(map(int, input().split())) required = sum(ai) / (4 * m) print(required) count = 0 for a in sorted(ai, reverse=True): if a >= required: count += 1 else: break print("YNeos"[count < m::2])
n, m = map(int, input().split()) ai = list(map(int, input().split())) required = sum(ai) / (4 * m) count = 0 for a in sorted(ai, reverse=True): if a >= required: count += 1 else: break print("YNeos"[count < m::2])
[["-", 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
89
#include <algorithm> #include <cmath> #include <iostream> #include <string> #include <vector> using namespace std; int main() { double N, M; cin >> N >> M; int count = 0; vector<double> shina(1000); for (int i = 0; i < 1000; i++) { cin >> shina.at(i); } double sum = 0; for (int i = 0; i < 1000; i+...
#include <algorithm> #include <cmath> #include <iostream> #include <string> #include <vector> using namespace std; int main() { double N, M; cin >> N >> M; int count = 0; vector<double> shina(1000); for (int i = 0; i < 1000; i++) { cin >> shina.at(i); } double sum = 0; for (int i = 0; i < 1000; i+...
[["-", 8, 9, 0, 57, 15, 339, 51, 16, 17, 47], ["-", 0, 57, 15, 339, 51, 16, 12, 2, 63, 22], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 17, 20]]
1
164
package main import ( "bufio" "fmt" "os" "strconv" ) const ( initialBufSize = 1e4 maxBufSize = 1e8 + 7 ) var buf []byte = make([]byte, maxBufSize) var sc = bufio.NewScanner(os.Stdin) func init() { sc.Split(bufio.ScanWords) sc.Buffer(buf, maxBufSize) } func main() { N := nextInt() M := nextInt() An :...
package main import ( "bufio" "fmt" "os" "strconv" ) const ( initialBufSize = 1e4 maxBufSize = 1e8 + 7 ) var buf []byte = make([]byte, maxBufSize) var sc = bufio.NewScanner(os.Stdin) func init() { sc.Split(bufio.ScanWords) sc.Buffer(buf, maxBufSize) } func main() { N := nextInt() M := nextInt() An :...
[["-", 8, 196, 0, 57, 15, 16, 31, 16, 17, 85], ["+", 0, 7, 8, 196, 0, 57, 15, 16, 17, 47], ["+", 8, 196, 0, 57, 15, 16, 12, 16, 31, 22], ["+", 8, 196, 0, 57, 15, 16, 12, 16, 17, 48], ["-", 0, 7, 8, 196, 0, 57, 15, 16, 17, 47], ["-", 0, 7, 8, 196, 0, 57, 15, 16, 12, 22]]
7
256
N, M = map(int, input().split()) A = sorted(list(map(int, input().split()))) ans = sum(x > (sum(A) / (4 * M)) for x in A) print('No' if ans < M else 'Yes')
N, M = map(int, input().split()) A = sorted(list(map(int, input().split()))) ans = sum(x >= (sum(A) / (4 * M)) for x in A) print('No' if ans < M else 'Yes')
[["-", 0, 662, 12, 652, 3, 668, 8, 666, 667, 47], ["+", 0, 662, 12, 652, 3, 668, 8, 666, 667, 20]]
5
73
N, M = map(int, input().split()) A = list(map(int, input().split())) ans = 0 for i in range(N): if A[i]*4*M > sum(A): ans += 1 if ans >= M: print('Yes') else: print('No')
N, M = map(int, input().split()) A = list(map(int, input().split())) ans = 0 for i in range(N): if A[i]*4*M >= sum(A): 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
81
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 total = 0; int counter = 0; int[] a = new int[n]; for (int i = 0; i < n; i++) { a[i] = sc.nextInt(); tot...
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(); float total = 0; int counter = 0; int[] a = new int[n]; for (int i = 0; i < n; i++) { a[i] = sc.nextInt(); t...
[["-", 0, 195, 8, 196, 0, 503, 39, 506, 0, 507], ["+", 0, 195, 8, 196, 0, 503, 39, 511, 0, 531]]
3
182
<?php fscanf(STDIN,"%d %d", $n, $m); $a = explode(" ",fgets(STDIN)); $t = array_sum($a)/(4*$m); $count = 0; for ($i=0; $i<$n; $i++){ if((int)$t < $a[$i]){ $count++; } } if ($count >= $m){ echo "Yes\n"; } else { echo "No\n"; } ?>
<?php fscanf(STDIN,"%d %d", $n, $m); $a = explode(" ",fgets(STDIN)); $t = array_sum($a)/(4*$m); $count = 0; for ($i=0; $i<$n; $i++){ if($t <= $a[$i]){ $count++; } } if ($count >= $m){ echo "Yes\n"; } else { echo "No\n"; } ?>
[["-", 0, 57, 15, 23, 0, 16, 31, 74, 0, 24], ["-", 0, 57, 15, 23, 0, 16, 31, 74, 39, 615], ["-", 0, 57, 15, 23, 0, 16, 31, 74, 0, 25], ["-", 0, 9, 0, 57, 15, 23, 0, 16, 17, 18], ["+", 0, 9, 0, 57, 15, 23, 0, 16, 17, 19]]
6
118
package main import ( "bufio" "fmt" "os" "sort" "strconv" ) func main() { sc := NewScanner() n := sc.ReadInt() m := sc.ReadInt() a := make([]int, n) total := 0 for i := 0; i < n; i++ { ai := sc.ReadInt() a[i] = ai total += ai } sort.Ints(a) text := "" if a[n-m] < CeilInt(total, 4*m) { text =...
package main import ( "bufio" "fmt" "os" "sort" "strconv" ) func main() { sc := NewScanner() n := sc.ReadInt() m := sc.ReadInt() a := make([]int, n) total := 0 for i := 0; i < n; i++ { ai := sc.ReadInt() a[i] = ai total += ai } sort.Ints(a) text := "" if a[n-m] < CeilInt(total, 4*m) { text =...
[["-", 0, 434, 0, 435, 54, 55, 0, 56, 141, 22], ["+", 0, 434, 0, 435, 54, 55, 0, 56, 141, 22]]
7
416
N,M = (int(x) for x in input().split()) A_list = [int(x) for x in input().split()] A_sum = sum(A_list) Bool_list = [] for A in A_list: if A >= int(A_sum/(N*M)): Bool_list.append("True") if (len(Bool_list)) >= M: print("Yes") else: print("No")
N,M = (int(x) for x in input().split()) A_list = [int(x) for x in input().split()] A_sum = sum(A_list) Bool_list = [] for A in A_list: if A >= (A_sum/(4*M)): Bool_list.append("True") if (len(Bool_list)) >= M: print("Yes") else: print("No")
[["-", 8, 196, 0, 57, 15, 666, 0, 652, 63, 22], ["-", 3, 4, 0, 657, 12, 23, 0, 657, 31, 22], ["+", 0, 23, 0, 657, 12, 23, 0, 657, 31, 612]]
5
99
#include <stdio.h> int main() { int lineup[100]; int M = 0; int N = 0; int i = 0; int j = 0; int k = 0; int add = 0; scanf("%d %d", &N, &M); for (i = 0; i < N; i++) { scanf("%d", &lineup[i]); add += lineup[i]; } for (j = 0; j < N; j++) { if (lineup[j] * 4 * M >= add) { k++; ...
#include <stdio.h> int main() { int lineup[100]; int M = 0; int N = 0; int i = 0; int j = 0; int k = 0; int add = 0; scanf("%d %d", &N, &M); for (i = 0; i < N; i++) { scanf("%d", &lineup[i]); add += lineup[i]; } for (j = 0; j < N; j++) { if (lineup[j] * 4 * M >= add) { k++; ...
[["+", 0, 14, 8, 9, 0, 57, 64, 9, 0, 45], ["-", 64, 1, 0, 2, 3, 4, 0, 5, 0, 6], ["+", 0, 1, 0, 2, 3, 4, 0, 5, 0, 6], ["+", 0, 14, 8, 9, 0, 57, 64, 9, 0, 46], ["+", 8, 9, 0, 57, 75, 76, 0, 9, 0, 45], ["+", 8, 9, 0, 57, 75, 76, 0, 9, 0, 46]]
0
149
#include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < (n); i++) #define ll long long using namespace std; int main() { int n, m; int sum = 0; cin >> n >> m; vector<int> A(n); rep(i, n) { cin >> A.at(i); sum += A.at(i); } sort(A.rbegin(), A.rend()); double check = (double)(sum / (4 * m)...
#include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < (n); i++) #define ll long long using namespace std; int main() { int n, m; int sum = 0; cin >> n >> m; vector<int> A(n); rep(i, n) { cin >> A.at(i); sum += A.at(i); } sort(A.rbegin(), A.rend()); double check = (double)sum / (4 * m);...
[["-", 0, 43, 49, 50, 51, 74, 51, 23, 0, 24], ["-", 51, 74, 51, 23, 0, 16, 12, 23, 0, 25]]
1
135
#include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < (n); i++) #define ll long long using namespace std; int main() { int n, m; int sum = 0; cin >> n >> m; vector<int> A(n); rep(i, n) { cin >> A.at(i); sum += A.at(i); } sort(A.rbegin(), A.rend()); double check = (double)(sum / (4 * m)...
#include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < (n); i++) #define ll long long using namespace std; int main() { int n, m; int sum = 0; cin >> n >> m; vector<int> A(n); rep(i, n) { cin >> A.at(i); sum += A.at(i); } sort(A.rbegin(), A.rend()); double check = ((double)sum / (double...
[["+", 49, 50, 51, 23, 0, 16, 31, 74, 0, 24], ["-", 0, 43, 49, 50, 51, 74, 51, 23, 0, 24], ["+", 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
135
#include <bits/stdc++.h> using namespace std; int m, n, s, i, j, m2, cnt, a[1000]; int main() { cin >> n >> m; // int a[n]; s = 0; for (i = 0; i < n; i++) cin >> a[i], s += a[i]; // s=accumulate(a,a+n,0); // m2=s/(4*m); sort(a, a + n); for (i = 0; i < n; i++) if (a[i] >= s / (4 * m)) cn...
#include <bits/stdc++.h> using namespace std; int m, n, s, i, j, m2, cnt, a[1000]; int main() { cin >> n >> m; // int a[n]; s = 0; for (i = 0; i < n; i++) cin >> a[i], s += a[i]; // s=accumulate(a,a+n,0); // m2=s/(4*m); sort(a, a + n); for (i = 0; i < n; i++) if (a[i] >= s / (4.0 * m)) ...
[["-", 51, 16, 12, 16, 12, 23, 0, 16, 31, 13], ["+", 51, 16, 12, 16, 12, 23, 0, 16, 31, 13]]
1
136
N, M = map(int, input().split()) A = list(map(int, input().split())) vote_sum = sum(A) cnt = 0 y = "Yes" n = "no" for i in range(N): if (A[i]*4*M) >= vote_sum: cnt += 1 if cnt >= M: print(y) else: print(n)
N, M = map(int, input().split()) A = list(map(int, input().split())) vote_sum = sum(A) cnt = 0 y = "Yes" n = "No" for i in range(N): if (A[i]*4*M) >= vote_sum: cnt += 1 if cnt >= M: print(y) else: print(n)
[["-", 0, 656, 0, 1, 0, 662, 12, 557, 0, 6], ["+", 0, 656, 0, 1, 0, 662, 12, 557, 0, 6]]
5
92
#include <stdio.h> int main() { int n = 0; int m = 0; int c = 0; int t = 0; int v[100]; scanf("%d %d", &n, &m); for (int i = 0; i < n; i++) { scanf("%d", &v[i]); } for (int i = 0; i < n; i++) { t = t + v[i]; } for (int i = 0; i < n; i++) { if (v[i] > t / (4 * m)) { c = c + 1; ...
#include <stdio.h> int main() { int n = 0; int m = 0; int c = 0; int t = 0; int v[101]; scanf("%d %d", &n, &m); for (int i = 0; i < n; i++) { scanf("%d", &v[i]); } for (int i = 0; i < n; i++) { t = t + v[i]; } for (int i = 0; i < n; i++) { if (v[i] >= (float)t / (4 * m)) { c = c...
[["-", 0, 14, 8, 9, 0, 43, 49, 80, 81, 13], ["+", 0, 14, 8, 9, 0, 43, 49, 80, 81, 13], ["-", 8, 9, 0, 57, 15, 23, 0, 16, 17, 47], ["+", 8, 9, 0, 57, 15, 23, 0, 16, 17, 20], ["+", 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
168
#include <bits/stdc++.h> using namespace std; int desc(const void *a, const void *b) { return *(int *)b - *(int *)a; } int main() { int N, M; cin >> N >> M; int A[N]; long long all = 0; long double ok; for (int i = 0; i < N; i++) { cin >> A[i]; all += A[i]; } qsort(A, N, sizeof(A[0]), desc); o...
#include <bits/stdc++.h> using namespace std; int desc(const void *a, const void *b) { return *(int *)b - *(int *)a; } int main() { int N, M; cin >> N >> M; int A[N]; long double all = 0; double ok; for (int i = 0; i < N; i++) { cin >> A[i]; all += A[i]; } qsort(A, N, sizeof(int), desc); ok = ...
[["-", 0, 14, 8, 9, 0, 43, 39, 86, 0, 96], ["+", 0, 14, 8, 9, 0, 43, 39, 86, 39, 40], ["-", 3, 4, 0, 105, 51, 23, 0, 69, 28, 22], ["-", 0, 105, 51, 23, 0, 69, 341, 342, 0, 70], ["-", 0, 105, 51, 23, 0, 69, 341, 342, 0, 13], ["-", 0, 105, 51, 23, 0, 69, 341, 342, 0, 73], ["+", 0, 2, 3, 4, 0, 105, 39, 77, 39, 40]]
1
170
#include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < (int)(n); i++) using namespace std; typedef long long ll; const int MOD = 1E9 + 9; const int INF = 1 << 29; int main() { int N, M; cin >> N >> M; vector<int> a(N); int sum = 0; rep(i, N) { cin >> a[i]; sum += a[i]; } sum /= (4 * M); ...
#include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < (int)(n); i++) using namespace std; typedef long long ll; const int MOD = 1E9 + 9; const int INF = 1 << 29; int main() { int N, M; cin >> N >> M; vector<int> a(N); float sum = 0; rep(i, N) { cin >> a[i]; sum += a[i]; } sum /= (4 * M);...
[["-", 0, 30, 0, 14, 8, 9, 0, 43, 39, 40], ["+", 0, 30, 0, 14, 8, 9, 0, 43, 39, 40]]
1
151
#include <algorithm> #include <iostream> #include <numeric> #include <vector> using namespace std; int main(int argc, char const *argv[]) { int N, M; cin >> N >> M; vector<int> A(N); for (int i = 0; i < N; i++) { cin >> A[i]; } unsigned int threshold = accumulate(A.begin(), A.end(), 0U) / (4 * M); ...
#include <algorithm> #include <iostream> #include <numeric> #include <vector> using namespace std; int main(int argc, char const *argv[]) { int N, M; cin >> N >> M; vector<int> A(N); for (int i = 0; i < N; i++) { cin >> A[i]; } auto threshold = 1.0 * accumulate(A.begin(), A.end(), 0U) / (4 * M); /...
[["-", 0, 14, 8, 9, 0, 43, 39, 86, 0, 87], ["-", 0, 14, 8, 9, 0, 43, 39, 86, 39, 40], ["+", 0, 14, 8, 9, 0, 43, 39, 361, 0, 190], ["+", 0, 43, 49, 50, 51, 16, 31, 16, 31, 13], ["+", 0, 43, 49, 50, 51, 16, 31, 16, 17, 48]]
1
163
#include <algorithm> #include <bitset> #include <cmath> #include <cstdio> #include <cstdlib> #include <cstring> #include <ctime> #include <deque> #include <functional> #include <iomanip> #include <iostream> #include <map> #include <numeric> #include <queue> #include <set> #include <sstream> #include <stack> #include <s...
#include <algorithm> #include <bitset> #include <cmath> #include <cstdio> #include <cstdlib> #include <cstring> #include <ctime> #include <deque> #include <functional> #include <iomanip> #include <iostream> #include <map> #include <numeric> #include <queue> #include <set> #include <sstream> #include <stack> #include <s...
[["-", 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, 9, 0, 57, 15, 339, 51, 16, 17, 47], ["+", 0, 9, 0, 57, 15, 339, 51, 16, 17, 20]]
1
355
#include <bits/stdc++.h> using namespace std; int main() { int N, M; cin >> N >> M; vector<int> A(N); int t = 0; for (int i = 0; i < N; ++i) { cin >> A[i]; t += A[i]; } int c = 0; for (int i = 0; i < N; ++i) { if (A[i] >= t / 4 / M) ++c; } if (c >= M) cout << "Yes" << endl;...
#include <bits/stdc++.h> using namespace std; int main() { int N, M; cin >> N >> M; vector<int> A(N); int t = 0; for (int i = 0; i < N; ++i) { cin >> A[i]; t += A[i]; } int c = 0; for (int i = 0; i < N; ++i) { if (A[i] >= t / (4.0 * M)) ++c; } if (c >= M) cout << "Yes" << e...
[["-", 15, 339, 51, 16, 12, 16, 31, 16, 12, 13], ["-", 0, 57, 15, 339, 51, 16, 12, 16, 17, 85], ["+", 15, 339, 51, 16, 12, 16, 12, 23, 0, 24], ["+", 51, 16, 12, 16, 12, 23, 0, 16, 31, 13], ["+", 51, 16, 12, 16, 12, 23, 0, 16, 17, 48], ["+", 15, 339, 51, 16, 12, 16, 12, 23, 0, 25]]
1
127
#include <bits/stdc++.h> using namespace std; int main() { int n, m, temp = 0; cin >> n >> m; int a[n]; for (int i = 0; i < n; i++) { cin >> a[i]; temp += a[i]; } temp = temp / (4 * m); int count = 0; for (int i = 0; i < n; i++) { if (a[i] > temp) count++; } if (count >= m) c...
#include <bits/stdc++.h> using namespace std; int main() { int n, m; float temp = 0; cin >> n >> m; int a[n]; for (int i = 0; i < n; i++) { cin >> a[i]; temp += a[i]; } temp = temp / (4.0 * m); int count = 0; for (int i = 0; i < n; i++) { if (a[i] >= temp) count++; } if (count ...
[["-", 0, 30, 0, 14, 8, 9, 0, 43, 0, 21], ["+", 0, 30, 0, 14, 8, 9, 0, 43, 0, 35], ["+", 0, 30, 0, 14, 8, 9, 0, 43, 39, 40], ["-", 0, 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, 16, 17, 47], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 17, 20]]
1
128
input_1 = gets.split.map!(&:to_i) input_2 = gets.split.map!(&:to_i) if input_2.select{ |num| num.to_f >= (input_2.inject(:+) / (4 * input_1[1])).to_f }.length < input_1[1] then puts "No" else puts "Yes" end
input_1 = gets.split.map!(&:to_i) input_2 = gets.split.map!(&:to_f) if input_2.select{ |num| num >= (input_2.inject(:+) / (4 * input_1[1])).to_f }.length < input_1[1] then puts "No" else puts "Yes" end
[["-", 0, 662, 12, 652, 3, 4, 0, 752, 0, 753], ["+", 0, 662, 12, 652, 3, 4, 0, 752, 0, 753], ["-", 196, 196, 8, 734, 0, 738, 31, 652, 17, 131], ["-", 196, 196, 8, 734, 0, 738, 31, 652, 735, 22]]
4
72
#include <bits/stdc++.h> using namespace std; int N, M, A[100], sum; int main() { cin >> N >> M; for (int i = 0; i < N; i++) { cin >> A[i]; sum += A[i]; } sort(A, A + N); puts(A[N - M] * 4 * M > sum ? "Yes" : "No"); }
#include <bits/stdc++.h> using namespace std; int N, M, A[100], sum; int main() { cin >> N >> M; for (int i = 0; i < N; i++) { cin >> A[i]; sum += A[i]; } sort(A, A + N); puts(A[N - M] * 4 * M >= sum ? "Yes" : "No"); }
[["-", 0, 2, 3, 4, 0, 41, 15, 16, 17, 47], ["+", 0, 2, 3, 4, 0, 41, 15, 16, 17, 20]]
1
93
n, m = map(int, input().split()) a_lst = [] a_lst = list(map(int, input().split())) # print() percent = sum(a_lst) // (4 * m) cnt = 0 for i in range(n): if a_lst[i] > percent: cnt += 1 if cnt >= m: print('Yes') else: print('No')
n, m = map(int, input().split()) a_lst = [] a_lst = list(map(int, input().split())) # print() percent = sum(a_lst) / (4 * m) cnt = 0 for i in range(n): # print("a", a_lst[i]) # 同値の場合を書いてなくて1WAあほまぬけ if a_lst[i] >= percent: cnt += 1 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], ["-", 0, 7, 8, 196, 0, 57, 15, 666, 667, 47], ["+", 0, 7, 8, 196, 0, 57, 15, 666, 667, 20]]
5
91
#include <bits/stdc++.h> using namespace std; int main() { int n, m, i, count{0}; int x = 0, vote{0}, j; cin >> n >> m; int a[n]; for (i = 0; i < n; i++) { cin >> a[i]; vote = vote + a[i]; } j = (double)((vote / m) * (0.25)); for (i = 0; i < n; i++) { if (a[i] >= j) count++; } ...
#include <bits/stdc++.h> using namespace std; int main() { int n, m, i, count{0}; double x = 0, vote{0}, j; cin >> n >> m; int a[n]; for (i = 0; i < n; i++) { cin >> a[i]; vote = vote + a[i]; } j = (double)((vote / m) * (0.25)); for (i = 0; i < n; i++) { if (a[i] >= j) count++; ...
[["-", 0, 30, 0, 14, 8, 9, 0, 43, 39, 40], ["+", 0, 30, 0, 14, 8, 9, 0, 43, 39, 40]]
1
146
n, m = (int(x) for x in input().split()) num_point = [int(x) for x in input().split()] count = 0 for n in num_point: if n > (sum(num_point) / (4 * m)): count += 1 if count < m: print("No") else: print("Yes")
n, m = (int(x) for x in input().split()) num_point = [int(x) for x in input().split()] count = 0 for n in num_point: if n >= (sum(num_point) / (4 * m)): 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], ["-", 36, 36, 0, 656, 0, 57, 15, 666, 667, 18], ["+", 36, 36, 0, 656, 0, 57, 15, 666, 667, 20], ["-", 0, 1, 0, 652, 3, 4, 0, 557, 0, 6], ["+", 0, 1, 0, 652, 3, 4, 0, 557, 0, 6]]
5
84
#include <algorithm> #include <bits/stdc++.h> #include <vector> using namespace std; int main() { int N, M; cin >> N >> M; // N要素の配列で初期化 vector<int> vec(N); // N個の入力を受け取る for (int i = 0; i < N; i++) { cin >> vec.at(i); } int i; double sum = 0; for (i = 0; i <= N; i++) { sum = sum + vec[i]...
#include <algorithm> #include <bits/stdc++.h> #include <vector> using namespace std; int main() { int N, M; cin >> N >> M; // N要素の配列で初期化 vector<int> vec(N); // N個の入力を受け取る for (int i = 0; i < N; i++) { cin >> vec.at(i); } int i; double sum = 0; for (i = 0; i < N; i++) { sum = sum + vec[i];...
[["-", 0, 14, 8, 9, 0, 7, 15, 16, 17, 19], ["+", 0, 14, 8, 9, 0, 7, 15, 16, 17, 18]]
1
151
#include <bits/stdc++.h> #define rep(a, b, c) for (int a = b; a <= c; a++) #define per(a, b, c) for (int a = b; a >= c; a--) #define pb push_back #define mk make_pair #define pii pair<int, int> #define fi first #define se second #define mem(a, b) memset(a, b, sizeof(a)) #define inf 0x3f3f3f3f #define ls(x) (x << 1) #de...
#include <bits/stdc++.h> #define rep(a, b, c) for (int a = b; a <= c; a++) #define per(a, b, c) for (int a = b; a >= c; a--) #define pb push_back #define mk make_pair #define pii pair<int, int> #define fi first #define se second #define mem(a, b) memset(a, b, sizeof(a)) #define inf 0x3f3f3f3f #define ls(x) (x << 1) #de...
[["-", 0, 30, 0, 14, 8, 9, 0, 43, 39, 40], ["+", 0, 30, 0, 14, 8, 9, 0, 43, 39, 78], ["-", 49, 50, 51, 16, 12, 23, 0, 16, 31, 13], ["+", 49, 50, 51, 16, 12, 23, 0, 16, 31, 13]]
1
351
#include <bits/stdc++.h> using namespace std; using ll = long long; int main() { int n, m; cin >> n >> m; int vote[n]; int sum = 0; for (int i = 0; i < n; i++) { int x; cin >> x; vote[i] = x; sum += x; } double sumsum = sum / (4 * m); int ans = 0; for (int i = 0; i < n; i++) { if ...
#include <bits/stdc++.h> using namespace std; using ll = long long; int main() { int n; double m; cin >> n >> m; int vote[n]; double sum = 0; for (int i = 0; i < n; i++) { int x; cin >> x; vote[i] = x; sum += x; } double sumsum = sum / (4 * m); int ans = 0; for (int i = 0; i < n; i+...
[["-", 0, 30, 0, 14, 8, 9, 0, 43, 0, 21], ["+", 0, 30, 0, 14, 8, 9, 0, 43, 0, 35], ["+", 0, 30, 0, 14, 8, 9, 0, 43, 39, 40], ["-", 0, 30, 0, 14, 8, 9, 0, 43, 39, 40]]
1
138
#include <bits/stdc++.h> using namespace std; int main() { int m, n; cin >> n >> m; int a[n]; for (int i = 0; i < n; i++) cin >> a[i]; int sum = 0, count = 0; for (int i = 0; i < n; i++) sum += a[i]; for (int i = 0; i < n; i++) if (4 * m * a[i] > sum) count++; if (count >= m) cout ...
#include <bits/stdc++.h> using namespace std; int main() { int m, n; cin >> n >> m; int a[n]; for (int i = 0; i < n; i++) cin >> a[i]; int sum = 0, count = 0; for (int i = 0; i < n; i++) sum += a[i]; for (int i = 0; i < n; i++) if (4 * m * a[i] >= sum) count++; if (count >= m) cout...
[["-", 0, 7, 8, 57, 15, 339, 51, 16, 17, 47], ["+", 0, 7, 8, 57, 15, 339, 51, 16, 17, 20]]
1
136
#include <stdio.h> int main() { int n, m, a[100], i, j, sum = 0; scanf("%d %d", &n, &m); for (i = 0; i < n; i++) { scanf("%d", &a[i]); sum += a[i]; } int ans = 0; for (i = 0; i < n; i++) { if (a[i] * 4 * m > sum) { ans++; } } if (m <= ans) printf("Yes"); else printf("N...
#include <stdio.h> int main() { int n, m, a[100], i, j, sum = 0; scanf("%d %d", &n, &m); for (i = 0; i < n; i++) { scanf("%d", &a[i]); sum += a[i]; } int ans = 0; for (i = 0; i < n; i++) { if (a[i] * 4 * m >= sum) { ans++; } } if (m <= ans) printf("Yes"); else printf("...
[["-", 8, 9, 0, 57, 15, 23, 0, 16, 17, 47], ["+", 8, 9, 0, 57, 15, 23, 0, 16, 17, 20]]
0
133
#include <bits/stdc++.h> using namespace std; #define ll long long int #define vi vector<int> #define prec fixed << precision(10) #define mod 1000000007 #define set(x) __builtin_popcount(x) #define ffs(x) __builtin_ffs(x) int main() { int n, m; cin >> n >> m; vi v(n); ll sum = 0; for (int i = 0; i < n; i++...
#include <bits/stdc++.h> using namespace std; #define ll long long int #define vi vector<int> #define prec fixed << precision(10) #define mod 1000000007 #define set(x) __builtin_popcount(x) #define ffs(x) __builtin_ffs(x) int main() { int n, m; cin >> n >> m; vi v(n); ll sum = 0; for (int i = 0; i < n; i++...
[["+", 51, 16, 12, 23, 0, 16, 31, 74, 0, 24], ["+", 12, 23, 0, 16, 31, 74, 39, 77, 39, 40], ["+", 51, 16, 12, 23, 0, 16, 31, 74, 0, 25]]
1
160
n, m = map(int, input().split()) a = list(map(int, input().split())) a.sort(reverse=True) sum_ = 0 for i in a: sum_ +=i if(a[m-1]>(sum_/4*m)): print('Yes') else: print('No')
n, m = map(int, input().split()) a = list(map(int, input().split())) a.sort(reverse=True) sum_ = 0 for i in a: sum_ +=i if(a[m-1]>=sum_/(4*m)): print('Yes') else: print('No')
[["-", 0, 656, 0, 57, 15, 23, 0, 666, 667, 47], ["-", 0, 57, 15, 23, 0, 666, 0, 23, 0, 24], ["+", 0, 656, 0, 57, 15, 23, 0, 666, 667, 20], ["+", 15, 23, 0, 666, 0, 657, 12, 23, 0, 24]]
5
84
#include <algorithm> #include <iostream> #include <numeric> #include <vector> using namespace std; int main() { int n, m; cin >> n >> m; vector<int> a(n); for (int i = 0; i < n; i++) { cin >> a.at(i); } sort(a.begin(), a.end(), greater<int>()); int sum = accumulate(a.begin(), a.end(), 0); int pe...
#include <algorithm> #include <iostream> #include <numeric> #include <vector> using namespace std; int main() { int n, m; cin >> n >> m; vector<int> a(n); for (int i = 0; i < n; i++) { cin >> a.at(i); } sort(a.begin(), a.end(), greater<int>()); int sum = accumulate(a.begin(), a.end(), 0); double...
[["-", 0, 30, 0, 14, 8, 9, 0, 43, 39, 40], ["+", 0, 30, 0, 14, 8, 9, 0, 43, 39, 40], ["-", 8, 9, 0, 57, 15, 339, 51, 16, 17, 47], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 17, 20]]
1
162
#include <bits/stdc++.h> using namespace std; #define rep(i, n) for (int i = 0; i < (int)(n); i++) int main() { int n, m; cin >> n >> m; vector<int> a(n); rep(i, n) cin >> a.at(i); // sort(a.begin(), a.end()); // reverse(a.begin(), a.end()); long long sum = 0; rep(i, n) sum += a.at(i); // cout << s...
#include <bits/stdc++.h> using namespace std; #define rep(i, n) for (int i = 0; i < (int)(n); i++) int main() { int n, m; cin >> n >> m; vector<int> a(n); rep(i, n) cin >> a.at(i); // sort(a.begin(), a.end()); // reverse(a.begin(), a.end()); double sum = 0; rep(i, n) sum += a.at(i); // cout << sum ...
[["-", 0, 14, 8, 9, 0, 43, 39, 86, 0, 96], ["+", 0, 30, 0, 14, 8, 9, 0, 43, 39, 40]]
1
150
import java.util.*; public class Main { public static void main(String[] args) { ABC161B(); } private static void ABC161B() { // no comment, no error check final int INPUT_LINES_CNT = 2; final String DATA_SPLIT_SPACE = " "; ArrayList<String> inputLines = getStdInMultiLines(INPUT_LINES_CNT); i...
import java.util.*; public class Main { public static void main(String[] args) { ABC161B(); } private static void ABC161B() { // no comment, no error check final int INPUT_LINES_CNT = 2; final String DATA_SPLIT_SPACE = " "; ArrayList<String> inputLines = getStdInMultiLines(INPUT_LINES_CNT); i...
[["-", 0, 246, 8, 196, 0, 503, 39, 506, 0, 507], ["+", 0, 246, 8, 196, 0, 503, 39, 511, 0, 531], ["-", 8, 196, 0, 1, 0, 11, 12, 5, 0, 491], ["+", 8, 196, 0, 1, 0, 11, 12, 5, 0, 491]]
3
682
#!/usr/bin/env python3 import sys import numpy as np YES = "Yes" # type: str NO = "No" # type: str def solve(N: int, M: int, A: "List[int]"): A = np.array(A) n_sum = np.sum(A)/4/M if (A > n_sum).sum() >= M: print(YES) else: print(NO) return # Generated by 1.1.6 https://github...
#!/usr/bin/env python3 import sys import numpy as np YES = "Yes" # type: str NO = "No" # type: str def solve(N: int, M: int, A: "List[int]"): A = np.array(A) n_sum = np.sum(A)/4/M if (A >= n_sum).sum() >= M: print(YES) else: print(NO) return # Generated by 1.1.6 https://githu...
[["-", 0, 652, 63, 319, 500, 23, 0, 666, 667, 47], ["+", 0, 652, 63, 319, 500, 23, 0, 666, 667, 20]]
5
172
N, M = map(int, input().split()) A = list(map(int, input().split())) A.sort(reverse=True) for i in range(M): if A[i] < sum(A) * 1 / 4*M: print('No') exit() print('Yes')
N, M = map(int, input().split()) A = list(map(int, input().split())) A.sort(reverse=True) for i in range(M): if A[i] < sum(A) / (4*M): print('No') exit() print('Yes')
[["-", 15, 666, 0, 657, 31, 657, 31, 657, 17, 48], ["-", 15, 666, 0, 657, 31, 657, 31, 657, 12, 612], ["+", 0, 57, 15, 666, 0, 657, 12, 23, 0, 24], ["+", 0, 57, 15, 666, 0, 657, 12, 23, 0, 25]]
5
81
n,m=map(int,input().split()) a=list(map(int,input().split())) new_a=sorted(a,reverse=True) sums=sum(a) if new_a[m-1]>=sums/(b*4): print("Yes") else: print("No")
n,m=map(int,input().split()) a=list(map(int,input().split())) new_a=sorted(a,reverse=True) sums=sum(a) if new_a[m-1]>=sums/(m*4): print("Yes") else: print("No")
[["-", 15, 666, 0, 657, 12, 23, 0, 657, 31, 22], ["+", 15, 666, 0, 657, 12, 23, 0, 657, 31, 22]]
5
79
#include <algorithm> #include <cmath> #include <functional> #include <iostream> #include <iterator> #include <map> #include <queue> #include <set> #include <string> #include <vector> using _loop_int = int; #define REP(i, n) for (_loop_int i = 0; i < (_loop_int)(n); i++) #define FOR(i, a, b) for (_loop_int i = (_loop_in...
#include <algorithm> #include <cmath> #include <functional> #include <iostream> #include <iterator> #include <map> #include <queue> #include <set> #include <string> #include <vector> using _loop_int = int; #define REP(i, n) for (_loop_int i = 0; i < (_loop_int)(n); i++) #define FOR(i, a, b) for (_loop_int i = (_loop_in...
[["+", 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
214
#include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < (int)(n); i++) using namespace std; typedef vector<int> vi; typedef vector<double> di; typedef vector<vi> vvi; typedef pair<int, int> pii; // pair<int, int> に pii という別名を付ける typedef long long ll; int main() { cin.tie(0); ios::sync_with_stdio(false); i...
#include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < (int)(n); i++) using namespace std; typedef vector<int> vi; typedef vector<double> di; typedef vector<vi> vvi; typedef pair<int, int> pii; // pair<int, int> に pii という別名を付ける typedef long long ll; int main() { cin.tie(0); ios::sync_with_stdio(false); i...
[["-", 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], ["+", 49, 50, 51, 16, 31, 74, 39, 77, 39, 40], ["+", 0, 43, 49, 50, 51, 16, 31, 74, 0, 25], ["-", 51, 2, 3, 4, 0, 16, 12, 23, 0, 25]]
1
205
N, M = map(int, input().split()) list=[int(i) for i in input().split()] vote = 0 for v in list : vote = vote + v judge = vote / (4 * M) pop = 0 for x in range(0, N) : if list[x] > judge : pop = pop + 1 if pop >= M : print("Yes") else : print("No")
N, M = map(int, input().split()) list=[int(i) for i in input().split()] vote = 0 for v in list : vote = vote + v judge = vote / (4 * M) pop = 0 for x in range(0, N) : if list[x] >= judge : pop = pop + 1 if pop >= 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
101
#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 + 1; i++) #define REPR(i, n) for (int i = n; i >= 0; i--) #define FOR(i, m, n) for (int i = m; i < n; i++) #define INF 2e9 #define ALL(v) v.begin(), v.end() #define SZ(x) ((int)(x).size()) #define ARRAY_LENGT...
#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 + 1; i++) #define REPR(i, n) for (int i = n; i >= 0; i--) #define FOR(i, m, n) for (int i = m; i < n; i++) #define INF 2e9 #define ALL(v) v.begin(), v.end() #define SZ(x) ((int)(x).size()) #define ARRAY_LENGT...
[["-", 8, 9, 0, 57, 15, 339, 51, 16, 17, 47], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 17, 20]]
1
276
N,M = map(int,input().split()) score = list(map(int,input().split())) score = sorted(score,reverse=True) if score[M]*4*M < sum(score): print("No") else: print("Yes")
N,M = map(int,input().split()) score = list(map(int,input().split())) score = sorted(score,reverse=True) if score[M-1]*4*M < sum(score): print("No") else: print("Yes")
[["+", 0, 657, 31, 657, 31, 206, 206, 657, 17, 33], ["+", 0, 657, 31, 657, 31, 206, 206, 657, 12, 612]]
5
72
#include <bits/stdc++.h> #include <cstdio> #include <fstream> using namespace std; // cin.ignore();//twice getline(cin,s); // g++ iterator.cpp -std=c++17 // cout<<(A + B == C ? "YES" : "NO")<<endl; // __gcd(a,b) // string s=to_string(i); #define ff first #define ss second #define pb push_back #define mk make_pair #defi...
#include <bits/stdc++.h> #include <cstdio> #include <fstream> using namespace std; // cin.ignore();//twice getline(cin,s); // g++ iterator.cpp -std=c++17 // cout<<(A + B == C ? "YES" : "NO")<<endl; // __gcd(a,b) // string s=to_string(i); #define ff first #define ss second #define pb push_back #define mk make_pair #defi...
[["-", 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
219
def calc(): summ = sum(A) #print(summ) low = summ / (4*M) #print(low) newlist = [i for i in A if i >= low] #print(newlist) num = len(newlist) #print(num) if M <= num: print ("Yes") else: print ("No") N, M = map(int,input().split()) A = list(map(int, inpu...
def calc(): summ = sum(A) low = summ / (4*M) newlist = [i for i in A if i >= low] num = len(newlist) if M <= num: print ("Yes") else: print ("No") N, M = map(int,input().split()) A = list(map(int,input().split())) #N, M = 5, 2 #A = [110, 2, 20, 10, 0] calc()
[["+", 0, 652, 63, 319, 500, 652, 3, 4, 0, 24], ["+", 0, 652, 63, 319, 500, 652, 3, 4, 0, 25]]
5
98
#def calc(): #summ = sum(A) #print(summ) #low = summ / (4*M) #print(low) #newlist = [i for i in A if i >= low] #print(newlist) #num = len(newlist) #print(num) #if M <= num: #print ("Yes") #else: #print ("No") N, M = map(int,input().split()) A = list(map(...
#def calc(): #summ = sum(A) #print(summ) #low = summ / (4*M) #print(low) #newlist = [i for i in A if i >= low] #print(newlist) #num = len(newlist) #print(num) #if M <= num: #print ("Yes") #else: #print ("No") N, M = map(int,input().split()) A = list(map(...
[["+", 0, 652, 63, 319, 500, 652, 3, 4, 0, 24], ["+", 0, 652, 63, 319, 500, 652, 3, 4, 0, 25]]
5
94
n,m=map(int,input().split()) a=list(map(int,input().split())) t=sum(a) a=list(filter(lambda x: t/(4*m) < x, a)) print('Yes' if m <= len(a) else 'No')
n,m=map(int,input().split()) a=list(map(int,input().split())) t=sum(a) a=list(filter(lambda x: t/(4*m) <= x, a)) print('Yes' if m <= len(a) else 'No')
[["-", 0, 652, 3, 4, 0, 670, 8, 666, 667, 18], ["+", 0, 652, 3, 4, 0, 670, 8, 666, 667, 19]]
5
78
import java.util.*; public class Main { public static void main(String[] args) { Scanner scan = new Scanner(System.in); int x = 0; int N = scan.nextInt(); int M = scan.nextInt(); int souhyou = 0; int syouhin[] = new int[N]; for (int i = 0; i < N; i++) { syouhin[i] = scan.nextInt();...
import java.util.*; public class Main { public static void main(String[] args) { Scanner scan = new Scanner(System.in); int x = 0; int N = scan.nextInt(); int M = scan.nextInt(); int souhyou = 0; int syouhin[] = new int[N]; for (int i = 0; i < N; i++) { syouhin[i] = scan.nextInt();...
[["-", 0, 195, 8, 196, 0, 503, 39, 506, 0, 507], ["+", 0, 195, 8, 196, 0, 503, 39, 511, 0, 512], ["+", 0, 1, 0, 11, 12, 16, 31, 74, 0, 24], ["+", 0, 11, 12, 16, 31, 74, 39, 511, 0, 512], ["+", 0, 1, 0, 11, 12, 16, 31, 74, 0, 25], ["-", 8, 196, 0, 57, 15, 15, 0, 16, 17, 47], ["+", 8, 196, 0, 57, 15, 15, 0, 16, 17, 20]]
3
186
#include <algorithm> #include <cmath> #include <functional> #include <iomanip> #include <iostream> #include <map> #include <queue> #include <string> #include <unordered_map> #include <utility> #include <vector> template <class T> inline bool chmin(T &a, T b) { if (a > b) { a = b; return true; } return fa...
#include <algorithm> #include <cmath> #include <functional> #include <iomanip> #include <iostream> #include <map> #include <queue> #include <string> #include <unordered_map> #include <utility> #include <vector> template <class T> inline bool chmin(T &a, T b) { if (a > b) { a = b; return true; } return fa...
[["-", 51, 16, 12, 16, 12, 23, 0, 16, 12, 22], ["+", 51, 16, 12, 16, 12, 23, 0, 16, 12, 22]]
1
277
#include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < (n); i++) using namespace std; int main() { int n, m; scanf("%d%d", &n, &m); vector<int> a(n); rep(i, n) scanf("%d", &n); int sum = accumulate(a.begin(), a.end(), 0); int cnt = 0; rep(i, n) if (a[i] * 4 * m >= sum) cnt++; puts(cnt >= m ?...
#include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < (n); i++) using namespace std; int main() { int n, m; scanf("%d%d", &n, &m); vector<int> a(n); rep(i, n) scanf("%d", &a[i]); int sum = accumulate(a.begin(), a.end(), 0); int cnt = 0; rep(i, n) if (a[i] * 4 * m >= sum) cnt++; puts(cnt >= ...
[["-", 0, 1, 0, 2, 3, 4, 0, 66, 28, 22], ["+", 0, 2, 3, 4, 0, 66, 28, 69, 28, 22], ["+", 3, 4, 0, 66, 28, 69, 341, 342, 0, 70], ["+", 3, 4, 0, 66, 28, 69, 341, 342, 0, 22], ["+", 3, 4, 0, 66, 28, 69, 341, 342, 0, 73]]
1
130
#include <algorithm> #include <iostream> #include <vector> using namespace std; using ll = long long; using p = pair<int, int>; int main() { int n, m; cin >> n >> m; std::vector<int> a(n); int sum = 0; for (int i = 0; i < n; i++) { cin >> a[i]; sum += a[i]; } sort(a.rbegin(), a.rend()); string...
#include <algorithm> #include <iostream> #include <vector> using namespace std; using ll = long long; using p = pair<int, int>; int main() { int n, m; cin >> n >> m; std::vector<int> a(n); int sum = 0; for (int i = 0; i < n; i++) { cin >> a[i]; sum += a[i]; } sort(a.rbegin(), a.rend()); string...
[["+", 15, 339, 51, 16, 12, 16, 31, 74, 0, 24], ["+", 51, 16, 12, 16, 31, 74, 39, 77, 39, 40], ["+", 15, 339, 51, 16, 12, 16, 31, 74, 0, 25]]
1
145