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; int main() { int N, M; cin >> N >> M; vector<int> A(N); string ans = "Yes"; int sum = 0; for (int i = 0; i < N; i++) { cin >> A.at(i); sum += A.at(i); } double threshold = sum / (4 * M); sort(A.begin(), A.end(), greater<int>()); if (A.at(M -...
#include <bits/stdc++.h> using namespace std; int main() { int N, M; cin >> N >> M; vector<int> A(N); string ans = "Yes"; double total = 0; for (int i = 0; i < N; i++) { cin >> A.at(i); total += A.at(i); } double threshold = total / (4 * M); sort(A.begin(), A.end(), greater<int>()); if ...
[["-", 0, 30, 0, 14, 8, 9, 0, 43, 39, 40], ["-", 0, 14, 8, 9, 0, 43, 49, 50, 49, 22], ["+", 0, 30, 0, 14, 8, 9, 0, 43, 39, 40], ["+", 0, 14, 8, 9, 0, 43, 49, 50, 49, 22], ["-", 0, 7, 8, 9, 0, 1, 0, 11, 31, 22], ["+", 0, 7, 8, 9, 0, 1, 0, 11, 31, 22], ["-", 8, 9, 0, 43, 49, 50, 51, 16, 31, 22], ["+", 8, 9, 0, 43, 49, 50...
1
138
import java.util.Scanner; class Main { public static void main(String[] args) { Scanner stdIn = new Scanner(System.in); int N = stdIn.nextInt(); int M = stdIn.nextInt(); int count = 0; int sum = 0; int[] a = new int[N]; for (int i = 0; i < N; i++) { a[i] = stdIn.nextInt(); ...
import java.util.Scanner; class Main { public static void main(String[] args) { Scanner stdIn = new Scanner(System.in); int N = stdIn.nextInt(); int M = stdIn.nextInt(); int count = 0; int sum = 0; int[] a = new int[N]; for (int i = 0; i < N; i++) { a[i] = stdIn.nextInt(); ...
[["-", 0, 503, 49, 200, 51, 16, 31, 16, 12, 499], ["+", 0, 503, 49, 200, 51, 16, 31, 16, 12, 515]]
3
181
N, M = map(int, input().split()) A = list(map(int, input().split())) vote = sum(A) cnt = 0 for i in range(N-1): if A[i] >= vote / 4 / M: cnt += 1 if cnt >= M: print('Yes') else: print('No')
N, M = map(int, input().split()) A = list(map(int, input().split())) vote = sum(A) cnt = 0 for i in range(N): if A[i] >= vote / 4 / M: cnt += 1 else: continue if cnt >= M: print('Yes') else: print('No')
[["-", 0, 7, 12, 652, 3, 4, 0, 657, 17, 33], ["-", 0, 7, 12, 652, 3, 4, 0, 657, 12, 612], ["+", 0, 7, 8, 196, 0, 57, 75, 76, 0, 95], ["+", 0, 7, 8, 196, 0, 57, 75, 76, 0, 102], ["+", 0, 57, 75, 76, 8, 196, 0, 116, 0, 117]]
5
86
#include <bits/stdc++.h> using namespace std; int main() { int N, M, s, t; t = 0; cin >> N >> M; vector<int> A(N); for (int i = 0; i < N; i++) { cin >> A.at(i); } for (int j = 0; j < N; j++) { s = s + A.at(j); } for (int k = 0; k < N; k++) { if (A.at(k) >= (s / (4 * M))) { t = t + 1...
#include <bits/stdc++.h> using namespace std; int main() { int N, t; double s, M; t = 0; cin >> N >> M; vector<int> A(N); for (int i = 0; i < N; i++) { cin >> A.at(i); } for (int j = 0; j < N; j++) { s = s + A.at(j); } for (int k = 0; k < N; k++) { if (A.at(k) >= (s / (4 * M))) { ...
[["-", 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, 49, 22], ["+", 0, 30, 0, 14, 8, 9, 0, 43, 0, 35], ["+", 0, 30, 0, 14, 8, 9, 0, 43, 39, 40]]
1
153
#include <bits/stdc++.h> using namespace std; int main() { int n, m, count = 0; double sum = 0; cin >> n >> m; vector<int> v; for (int i = 0; i < n; i++) { int a; cin >> a; v.push_back(a); } for (int j = 0; j < n; j++) { sum = sum + (double)v[j]; } double check = ((double)sum / (double...
#include <bits/stdc++.h> using namespace std; int main() { int n, m, count = 0; double sum = 0; cin >> n >> m; vector<int> v; for (int i = 0; i < n; i++) { int a; cin >> a; v.push_back(a); } for (int j = 0; j < n; j++) { sum = sum + (double)v[j]; } double check = ((double)sum / (double...
[["-", 8, 9, 0, 57, 15, 339, 51, 16, 17, 18], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 17, 19]]
1
171
#include <algorithm> #include <cmath> #include <iomanip> #include <iostream> #include <numeric> #include <stdio.h> #include <string> #include <vector> using ll = long long; using namespace std; //#define int long long #define rep(i, n) for (int i = 0; i < (n); i++) #define irep(i, n) for (int i = 0; i <= (n); i++) #de...
#include <algorithm> #include <cmath> #include <iomanip> #include <iostream> #include <numeric> #include <stdio.h> #include <string> #include <vector> using ll = long long; using namespace std; //#define int long long #define rep(i, n) for (int i = 0; i < (n); i++) #define irep(i, n) for (int i = 0; i <= (n); i++) #de...
[["-", 0, 30, 0, 14, 8, 9, 0, 43, 39, 40], ["+", 0, 30, 0, 14, 8, 9, 0, 43, 39, 40]]
1
476
n, m = map(int, input().split()) l = list(map(int,input().split())) l = sorted(l)[::-1] check = l[m - 1] >= (sum(l) // 4 // m) print("Yes" if check else "No")
n, m = map(int, input().split()) l = list(map(int,input().split())) l = sorted(l)[::-1] check = l[m - 1] >= sum(l) / (4 * m) print("Yes" if check else "No")
[["-", 0, 1, 0, 662, 12, 666, 0, 23, 0, 24], ["-", 12, 666, 0, 23, 0, 657, 31, 657, 17, 676], ["+", 0, 1, 0, 662, 12, 666, 0, 657, 17, 85], ["+", 0, 662, 12, 666, 0, 657, 12, 23, 0, 24], ["-", 0, 662, 12, 666, 0, 23, 0, 657, 17, 676], ["+", 12, 666, 0, 657, 12, 23, 0, 657, 17, 48]]
5
76
#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()); double sum_ = 0.0; for (int i = 0; i < M; i++) { sum_ += A[i]; } int flag = 1; 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); for (int i = 0; i < N; i++) { cin >> A[i]; } sort(A.begin(), A.end()); double sum_ = 0.0; for (int i = 0; i < N; i++) { sum_ += A[i]; } int flag = 1; for (int i = 0; i < M; i++) { if ...
[["-", 0, 14, 8, 9, 0, 7, 15, 16, 12, 22], ["+", 0, 14, 8, 9, 0, 7, 15, 16, 12, 22]]
1
171
#include <algorithm> #include <cmath> #include <iomanip> #include <iostream> #include <limits> #include <stdio.h> #include <string> #include <vector> using namespace std; typedef unsigned long long ull; typedef long long ll; #define big ((ll)(1e9) + 7) int main() { int n, m; cin >> n >> m; vector<int> a(n); ...
#include <algorithm> #include <cmath> #include <iomanip> #include <iostream> #include <limits> #include <stdio.h> #include <string> #include <vector> using namespace std; typedef unsigned long long ull; typedef long long ll; #define big ((ll)(1e9) + 7) int main() { double n, m; cin >> n >> m; vector<double> a...
[["-", 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
164
N,M = list(map(int,input().split())) A=list(map(int, input().split())) total=sum(A) cnt=0 for a in A: if a*4*M>total: cnt=cnt+1 print("Yes" if cnt>=M else "No")
N,M = list(map(int,input().split())) A=list(map(int, input().split())) total=sum(A) cnt=0 for a in A: if a*4*M>=total: cnt=cnt+1 print("Yes" if cnt>=M else "No")
[["-", 0, 7, 8, 196, 0, 57, 15, 666, 667, 47], ["+", 0, 7, 8, 196, 0, 57, 15, 666, 667, 20]]
5
78
import java.util.Arrays; import java.util.Scanner; public class Main { public static void main(String args[]) { boolean judge = true; Scanner sc = new Scanner(System.in); int N = Integer.parseInt(sc.next()); int M = Integer.parseInt(sc.next()); int A[] = new int[N]; int sum = 0; for (i...
import java.util.Arrays; import java.util.Scanner; public class Main { public static void main(String args[]) { boolean judge = true; Scanner sc = new Scanner(System.in); int N = Integer.parseInt(sc.next()); int M = Integer.parseInt(sc.next()); int A[] = new int[N]; int sum = 0; for (i...
[["+", 0, 16, 12, 16, 31, 16, 31, 16, 31, 515], ["+", 0, 16, 12, 16, 31, 16, 31, 16, 17, 48]]
3
211
#include <bits/stdc++.h> using namespace std; int main() { int N, M, sum = 0; cin >> N >> M; vector<int> A(N); for (int i = 0; i < N; i++) { cin >> A.at(i); sum += A.at(i); } sort(A.begin(), A.end()); reverse(A.begin(), A.end()); if (A.at(M - 1) < sum / (4 * M)) { cout << "No" << endl; }...
#include <bits/stdc++.h> using namespace std; int main() { int N, M; double sum = 0; cin >> N >> M; vector<int> A(N); for (int i = 0; i < N; i++) { cin >> A.at(i); sum += A.at(i); } sort(A.begin(), A.end()); reverse(A.begin(), A.end()); if (A.at(M - 1) < sum / 4 / M) { cout << "No" << en...
[["-", 0, 30, 0, 14, 8, 9, 0, 43, 0, 21], ["+", 0, 30, 0, 14, 8, 9, 0, 43, 0, 35], ["+", 0, 30, 0, 14, 8, 9, 0, 43, 39, 40], ["-", 15, 339, 51, 16, 12, 16, 12, 23, 0, 24], ["-", 51, 16, 12, 16, 12, 23, 0, 16, 17, 48], ["+", 0, 57, 15, 339, 51, 16, 12, 16, 17, 85], ["-", 15, 339, 51, 16, 12, 16, 12, 23, 0, 25]]
1
140
#include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < (n); ++i) using namespace std; typedef long long ll; template <class T> inline bool chmin(T &a, T b) { if (a > b) { a = b; return true; } return false; } template <class T> inline bool chmax(T &a, T b) { if (a < b) { a = b; return t...
#include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < (n); ++i) using namespace std; typedef long long ll; template <class T> inline bool chmin(T &a, T b) { if (a > b) { a = b; return true; } return false; } template <class T> inline bool chmax(T &a, T b) { if (a < b) { a = b; return t...
[["-", 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, 2, 3, 4, 0, 13], ["+", 0, 43, 49, 50, 51, 2, 3, 4, 0, 13]]
1
212
import numpy as np [N, M] = list(map(int, input().split())) A = list(map(int, input().split())) threshold = int(np.sum(A) / (4 * M)) #print(threshold) Th = [a for a in A if threshold <= a] #print(Th) if len(Th) < M: ans = 'No' else: ans = 'Yes' print(ans)
import numpy as np [N, M] = list(map(int, input().split())) A = list(map(int, input().split())) threshold = np.sum(A) / (4 * M) #print(threshold) Th = [a for a in A if threshold <= a] #print(Th) if len(Th) < M: ans = 'No' else: ans = 'Yes' print(ans)
[["-", 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
98
#include <bits/stdc++.h> using namespace std; int n, m, a[105], ans, x; int main() { cin >> n >> m; for (int i = 1; i <= n; i++) cin >> a[i], x += a[i]; x = x / m / 4; for (int i = 1; i <= n; i++) if (a[i] >= x) ans++; if (ans >= m) cout << "Yes"; else cout << "No"; return 0; } // 68...
#include <bits/stdc++.h> using namespace std; int n, m, a[105], ans; double x; int main() { cin >> n >> m; for (int i = 1; i <= n; i++) cin >> a[i], x += a[i]; x = x / m / 4; for (int i = 1; i <= n; i++) if (a[i] >= x) ans++; if (ans >= m) cout << "Yes"; else cout << "No"; return 0; ...
[["-", 36, 36, 36, 36, 0, 30, 0, 43, 0, 21], ["+", 36, 36, 36, 36, 0, 30, 0, 43, 0, 35], ["+", 36, 36, 36, 36, 0, 30, 0, 43, 39, 40]]
1
121
#include <bits/stdc++.h> using namespace std; int main() { long long N, M; cin >> N >> M; vector<long long> vec(N); for (long long i = 0; i < N; i++) { cin >> vec.at(i); } long long sum = 0; for (long long i = 0; i < N; i++) { sum += vec.at(i); } sort(vec.begin(), vec.end()); reverse(vec....
#include <bits/stdc++.h> using namespace std; int main() { long long N, M; cin >> N >> M; vector<long long> vec(N); for (long long i = 0; i < N; i++) { cin >> vec.at(i); } long long sum = 0; for (long long i = 0; i < N; i++) { sum += vec.at(i); } sort(vec.begin(), vec.end()); reverse(vec....
[["-", 8, 9, 0, 57, 15, 339, 51, 16, 17, 47], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 17, 20]]
1
162
#pragma region Macros #include <bits/stdc++.h> using namespace std; using ll = long long; using Graph = vector<vector<int>>; using WGraph = vector<vector<pair<int, ll>>>; template <class T> inline bool chmax(T &a, const T &b) { if (b > a) { a = b; return true; } return false; } template <class T> inline...
#pragma region Macros #include <bits/stdc++.h> using namespace std; using ll = long long; using Graph = vector<vector<int>>; using WGraph = vector<vector<pair<int, ll>>>; template <class T> inline bool chmax(T &a, const T &b) { if (b > a) { a = b; return true; } return false; } template <class T> inline...
[["-", 0, 218, 8, 9, 0, 37, 0, 16, 17, 47], ["+", 0, 218, 8, 9, 0, 37, 0, 16, 17, 20]]
1
351
#include <iostream> #include <string> #include <vector> int main() { int M, N, ans = 0, sum = 0, tmp; std::vector<int> A; std::cin >> N >> M; for (auto i = 0; i < N; i++) { std::cin >> tmp; A.push_back(tmp); sum += tmp; } double a = (double)sum / (double)(4 * M); for (auto i = 0; i < N; i+...
#include <iostream> #include <string> #include <vector> int main() { int M, N, ans = 0, sum = 0, tmp; std::vector<int> A; std::cin >> N >> M; for (auto i = 0; i < N; i++) { std::cin >> tmp; A.push_back(tmp); sum += tmp; } double a = (double)sum / (double)(4 * M); for (auto i = 0; i < N; i+...
[["-", 8, 9, 0, 57, 15, 339, 51, 16, 17, 47], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 17, 20]]
1
158
n,m = map(int,input().split()) a = list(map(int,input().split())) a = sorted(a,reverse=True) ans = '' for i in range(m): if a[i] < sum(a)/4*m: ans = 'No' break else: ans = 'Yes' print(ans)
n,m = map(int,input().split()) a = list(map(int,input().split())) a = sorted(a,reverse=True) ans = '' for i in range(m): if a[i] < sum(a)/(4*m): ans = 'No' break else: ans = 'Yes' print(ans)
[["+", 0, 57, 15, 666, 0, 657, 12, 23, 0, 24], ["+", 0, 57, 15, 666, 0, 657, 12, 23, 0, 25]]
5
87
#include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < n; i++) using namespace std; using ll = long long; int main() { int n, m; cin >> n >> m; vector<int> a(n); rep(i, n) { cin >> a.at(i); } int sum = accumulate(a.begin(), a.end(), 0); float num = sum / (4 * m); int count = 0; rep(i, n) { ...
#include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < n; i++) using namespace std; using ll = long long; int main() { int n, m; cin >> n >> m; vector<int> a(n); rep(i, n) { cin >> a.at(i); } float sum = accumulate(a.begin(), a.end(), 0); float num = sum / (4 * m); int count = 0; rep(i, n) { ...
[["-", 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, 18], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 17, 19]]
1
150
#define _CRT_SECURE_NO_WARNINGS #include <algorithm> //C++ #include <iostream> //C++ #include <math.h> #include <queue> //C++ #include <sstream> //C++ #include <stdio.h> #include <stdlib.h> #include <string.h> #include <string> //C++ #include <vector> //C++ using namespace std; // C++ #define rep(i, a, n) for ...
#define _CRT_SECURE_NO_WARNINGS #include <algorithm> //C++ #include <iostream> //C++ #include <math.h> #include <queue> //C++ #include <sstream> //C++ #include <stdio.h> #include <stdlib.h> #include <string.h> #include <string> //C++ #include <vector> //C++ using namespace std; // C++ #define rep(i, a, n) for ...
[["-", 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], ["+", 15, 339, 51, 16, 12, 74, 51, 23, 0, 24], ["+", 12, 74, 51, 23, 0, 16, 12, 23, 0, 25]]
1
172
#include <bits/stdc++.h> typedef long long int lli; using namespace std; int main() { int N, M; cin >> N >> M; int A[N], total = 0; for (int i = 0; i < N; i++) { cin >> A[i]; total += A[i]; } float ratio = ((float)1 / (4 * M)); int flag = 0; for (auto x : A) { if (x >= (total * ratio)) ...
#include <bits/stdc++.h> typedef long long int lli; using namespace std; int main() { int N, M; cin >> N >> M; int A[N], total = 0; for (int i = 0; i < N; i++) { cin >> A[i]; total += A[i]; } float ratio = ((float)1 / (4 * M)); int flag = 0; for (auto x : A) { if (x >= (total * ratio)) ...
[["-", 0, 1, 0, 41, 64, 16, 12, 5, 0, 6], ["+", 0, 1, 0, 41, 64, 16, 12, 5, 0, 6], ["-", 0, 1, 0, 41, 75, 16, 12, 5, 0, 6], ["+", 0, 1, 0, 41, 75, 16, 12, 5, 0, 6]]
1
131
#include <bits/stdc++.h> using namespace std; using ll = long long; constexpr ll INF = 1'010'000'000'000'000'017LL; #define rep(i, n) for (int i = 0; i < (int)(n); i++) #define all(v) v.begin(), v.end() int main() { // AtCoder // template ll n, m; cin >> n >> m; vector<ll> a(n); rep(i, n) cin >> a[i]; ll...
#include <bits/stdc++.h> using namespace std; using ll = long long; constexpr ll INF = 1'010'000'000'000'000'017LL; #define rep(i, n) for (int i = 0; i < (int)(n); i++) #define all(v) v.begin(), v.end() int main() { // AtCoder // template ll n, m; cin >> n >> m; vector<ll> a(n); rep(i, n) cin >> a[i]; ll...
[["+", 28, 23, 0, 16, 31, 16, 31, 74, 0, 24], ["+", 0, 16, 31, 16, 31, 74, 39, 77, 39, 40], ["+", 28, 23, 0, 16, 31, 16, 31, 74, 0, 25], ["+", 28, 23, 0, 16, 31, 16, 12, 74, 0, 24], ["+", 0, 16, 31, 16, 12, 74, 39, 77, 39, 40], ["+", 28, 23, 0, 16, 31, 16, 12, 74, 0, 25]]
1
147
#include <bits/stdc++.h> using namespace std; int main() { int n, m; cin >> n >> m; int total = 0; vector<int> v(n); for (int i = 0; i < n; i++) { cin >> v[i]; total += v[i]; } int c = 0; double d = total / (4 * m); for (int i = 0; i < n; i++) { if (v[i] >= d) c += 1; } if (c >...
#include <bits/stdc++.h> using namespace std; int main() { int n, m; cin >> n >> m; int total = 0; vector<int> v(n); for (int i = 0; i < n; i++) { cin >> v[i]; total += v[i]; } int c = 0; double d = 1.0 * total / (4 * m); for (int i = 0; i < n; i++) { if (v[i] >= d) c += 1; } i...
[["+", 0, 43, 49, 50, 51, 16, 31, 16, 31, 13], ["+", 0, 43, 49, 50, 51, 16, 31, 16, 17, 48]]
1
131
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 total = 0; int[] votes = new int[n]; for (int i = 0; i < n; i++) { votes[i] = sc.nextInt(); total += votes[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 total = 0; int[] votes = new int[n]; for (int i = 0; i < n; i++) { votes[i] = sc.nextInt(); total += votes[i]; }...
[["-", 49, 200, 51, 16, 31, 74, 51, 23, 0, 24], ["-", 31, 74, 51, 23, 0, 16, 12, 23, 0, 25], ["+", 0, 503, 49, 200, 51, 16, 12, 74, 0, 24], ["+", 49, 200, 51, 16, 12, 74, 39, 511, 0, 512], ["+", 0, 503, 49, 200, 51, 16, 12, 74, 0, 25]]
3
185
n, m = map(int, input().split()) plist = list(map(int, input().split())) plist.sort(reverse=True) if(plist[m-1]<sum(plist)/4/m): print('no') else: print('yes')
n, m = map(int, input().split()) plist = list(map(int, input().split())) plist.sort(reverse=True) if(plist[m-1]<sum(plist)/4/m): print('No') else: print('Yes')
[["-", 0, 1, 0, 652, 3, 4, 0, 557, 0, 6], ["+", 0, 1, 0, 652, 3, 4, 0, 557, 0, 6]]
5
74
import java.util.ArrayList; 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(); ArrayList<Integer> list = new ArrayList<>(); for (int i = 0; i < n; i++) { int c = sc.next...
import java.util.ArrayList; 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(); ArrayList<Integer> list = new ArrayList<>(); for (int i = 0; i < n; i++) { int c = sc.next...
[["+", 0, 503, 49, 200, 51, 16, 12, 74, 0, 24], ["+", 49, 200, 51, 16, 12, 74, 39, 511, 0, 512], ["+", 0, 503, 49, 200, 51, 16, 12, 74, 0, 25], ["-", 0, 57, 15, 15, 0, 16, 12, 74, 0, 24], ["-", 15, 15, 0, 16, 12, 74, 39, 506, 0, 507], ["-", 0, 57, 15, 15, 0, 16, 12, 74, 0, 25]]
3
226
n, m = map(int, input().split()) rank = list(map(int, input().split())) rank.sort(reverse=True) cnt = 0 for r in rank: if r >= (sum(rank)//(4*m)): cnt += 1 if cnt >= m: break if cnt >= m : print('Yes') else: print('No')
n, m = map(int, input().split()) rank = list(map(int, input().split())) rank.sort(reverse=True) cnt = 0 for r in rank: if r >= (sum(rank)/(4*m)): cnt += 1 if cnt >= m: break if cnt >= m : print('Yes') else: print('No')
[["-", 0, 57, 15, 666, 0, 23, 0, 657, 17, 676], ["+", 0, 57, 15, 666, 0, 23, 0, 657, 17, 85]]
5
93
#include <algorithm> #include <iostream> using namespace std; int main() { int N, M; cin >> N >> M; int a[N]; for (int i = 0; i < N; i++) cin >> a[i]; sort(a, a + N, greater<int>()); int sum = 0; for (int i = 0; i < N; i++) { sum += a[i]; } float num = (float)sum / (2 * M); if (a[M - 1] >= ...
#include <algorithm> #include <iostream> using namespace std; int main() { int N, M; cin >> N >> M; int a[N]; for (int i = 0; i < N; i++) cin >> a[i]; sort(a, a + N, greater<int>()); int sum = 0; for (int i = 0; i < N; i++) { sum += a[i]; } float num = (float)sum / (4 * M); if (a[M - 1] >= ...
[["-", 49, 50, 51, 16, 12, 23, 0, 16, 31, 13], ["+", 49, 50, 51, 16, 12, 23, 0, 16, 31, 13]]
1
142
#include <algorithm> #include <iostream> #include <list> #include <map> #include <math.h> #include <queue> //#include <bits/stdc++.h> using namespace std; #define FOR(i, a, b) for (int i = (a), i##formax = (b); i < i##formax; i++) typedef long long ll; int main() { int N, M; int sum = 0, popSum = 0; cin >> N >...
#include <algorithm> #include <iostream> #include <list> #include <map> #include <math.h> #include <queue> //#include <bits/stdc++.h> using namespace std; #define FOR(i, a, b) for (int i = (a), i##formax = (b); i < i##formax; i++) typedef long long ll; int main() { int N, M; int sum = 0, popSum = 0; cin >> N >...
[["-", 0, 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], ["+", 0, 9, 0, 57, 15, 339, 51, 16, 17...
1
146
N, M = map(int, input().split()) vote_result_list = sorted(list(map(int,input().split())))[::-1] border = sum(vote_result_list)//(4*M) print("Yes" if vote_result_list[M-1] >= border else "No")
N, M = map(int, input().split()) vote_result_list = sorted(list(map(int,input().split())))[::-1] border = sum(vote_result_list)/(4*M) print("Yes" if vote_result_list[M-1] >= border else "No")
[["-", 0, 656, 0, 1, 0, 662, 12, 657, 17, 676], ["+", 0, 656, 0, 1, 0, 662, 12, 657, 17, 85]]
5
73
N,M= map(int,input().split()) a = list(map(int, input().split())) count = 0 for i in range(N): if a[i] > sum(a)/(4*M): count +=1 print("Yes" if count>=M else "No")
N,M= map(int,input().split()) a = list(map(int, input().split())) count = 0 for i in range(N): if a[i] >= sum(a)/(4*M): count +=1 print("Yes" if count>=M else "No")
[["-", 0, 7, 8, 196, 0, 57, 15, 666, 667, 47], ["+", 0, 7, 8, 196, 0, 57, 15, 666, 667, 20]]
5
78
N,M=map(int,input().split()) A=list(map(int,input().split())) count=0 for i in range(N): if A[i] >= int(sum(A)/(4*M)): count+=1 if count>= M: print("Yes") else: print("No")
N,M=map(int,input().split()) A=list(map(int,input().split())) count=0 for i in range(N): if A[i] >= sum(A)/(4*M): count+=1 if count >= M: print("Yes") else: print("No")
[["-", 8, 196, 0, 57, 15, 666, 0, 652, 63, 22], ["-", 0, 57, 15, 666, 0, 652, 3, 4, 0, 24], ["-", 0, 652, 3, 4, 0, 657, 12, 23, 0, 25]]
5
86
#include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < (n); ++i) using namespace std; using ll = long long; using P = pair<int, int>; int main() { int n, m; cin >> n >> m; vector<int> a(n); rep(i, n) cin >> a[i]; int count = 0; ll sum = 0; rep(i, n) sum += a[i]; double cri = sum / (4 * m); re...
#include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < (n); ++i) using namespace std; using ll = long long; using P = pair<int, int>; int main() { long double n, m; cin >> n >> m; vector<int> a(n); rep(i, n) cin >> a[i]; int count = 0; long double sum = 0; rep(i, n) sum += a[i]; long double cri...
[["-", 0, 30, 0, 14, 8, 9, 0, 43, 39, 40], ["+", 0, 14, 8, 9, 0, 43, 39, 86, 0, 96], ["+", 0, 14, 8, 9, 0, 43, 39, 86, 39, 40], ["-", 0, 30, 0, 14, 8, 9, 0, 43, 39, 78]]
1
151
#include <stdio.h> int main(void) { int N, M; scanf("%d%d", &N, &M); int A[N], i, sum = 0; for (i = 0; i < N; i++) { scanf("%d", &A[i]); sum += A[i]; } int flag = 0; for (i = 0; i < N; i++) { if (A[i] >= sum / (4 * M)) flag++; } if (flag >= M) printf("Yes"); else printf("N...
#include <stdio.h> int main(void) { int N, M; scanf("%d%d", &N, &M); int A[N], i; double sum = 0; for (i = 0; i < N; i++) { scanf("%d", &A[i]); sum += A[i]; } int flag = 0; for (i = 0; i < N; i++) { if (A[i] >= sum / 4 / M) flag++; } if (flag >= M) printf("Yes"); else pr...
[["-", 0, 30, 0, 14, 8, 9, 0, 43, 0, 21], ["+", 0, 30, 0, 14, 8, 9, 0, 43, 0, 35], ["+", 0, 30, 0, 14, 8, 9, 0, 43, 39, 40], ["-", 15, 23, 0, 16, 12, 16, 12, 23, 0, 24], ["-", 0, 16, 12, 16, 12, 23, 0, 16, 17, 48], ["+", 0, 57, 15, 23, 0, 16, 12, 16, 17, 85], ["-", 15, 23, 0, 16, 12, 16, 12, 23, 0, 25]]
0
136
N,M= map(int, input().split()) item_list=sorted(list(map(int,input().split()))) possible_choice = len([1 for x in item_list if x>(sum(item_list)/(4*M))]) if possible_choice >= M: print('Yes') else: print('No')
N,M= map(int, input().split()) item_list=sorted(list(map(int,input().split()))) possible_choice = len([1 for x in item_list if x>=(sum(item_list)/(4*M))]) if possible_choice >= M: print('Yes') else: print('No')
[["-", 3, 4, 0, 658, 0, 678, 0, 666, 667, 47], ["+", 3, 4, 0, 658, 0, 678, 0, 666, 667, 20]]
5
82
#include <bits/stdc++.h> #include <cstdio> using namespace std; #define rep(i, n) for (int i = 0; i < (n); i++) void printVector(vector<long> l) { for (long i = 0; i < l.size(); i++) { if (i != 0) { cout << " "; } cout << l.at(i); } cout << endl; } vector<long> inputVector(long n) { vector<lo...
#include <bits/stdc++.h> #include <cstdio> using namespace std; #define rep(i, n) for (int i = 0; i < (n); i++) void printVector(vector<long> l) { for (long i = 0; i < l.size(); i++) { if (i != 0) { cout << " "; } cout << l.at(i); } cout << endl; } vector<long> inputVector(long n) { vector<lo...
[["-", 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
324
def main(): N, M = map(int, input().split()) A = [int(a) for a in input().split()] total = sum(A) cnt = 0 for i in range(N): if A[i] < total*1.0/(4.0*M): pass else: cnt += 1 if cnt >= M: print("Yes") else: print("NO") main()
def main(): N, M = map(int, input().split()) A = [int(a) for a in input().split()] total = sum(A) cnt = 0 for i in range(N): if A[i] < total*1.0/(4.0*M): pass else: cnt += 1 if cnt >= M: print("Yes") else: print("No") main()
[["-", 0, 1, 0, 652, 3, 4, 0, 557, 0, 6], ["+", 0, 1, 0, 652, 3, 4, 0, 557, 0, 6]]
5
100
#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[i]; sort(a.begin(), a.end(), greater<int>()); int sum = accumulate(a.begin(), a.end(), 0); if (a[M - 1] < ...
#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[i]; sort(a.begin(), a.end(), greater<int>()); int sum = accumulate(a.begin(), a.end(), 0); // cout << 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
138
#include "bits/stdc++.h" #include <cstring> using namespace std; #define rep(i, n) for (int i = 0; i < n; i++) typedef long long ll; int main() { int n, m; int cnt = 0; int ttl_vote = 0; cin >> n >> m; vector<int> a(n); rep(i, n) { cin >> a[i]; ttl_vote += a[i]; } rep(i, n) { if (a[i] > (...
#include "bits/stdc++.h" #include <cstring> using namespace std; #define rep(i, n) for (int i = 0; i < n; i++) typedef long long ll; int main() { int n, m; int cnt = 0; int ttl_vote = 0; cin >> n >> m; vector<int> a(n); rep(i, n) { cin >> a[i]; ttl_vote += a[i]; } rep(i, n) { if (a[i] >= ...
[["-", 8, 9, 0, 57, 15, 339, 51, 16, 17, 47], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 17, 20]]
1
141
n, m = map(int, input().split()) a = list(map(int, input().split())) def fun(n, m, a): total = sum(a) num = float(total)/(4*m) flag = sum([i > num for i in a]) return flag >= m ans = fun(n, m, a) if ans: print("Yes") else: print("No")
n, m = map(int, input().split()) a = list(map(int, input().split())) def fun(n, m, a): total = sum(a) num = float(total)/(4*m) flag = sum([i >= num for i in a]) return flag >= m ans = fun(n, m, a) if ans: print("Yes") else: print("No")
[["-", 12, 652, 3, 4, 0, 658, 8, 666, 667, 47], ["+", 12, 652, 3, 4, 0, 658, 8, 666, 667, 20]]
5
106
#include <stdio.h> int main() { int n, m; int a[128]; int i; int sum = 0; int flag = 0; scanf("%d %d", &n, &m); for (i = 0; i < n; i++) { scanf("%d ", &a[i]); } for (i = 0; i < n; i++) { sum += a[i]; } for (i = 0; i < n; i++) { if ((sum / (4 * m)) <= a[i]) { flag++; } ...
#include <stdio.h> int main() { float n, m; float a[128]; int i; float sum = 0; int flag = 0; scanf("%f %f", &n, &m); for (i = 0; i < n; i++) { scanf("%f ", &a[i]); } for (i = 0; i < n; i++) { sum += a[i]; } for (i = 0; i < n; i++) { if ((sum / (4 * m)) <= a[i]) { flag++; ...
[["-", 0, 30, 0, 14, 8, 9, 0, 43, 39, 40], ["+", 0, 30, 0, 14, 8, 9, 0, 43, 39, 40], ["-", 0, 1, 0, 2, 3, 4, 0, 5, 0, 6], ["+", 0, 1, 0, 2, 3, 4, 0, 5, 0, 6]]
1
160
<?php // Your code here! $input = fscanf(STDIN,"%d %d",$a,$b); $array = trim(fgets(STDIN)); $array = explode(" ", $array); $border = 1 /(4 * $b); $num = 0; foreach($array as $v){ if($v/array_sum($array) > $border){ $num++; } } if($num >= $b){ echo "Yes"; }else{ echo "...
<?php // Your code here! $input = fscanf(STDIN,"%d %d",$a,$b); $array = trim(fgets(STDIN)); $array = explode(" ", $array); $border = 1 /(4 * $b); $num = 0; foreach($array as $v){ if($v/array_sum($array) >= $border){ $num++; } } if($num >= $b){ echo "Yes"; }else{ echo ...
[["-", 8, 9, 0, 57, 15, 23, 0, 16, 17, 47], ["+", 8, 9, 0, 57, 15, 23, 0, 16, 17, 20]]
6
115
nm = [int(x) for x in input().split(' ')] vote = [int(v) for v in input().split(' ')] sum_vote = sum(vote) thresh = sum_vote / (4 * nm[1]) vote_valid = [True if v > thresh else False for v in vote] sum_vote_valid = sum(vote_valid) if sum_vote_valid >= nm[1]: print('Yes') else: print('No')
nm = [int(x) for x in input().split(' ')] vote = [int(v) for v in input().split(' ')] sum_vote = sum(vote) thresh = sum_vote / (4 * nm[1]) vote_valid = [True if v >= thresh else False for v in vote] sum_vote_valid = sum(vote_valid) if sum_vote_valid >= nm[1]: print('Yes') else: print('No')
[["-", 0, 662, 12, 658, 8, 41, 0, 666, 667, 47], ["+", 0, 662, 12, 658, 8, 41, 0, 666, 667, 20]]
5
103
N,M=map(int,input().split()) A=list(map(int,input().split())) L=sum(A)/(4*M) j=0 A1=sorted(A,reverse=True) for i in range(M): if A1[i]>L: j+=0 else: j+=1 if j==0: print("Yes") else: print("No")
N,M=map(int,input().split()) A=list(map(int,input().split())) L=sum(A)/(4*M) j=0 A1=sorted(A,reverse=True) for i in range(M): if A1[i]>=L: j+=0 else: j+=1 if j==0: print("Yes") else: print("No")
[["-", 0, 7, 8, 196, 0, 57, 15, 666, 667, 47], ["+", 0, 7, 8, 196, 0, 57, 15, 666, 667, 20]]
5
101
N,M = map(int, input().split()) num_list = list(map(int, input().split())) sum_num=sum(num_list) sum=0 for i in range(N): item_no=num_list[i] if(item_no>sum_num/(4*M)): sum=sum+1 if(sum>=M): print('Yes') else: print('No')
N,M = map(int, input().split()) num_list = list(map(int, input().split())) sum_num=sum(num_list) sum=0 for i in range(N): item_no=num_list[i] if(item_no>=sum_num/(4*M)): sum=sum+1 if(sum>=M): print('Yes') else: print('No')
[["-", 8, 196, 0, 57, 15, 23, 0, 666, 667, 47], ["+", 8, 196, 0, 57, 15, 23, 0, 666, 667, 20]]
5
95
#include <bits/stdc++.h> #define MOD 100000007 #define PI 3.141592653589793238 #define pb push_back #define ALL(V) (V).begin(), (V).end() #define rep(i, a, b) for (int i = (a); i < (b); ++i) using namespace std; typedef long long ll; typedef unsigned long long ull; typedef long long int lint; typedef vector<ll> VL; typ...
#include <bits/stdc++.h> #define MOD 100000007 #define PI 3.141592653589793238 #define pb push_back #define ALL(V) (V).begin(), (V).end() #define rep(i, a, b) for (int i = (a); i < (b); ++i) using namespace std; typedef long long ll; typedef unsigned long long ull; typedef long long int lint; typedef vector<ll> VL; typ...
[["-", 51, 16, 12, 16, 12, 23, 0, 16, 31, 13], ["+", 51, 16, 12, 16, 12, 23, 0, 16, 31, 13]]
1
346
#include <bits/stdc++.h> using namespace std; #define ll long long #define pb push_back #define mp make_pair #define ff first #define ss second #define SQ(x) ((x) * (x)) #define LCM(x, y) (((x) / gcd((x), (y))) * (y)) #define PI acos(-1) #define SZ(x) x.size() - 1 #define waa printf("Ripon\n") #define mem(a, b) memset(...
#include <bits/stdc++.h> using namespace std; #define ll long long #define pb push_back #define mp make_pair #define ff first #define ss second #define SQ(x) ((x) * (x)) #define LCM(x, y) (((x) / gcd((x), (y))) * (y)) #define PI acos(-1) #define SZ(x) x.size() - 1 #define waa printf("Ripon\n") #define mem(a, b) memset(...
[["-", 0, 57, 15, 339, 51, 16, 31, 16, 17, 33], ["-", 0, 57, 15, 339, 51, 16, 31, 16, 12, 22], ["-", 8, 9, 0, 57, 15, 339, 51, 16, 12, 13], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 12, 22]]
1
467
import java.util.ArrayList; import java.util.Comparator; import java.util.Scanner; import java.util.stream.Collectors; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int N = sc.nextInt(), M = sc.nextInt(); ArrayList<Integer> list = new ArrayList<>(); ...
import java.util.ArrayList; import java.util.Comparator; import java.util.Scanner; import java.util.stream.Collectors; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int N = sc.nextInt(), M = sc.nextInt(); ArrayList<Integer> list = new ArrayList<>(); ...
[["-", 0, 195, 8, 196, 0, 503, 39, 506, 0, 507], ["+", 0, 195, 8, 196, 0, 503, 39, 511, 0, 512]]
3
222
#include <bits/stdc++.h> using namespace std; int main() { int n, m, sum = 0, cnt = 0; vector<int> v; scanf("%d %d", &n, &m); for (int i = 0; i < n; i++) { int a; scanf("%d", &a); sum += a; v.push_back(a); } int ans = sum / (4 * m); for (int i = 0; i < n; i++) { if (v[i] >= ans) ...
#include <bits/stdc++.h> using namespace std; int main() { int n, m, cnt = 0; double sum = 0; vector<int> v; scanf("%d %d", &n, &m); for (int i = 0; i < n; i++) { int a; scanf("%d", &a); sum += a; v.push_back(a); } double ans = sum / (4 * m); for (int i = 0; i < n; i++) { if (v[i] ...
[["-", 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, 30, 0, 14, 8, 9, 0, 43, 39, 40]]
1
149
#include <algorithm> #include <iostream> #include <numeric> #include <set> #include <string> #include <vector> using namespace std; int main() { int N, M; cin >> N >> M; vector<int> A(N); for (auto it = A.begin(); it != A.end(); ++it) cin >> *it; // for (auto it = A.begin(); it != A.end(); ++it)cout <<...
#include <algorithm> #include <iostream> #include <numeric> #include <set> #include <string> #include <vector> using namespace std; int main() { int N, M; cin >> N >> M; vector<int> A(N); for (auto it = A.begin(); it != A.end(); ++it) cin >> *it; // for (auto it = A.begin(); it != A.end(); ++it)cout <<...
[["-", 8, 9, 0, 57, 15, 339, 51, 16, 17, 47], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 17, 20]]
1
161
#include <bits/stdc++.h> #include <iostream> using namespace std; int main() { ios_base::sync_with_stdio(false); cin.tie(NULL); int m, n; cin >> n >> m; int item; int selected = 0; int total_votes = 0; vector<int> input; for (int i = 0; i < n; i++) { cin >> item; input.push_back(item); ...
#include <bits/stdc++.h> #include <iostream> using namespace std; int main() { ios_base::sync_with_stdio(false); cin.tie(NULL); int m, n; cin >> n >> m; int item; int selected = 0; int total_votes = 0; vector<int> input; for (int i = 0; i < n; i++) { cin >> item; input.push_back(item); ...
[["-", 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
176
#include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < (n); i++) #define ALL(v) v.begin(), v.end() using namespace std; int main() { int n, m; cin >> n >> m; vector<int> a(n); int sum = 0; rep(i, n) { cin >> a[i]; sum += a[i]; } sort(ALL(a)); reverse(ALL(a)); if (a[m - 1] >= int(sum /...
#include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < (n); i++) #define ALL(v) v.begin(), v.end() using namespace std; int main() { int n, m; cin >> n >> m; vector<int> a(n); int sum = 0; rep(i, n) { cin >> a[i]; sum += a[i]; } sort(ALL(a)); reverse(ALL(a)); if (double(a[m - 1]) >= d...
[["+", 0, 57, 15, 339, 51, 16, 31, 2, 63, 40], ["+", 15, 339, 51, 16, 31, 2, 3, 4, 0, 24], ["+", 15, 339, 51, 16, 31, 2, 3, 4, 0, 25], ["-", 0, 57, 15, 339, 51, 16, 12, 2, 63, 40], ["+", 0, 57, 15, 339, 51, 16, 12, 2, 63, 40], ["+", 12, 2, 3, 4, 0, 16, 12, 2, 63, 40]]
1
124
#include <bits/stdc++.h> using namespace std; #define pb push_back int main() { int N, M; int vote; float sum = 0; vector<int> votes; cin >> N >> M; for (int i = 0; i < N; i++) { cin >> vote; votes.pb(vote); sum += vote; } float over = 4 * M; float min = sum / over; sort(votes.rbeg...
#include <bits/stdc++.h> using namespace std; #define pb push_back int main() { int N, M; int vote; float sum = 0; vector<int> votes; cin >> N >> M; for (int i = 0; i < N; i++) { cin >> vote; votes.pb(vote); sum += vote; } float over = 4 * M; float min = sum / over; sort(votes.rbeg...
[["-", 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
145
#include <bits/stdc++.h> using namespace std; int main() { int N, M; cin >> N >> M; int sum = 0; vector<int> vec(N, 0); for (int i = 0; i < N; i++) { cin >> vec.at(i); sum += vec.at(i); } sort(vec.begin(), vec.end()); if (vec.at(M - 1) * 4 * M >= sum) { cout << "Yes"; } else { cout << ...
#include <bits/stdc++.h> using namespace std; int main() { int N, M; cin >> N >> M; int sum = 0; vector<int> vec(N, 0); for (int i = 0; i < N; i++) { cin >> vec.at(i); sum += vec.at(i); } sort(vec.begin(), vec.end()); if (vec.at(N - M) * 4 * M >= sum) { cout << "Yes"; } else { cout << ...
[["-", 31, 16, 31, 2, 3, 4, 0, 16, 31, 22], ["+", 31, 16, 31, 2, 3, 4, 0, 16, 31, 22], ["-", 31, 16, 31, 2, 3, 4, 0, 16, 12, 13], ["+", 31, 16, 31, 2, 3, 4, 0, 16, 12, 22]]
1
122
#include <bits/stdc++.h> using namespace std; typedef double db; typedef long long ll; typedef unsigned long long ull; typedef long double ld; typedef pair<ll, ll> pll; typedef pair<int, int> pii; typedef vector<ll> vll; typedef vector<int> vi; typedef complex<double> com; #define endl '\n' #define eb emplace_back #d...
#include <bits/stdc++.h> using namespace std; typedef double db; typedef long long ll; typedef unsigned long long ull; typedef long double ld; typedef pair<ll, ll> pll; typedef pair<int, int> pii; typedef vector<ll> vll; typedef vector<int> vi; typedef complex<double> com; #define endl '\n' #define eb emplace_back #d...
[["-", 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, 49, 22], ["+", 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
284
n, m = map(int, input().split()) array = list(map(int, input().split())) array.sort(reverse = True) std = int(sum(array) / (4 * m)) if array[m - 1] < std: print("No") else: print("Yes")
n, m = map(int, input().split()) array = list(map(int, input().split())) array.sort(reverse = True) std = sum(array) / (4 * m) if array[m - 1] < std: 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
80
#include <iostream> using namespace std; int main() { int n, m; cin >> n >> m; int a[n]; int sum = 0; for (int i = 0; i < n; i++) { cin >> a[i]; sum += a[i]; } int count = 0; for (int i = 0; i < n; i++) { if (a[i] >= sum / (m * 4)) count++; } if (count >= m) cout << "Yes" << en...
#include <iostream> using namespace std; int main() { int n, m; cin >> n >> m; double a[n]; double sum = 0; for (int i = 0; i < n; i++) { cin >> a[i]; sum += a[i]; } double count = 0; for (int i = 0; i < n; i++) { if (a[i] >= sum / (m * 4)) count++; } if (count >= m) cout << "Y...
[["-", 0, 30, 0, 14, 8, 9, 0, 43, 39, 40], ["+", 0, 30, 0, 14, 8, 9, 0, 43, 39, 40]]
1
129
#include <bits/stdc++.h> using namespace std; int main() { int n, m; double sum; cin >> n >> m; vector<int> a(n); for (int i = 0; i < n; i++) cin >> a[i]; for (int i = 0; i < n; i++) sum += a.at(i); sort(a.begin(), a.end()); if (a.at(n - m) > sum / (4 * m)) cout << "Yes" << endl; else ...
#include <bits/stdc++.h> using namespace std; int main() { int n, m; double sum; cin >> n >> m; vector<int> a(n); for (int i = 0; i < n; i++) cin >> a[i]; for (int i = 0; i < n; i++) sum += a.at(i); sort(a.begin(), a.end()); if (a.at(n - m) >= sum / (4 * m)) cout << "Yes" << endl; else ...
[["-", 8, 9, 0, 57, 15, 339, 51, 16, 17, 47], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 17, 20]]
1
130
M,N=map(int,input().split()) A = list(map(int,input().split())) b=sum(A) s=sorted(A) if s[-M]>=(b/(4*M)): print("Yes") else: print("No")
N,M=map(int,input().split()) A = list(map(int,input().split())) b=sum(A) s=sorted(A) if s[-M]>=(b/(4*M)): print("Yes") else: print("No")
[["-", 0, 656, 0, 1, 0, 662, 31, 684, 0, 22], ["-", 0, 656, 0, 1, 0, 662, 31, 684, 0, 21], ["+", 0, 656, 0, 1, 0, 662, 31, 684, 0, 21], ["+", 0, 656, 0, 1, 0, 662, 31, 684, 0, 22]]
5
76
#include <algorithm> #include <iostream> using namespace std; int main() { int n, m; cin >> n >> m; int a[n]; long sum = 0; for (int i = 0; i < n; i++) { cin >> a[i]; sum += a[i]; } double judge = sum / (m * 4); int cnt = 0; for (int i = 0; i < n; i++) { if (a[i] > judge) { cnt++; ...
#include <algorithm> #include <iostream> using namespace std; int main() { int n, m; cin >> n >> m; int a[n]; double sum = 0; for (int i = 0; i < n; i++) { cin >> a[i]; sum += a[i]; } double judge = sum / (m * 4); // cout << judge << endl; int cnt = 0; for (int i = 0; i < n; i++) { if (a...
[["-", 0, 14, 8, 9, 0, 43, 39, 86, 0, 96], ["+", 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
142
#include <iostream> #include <vector> using namespace std; int main() { int n, m; // n�C���I�� cin >> n >> m; vector<int> sina(n); int i; for (i = 0; i < n; i++) cin >> sina[i]; int x = 0; for (i = 0; i < n; i++) x += sina[i]; auto z = ((long double)(x / (4 * m))); int y = 0; for (i = 0; ...
#include <iostream> #include <vector> using namespace std; int main() { int n, m; // n個,m選ぶ cin >> n >> m; vector<int> sina(n); int i; for (i = 0; i < n; i++) cin >> sina[i]; int x = 0; for (i = 0; i < n; i++) x += sina[i]; auto z = ((long double)(x / (long double)(4 * m))); int y = 0; for...
[["+", 0, 16, 12, 74, 39, 77, 39, 86, 0, 96], ["+", 0, 16, 12, 74, 39, 77, 39, 86, 39, 40], ["+", 0, 74, 51, 23, 0, 16, 12, 74, 0, 25], ["+", 51, 23, 0, 16, 12, 74, 51, 23, 0, 24]]
1
166
N,M = map(int,input().split()) L = list(map(int,input().split())) S = sum(L) L = sorted(L) A = 0 #print(L) for i in L: print(i) if i >= S/4/M: A += 1 #print(A) if A >= M: print("Yes") else: print("No")
N,M = map(int,input().split()) L = list(map(int,input().split())) S = sum(L) L = sorted(L) A = 0 #print(L) for i in L: #print(i) if i >= S/4/M: A += 1 #print(A) if A >= M: print("Yes") else: print("No")
[["-", 0, 7, 8, 196, 0, 1, 0, 652, 63, 22], ["-", 8, 196, 0, 1, 0, 652, 3, 4, 0, 24], ["-", 8, 196, 0, 1, 0, 652, 3, 4, 0, 22], ["-", 8, 196, 0, 1, 0, 652, 3, 4, 0, 25]]
5
90
#include <bits/stdc++.h> using namespace std; #define ll long long #define ull unsigned long long const int INF = 0x3fffffff; const ll MOD = 1000000007; const ll MODD = 998244353; #define rrep(i, n) for (ll i = (ll)(n)-1; i >= 0; i--) #define REP(i, m, n) for (ll i = (ll)(m); i < (ll)(n); i++) #define rep(i, n) REP(i, ...
#include <bits/stdc++.h> using namespace std; #define ll long long #define ull unsigned long long const int INF = 0x3fffffff; const ll MOD = 1000000007; const ll MODD = 998244353; #define rrep(i, n) for (ll i = (ll)(n)-1; i >= 0; i--) #define REP(i, m, n) for (ll i = (ll)(m); i < (ll)(n); i++) #define rep(i, n) REP(i, ...
[["-", 0, 30, 0, 14, 8, 9, 0, 43, 0, 21], ["-", 0, 14, 8, 9, 0, 43, 49, 50, 49, 22], ["-", 0, 14, 8, 9, 0, 43, 49, 50, 0, 32], ["-", 0, 14, 8, 9, 0, 43, 49, 50, 51, 13], ["+", 8, 9, 0, 43, 49, 50, 0, 42, 0, 22], ["+", 0, 14, 8, 9, 0, 43, 49, 50, 0, 32], ["+", 0, 14, 8, 9, 0, 43, 49, 50, 51, 13], ["+", 0, 30, 0, 14, 8, ...
1
262
N,M=map(int,input().split()) A=list(map(int,input().split())) total_vote=sum(A)/(4*M) sele=0 for i in A: if i > total_vote: sele+=1 else: pass if M<=sele: print('Yes') else: print('No')
N,M=map(int,input().split()) A=list(map(int,input().split())) total_vote=sum(A)/(4*M) sele=0 for i in A: if i >= total_vote: sele+=1 else: pass if M<=sele: 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
83
#include <bits/stdc++.h> using namespace std; #define rep(i, n) for (int i = 0; i < (int)n; i++) #define debug(x) cerr << "L" << __LINE__ << ": " << #x << " = " << (x) << endl #define debugvec(v) \ rep(i, v.size()) cerr << "L" << __LINE__ << ": " << #v << "["...
#include <bits/stdc++.h> using namespace std; #define rep(i, n) for (int i = 0; i < (int)n; i++) #define debug(x) cerr << "L" << __LINE__ << ": " << #x << " = " << (x) << endl #define debugvec(v) \ rep(i, v.size()) cerr << "L" << __LINE__ << ": " << #v << "["...
[["-", 49, 50, 51, 16, 31, 2, 3, 4, 0, 13], ["+", 49, 50, 51, 16, 31, 2, 3, 4, 0, 13]]
1
164
N,M = list(map(int,input().split())) number = list(map(int,input().split())) number.sort(reverse=True) total = sum(number) / (4*M) for i in range(M): if number[i] > total: pass else: print("No") exit() print("Yes")
N,M = list(map(int,input().split())) number = list(map(int,input().split())) number.sort(reverse=True) total = sum(number) / (4*M) for i in range(M): if number[i] >= total: pass else: print("No") exit() print("Yes")
[["-", 0, 7, 8, 196, 0, 57, 15, 666, 667, 47], ["+", 0, 7, 8, 196, 0, 57, 15, 666, 667, 20]]
5
90
N, M = map(int, input().split()) A = list(map(int, input().split())) A = sorted(A, reverse=True) sumA = sum(A) if A[M - 1] > sumA / (4 * M): print("Yes") else: print("No")
N, M = map(int, input().split()) A = list(map(int, input().split())) A = sorted(A, reverse=True) sumA = sum(A) if A[M - 1] >= sumA / (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
79
#include <stdio.h> int main(void) { int a[10000], m, n, i, j = 0, k, l = 0; scanf("%d%d", &n, &m); for (i = 0; i < n; i++) { scanf("%d", &a[i]); j = j + a[i]; } for (i = 0; i < n; i++) if (a[i] * 4 * m > j) l++; // a[i]<j/4m if (l >= m) printf("yes\n"); else printf("no\n"); ...
#include <stdio.h> int main(void) { int a[10000], m, n, i, j = 0, k, l = 0; scanf("%d%d", &n, &m); for (i = 0; i < n; i++) { scanf("%d", &a[i]); j = j + a[i]; } for (i = 0; i < n; i++) if (a[i] * 4 * m >= j) l++; // a[i]<j/4m if (l >= m) printf("Yes\n"); else printf("No\n"); ...
[["-", 0, 7, 8, 57, 15, 23, 0, 16, 17, 47], ["+", 0, 7, 8, 57, 15, 23, 0, 16, 17, 20], ["-", 64, 1, 0, 2, 3, 4, 0, 5, 0, 6], ["+", 64, 1, 0, 2, 3, 4, 0, 5, 0, 6], ["-", 0, 1, 0, 2, 3, 4, 0, 5, 0, 6], ["+", 0, 1, 0, 2, 3, 4, 0, 5, 0, 6]]
0
137
#include <bits/stdc++.h> using namespace std; int main() { int n, m; cin >> n >> m; vector<int> box(n); for (int i = 0; i < n; i++) { cin >> box.at(i); } sort(box.begin(), box.end()); reverse(box.begin(), box.end()); /*for(int i=0;i<n;i++){ cout<<box.at(i)<<endl; }*/ int sum = 0; for ...
#include <bits/stdc++.h> using namespace std; int main() { int n, m; cin >> n >> m; vector<int> box(n); for (int i = 0; i < n; i++) { cin >> box.at(i); } sort(box.begin(), box.end()); reverse(box.begin(), box.end()); int sum = 0; for (int i = 0; i < n; i++) { sum = sum + box.at(i); } ...
[["+", 15, 339, 51, 16, 12, 16, 31, 74, 0, 24], ["+", 51, 16, 12, 16, 31, 74, 39, 77, 39, 40], ["+", 15, 339, 51, 16, 12, 16, 31, 74, 0, 25]]
1
157
#include <bits/stdc++.h> using namespace std; int main() { int i, j, sum = 0, pco = 0; cin >> i >> j; vector<int> vote(i); for (int count = 0; count < i; count++) { cin >> vote.at(count); sum = sum + vote.at(count); } for (int count = 0; count < i; count++) { if (vote.at(count) >= sum / (4 * j)...
#include <bits/stdc++.h> using namespace std; int main() { double i, j, sum = 0, pco = 0; cin >> i >> j; vector<int> vote(i); for (int count = 0; count < i; count++) { cin >> vote.at(count); sum = sum + vote.at(count); } for (int count = 0; count < i; count++) { if (vote.at(count) >= sum / (4 *...
[["-", 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, 19], ["-", 0, 1, 0, 16, 31, 16, 12, 5, 0, 6], ["+", 0, 1, 0, 16, 31, 16, 12, 5, 0, 6]]
1
139
n, m = list(map(int, input().split())) aa = list(map(int, input().split())) total = sum(aa) r = (1//(4*m)) * total c = 0 for i in aa: if i >= r: c += 1 if c >= m: print("Yes") else: print("No")
n, m = list(map(int, input().split())) aa = list(map(int, input().split())) total = sum(aa) r = (1/(4*m)) * total c = 0 for i in aa: if i >= r: c += 1 if c >= m: print("Yes") else: print("No")
[["-", 0, 662, 12, 657, 31, 23, 0, 657, 17, 676], ["+", 0, 662, 12, 657, 31, 23, 0, 657, 17, 85]]
5
90
import java.util.Scanner; 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 voteSum = 0; for (int i = 0; i < n; i++) { a[i] = sc.nextInt(); voteSum += a[i]; } f...
import java.util.Scanner; 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 voteSum = 0; for (int i = 0; i < n; i++) { a[i] = sc.nextInt(); voteSum += a[i]; } f...
[["+", 0, 16, 12, 23, 0, 16, 31, 74, 0, 24], ["+", 12, 23, 0, 16, 31, 74, 39, 511, 0, 512], ["+", 0, 16, 12, 23, 0, 16, 31, 74, 0, 25], ["+", 0, 16, 12, 23, 0, 16, 12, 74, 0, 24], ["+", 12, 23, 0, 16, 12, 74, 39, 511, 0, 512], ["+", 0, 16, 12, 23, 0, 16, 12, 74, 0, 25]]
3
223
N, M = map(int, input().split()) An = list(map(int, input().split())) votes = sum(An) least = votes / (4 * M) count = 0 for v in An: if v > least: count += 1 print("Yes") if count >= M else print("No")
N, M = map(int, input().split()) An = list(map(int, input().split())) votes = sum(An) least = votes / (4 * M) count = 0 for v in An: if v >= least: count += 1 print("Yes") if count >= M 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
#include <stdio.h> int main(void) { long A[10000]; int M, N, i, j = 0, k, L = 0; scanf("%d%d", &N, &M); for (i = 0; i < N; i++) { scanf("%ld", &A[i]); j = j + A[i]; } for (i = 0; i < N; i++) if (4 * M * A[i] > j) L++; if (L >= M) printf("Yes\n"); else printf("No\n"); return ...
#include <stdio.h> int main(void) { long A[10000]; int M, N, i, j = 0, k, L = 0; scanf("%d%d", &N, &M); for (i = 0; i < N; i++) { scanf("%ld", &A[i]); j = j + A[i]; } for (i = 0; i < N; i++) if (4 * M * A[i] >= j) L++; if (L >= M) printf("Yes\n"); else printf("No\n"); return...
[["-", 0, 7, 8, 57, 15, 23, 0, 16, 17, 47], ["+", 0, 7, 8, 57, 15, 23, 0, 16, 17, 20]]
0
137
#include <iostream> #include <stdio.h> using namespace std; main() { int N, M; scanf("%d %d", &N, &M); int vote = 0; int A[N]; for (int i = 0; i < N; i++) { scanf("%d", &A[i]); vote += A[i]; } int minvote = (vote - 1) / 4 / M; int large = 0; for (int i = 0; i < N; i++) { if (A[i] > minvote...
#include <iostream> #include <stdio.h> using namespace std; main() { int N, M; scanf("%d %d", &N, &M); int vote = 0; int A[N]; for (int i = 0; i < N; i++) { scanf("%d", &A[i]); vote += A[i]; } int minvote = (vote - 1) / 4 / M; int large = 0; for (int i = 0; i < N; i++) { if (A[i] > minvote...
[["-", 8, 9, 0, 57, 15, 339, 51, 16, 17, 47], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 17, 20]]
1
145
#include <stdio.h> int main(void) { int n, m, sum = 0, c = 0; int a[100]; scanf("%d %d", &n, &m); for (int i = 0; i < n; i++) { scanf("%d ", a[i]); sum += a[i]; } for (int j = 0; j < n; j++) { if (a[j] >= 0.25 * sum / m) c++; } if (c >= m) printf("Yes\n"); else printf("N...
#include <stdio.h> int main(void) { int n, m, sum = 0, c = 0; int a[100] = {}; scanf("%d %d", &n, &m); for (int i = 0; i < n; i++) { scanf("%d ", &a[i]); sum += a[i]; } for (int j = 0; j < n; j++) { if (a[j] >= 0.25 * sum / m) c++; } if (c >= m) printf("Yes\n"); else pri...
[["+", 0, 14, 8, 9, 0, 43, 49, 50, 0, 32], ["+", 8, 9, 0, 43, 49, 50, 51, 83, 0, 45], ["+", 8, 9, 0, 43, 49, 50, 51, 83, 0, 46], ["+", 0, 1, 0, 2, 3, 4, 0, 66, 17, 67]]
1
134
N, M = map(int, input().split(" ")) A = list(map(int, input().split(" "))) count_flag = sum(A) / (4 * M) popular_count = sum([a > count_flag for a in A]) if popular_count >= M: print("Yes") else: print("No")
N, M = map(int, input().split(" ")) A = list(map(int, input().split(" "))) count_flag = sum(A) / (4 * M) popular_count = sum([a >= count_flag for a in A]) if popular_count >= M: print("Yes") else: print("No")
[["-", 12, 652, 3, 4, 0, 658, 8, 666, 667, 47], ["+", 12, 652, 3, 4, 0, 658, 8, 666, 667, 20]]
5
84
N, M = map(int, input().split()) A_list = list(map(int, input().split())) total = sum(A_list) count = 0 for a in A_list: if a >= N * (1 / 4*M): count += 1 if count >= M: print("Yes") else: print("No")
N, M = map(int, input().split()) A_list = list(map(int, input().split())) total = sum(A_list) count = 0 for a in A_list: if a >= total * (1 / (4*M)): count += 1 if count >= M: print("Yes") else: print("No")
[["-", 8, 196, 0, 57, 15, 666, 0, 657, 31, 22], ["+", 8, 196, 0, 57, 15, 666, 0, 657, 31, 22], ["+", 0, 657, 12, 23, 0, 657, 12, 23, 0, 24], ["+", 0, 657, 12, 23, 0, 657, 12, 23, 0, 25]]
5
82
#include <bits/stdc++.h> using namespace std; void solve() { 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<>()); bool flag = true; int sum = 0; for (int i : a) sum += i; for (int i = 0; i < m; i++) { if (a[i] < (sum / ...
#include <bits/stdc++.h> using namespace std; void solve() { 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<>()); bool flag = true; int sum = 0; for (int i : a) sum += i; for (int i = 0; i < m; i++) { if (a[i] < (float(...
[["+", 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], ["+", 51, 16, 12, 23, 0, 16, 12, 2, 63, 40]]
1
184
#include <bits/stdc++.h> using namespace std; int main() { int M, N; int cnt = 0; int vote = 0; cin >> N >> M; vector<int> A(N); for (int i = 0; i < N; i++) { cin >> A.at(i); vote += A.at(i); } int poll = vote / (4 * M); for (int i = 0; i < N; i++) { if (A.at(i) >= poll) cnt++; ...
#include <bits/stdc++.h> using namespace std; int main() { int M, N; int cnt = 0; double vote = 0; cin >> N >> M; vector<int> A(N); for (int i = 0; i < N; i++) { cin >> A.at(i); vote += A.at(i); } double poll = vote / (4 * M); for (int i = 0; i < N; i++) { if (A.at(i) >= poll) c...
[["-", 0, 30, 0, 14, 8, 9, 0, 43, 39, 40], ["+", 0, 30, 0, 14, 8, 9, 0, 43, 39, 40]]
1
144
#include <algorithm> #include <bitset> #include <cmath> #include <cstring> #include <deque> #include <iostream> #include <map> #include <queue> #include <vector> using namespace std; typedef long long ll; #define rep(i, n) for (int i = 0; i < (n); i++) #define repr(i, n) for (int i = (n); i >= 0; i--) #define repf(i, ...
#include <algorithm> #include <bitset> #include <cmath> #include <cstring> #include <deque> #include <iostream> #include <map> #include <queue> #include <vector> using namespace std; typedef long long ll; #define rep(i, n) for (int i = 0; i < (n); i++) #define repr(i, n) for (int i = (n); i >= 0; i--) #define repf(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]]
1
270
N, M = [int(n) for n in input().split()] X = [int(n) for n in input().split()] cnt = 0 for n in X: if n > (sum(X) / (4 * M)): cnt = cnt + 1 if cnt >= M: break print("Yes" if cnt >= M else "No")
N, M = [int(n) for n in input().split()] X = [int(n) for n in input().split()] cnt = 0 for n in X: if n >= (sum(X) / (4 * M)): cnt = cnt + 1 if cnt >= M: break print("Yes" if cnt >= M else "No")
[["-", 0, 7, 8, 196, 0, 57, 15, 666, 667, 47], ["+", 0, 7, 8, 196, 0, 57, 15, 666, 667, 20]]
5
87
#include <bits/stdc++.h> using namespace std; int main() { int N, M, sum = 0; string answer = "No"; cin >> N >> M; vector<int> A(N); for (int i = 0; i < N; i++) { cin >> A.at(i); sum += A.at(i); } sort(A.begin(), A.end()); reverse(A.begin(), A.end()); if (A.at(M - 1) >= sum / 4 / M) { a...
#include <bits/stdc++.h> using namespace std; int main() { double N, M, sum = 0; string answer = "No"; cin >> N >> M; vector<double> A(N); for (int i = 0; i < N; i++) { cin >> A.at(i); sum += A.at(i); } sort(A.begin(), A.end()); reverse(A.begin(), A.end()); if (A.at(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], ["-", 0, 43, 39, 344, 3, 347, 0, 77, 39, 40], ["+", 0, 43, 39, 344, 3, 347, 0, 77, 39, 40]]
1
138
#include <iostream> #define ll long long #define f(i, n) for (int i = 1; i <= n; i++) // sort(bb, bb+n); using namespace std; int main() { std::ios::sync_with_stdio(false); int n, m, aa[1002], t = 0, b = 0, c = 0; cin >> n >> m; f(i, n) { cin >> aa[i]; t += aa[i]; } b = t / (m * 4.0); f(i, n) { ...
#include <iostream> #define ll long long #define f(i, n) for (int i = 1; i <= n; i++) // sort(bb, bb+n); using namespace std; int main() { std::ios::sync_with_stdio(false); double n, m, aa[1002], t = 0, b = 0, c = 0; cin >> n >> m; f(i, n) { cin >> aa[i]; t += aa[i]; } b = t / (m * 4.0); f(i, n)...
[["-", 0, 30, 0, 14, 8, 9, 0, 43, 39, 40], ["+", 0, 30, 0, 14, 8, 9, 0, 43, 39, 40]]
1
141
#include <iostream> #include <vector> using namespace std; int main(void) { int n, m; cin >> n >> m; vector<int> a(n); int all = 0; for (int i = 0; i < n; i++) { cin >> a[i]; all += a[i]; } int count = 0; for (int i = 0; i < n; i++) { if (a[i] > (float)all * ((float)1 / ((float)4 * (fl...
#include <iostream> #include <vector> using namespace std; int main(void) { int n, m; cin >> n >> m; vector<int> a(n); int all = 0; for (int i = 0; i < n; i++) { cin >> a[i]; all += a[i]; } int count = 0; for (int i = 0; i < n; i++) { if (a[i] >= (float)all * ((float)1 / ((float)4 * (f...
[["-", 8, 9, 0, 57, 15, 339, 51, 16, 17, 47], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 17, 20]]
1
153
n,m=map(int,input().split()) item=list(map(int,input().split())) x=0 y=sum(item) for i in item: if 4*m*i>=m: x=x+1 if x>=m: print('Yes') else: print('No')
n,m=map(int,input().split()) item=list(map(int,input().split())) x=0 y=sum(item) for i in item: if 4*m*i>=y: x=x+1 if x>=m: print('Yes') else: print('No')
[["-", 0, 7, 8, 196, 0, 57, 15, 666, 0, 22], ["+", 0, 7, 8, 196, 0, 57, 15, 666, 0, 22]]
5
80
#include <bits/stdc++.h> using namespace std; #define ll long long #define inf 0x3f3f3f3f #define infll 0x3f3f3f3f3f3f3f3f #define all(x) (x).begin(), (x).end() #define f(i, a, b) for (int i = a; i < (signed)(b); ++i) #define pc __builtin_popcount // counts number of 1's in bin(num) #define pb push_back #define mp mak...
#include <bits/stdc++.h> using namespace std; #define ll long long #define inf 0x3f3f3f3f #define infll 0x3f3f3f3f3f3f3f3f #define all(x) (x).begin(), (x).end() #define f(i, a, b) for (int i = a; i < (signed)(b); ++i) #define pc __builtin_popcount // counts number of 1's in bin(num) #define pb push_back #define mp mak...
[["-", 0, 16, 12, 23, 0, 41, 64, 5, 0, 6], ["+", 0, 16, 12, 23, 0, 41, 64, 5, 0, 6], ["-", 0, 16, 12, 23, 0, 41, 75, 5, 0, 6], ["+", 0, 16, 12, 23, 0, 41, 75, 5, 0, 6]]
1
185
#include <bits/stdc++.h> using namespace std; bool cmp(int x, int y) { return x > y; } int main() { int n, m; scanf("%d%d", &n, &m); int a[110]; int sum = 0; for (int i = 1; i <= n; i++) { scanf("%d", &a[i]); sum += a[i]; } sort(a + 1, a + n + 1, cmp); double x = sum / (4 * m); if (a[m] < x) ...
#include <bits/stdc++.h> using namespace std; bool cmp(int x, int y) { return x > y; } int main() { int n, m; scanf("%d%d", &n, &m); int a[110]; int sum = 0; for (int i = 1; i <= n; i++) { scanf("%d", &a[i]); sum += a[i]; } sort(a + 1, a + n + 1, cmp); double x = sum * 1.0 / (4 * m); if (a[m] ...
[["+", 0, 43, 49, 50, 51, 16, 31, 16, 17, 48], ["+", 0, 43, 49, 50, 51, 16, 31, 16, 12, 13]]
1
148
#include <bits/stdc++.h> typedef long long ll; using namespace std; int main() { int n, m, total = 0, nums[105]; cin >> n >> m; ll sum = 0; for (int i = 0; i < n; i++) { int a; cin >> a; sum += a; nums[i] = a; } for (int i = 0; i < n; i++) { if (nums[i] >= sum / (4 * m)) total++...
#include <bits/stdc++.h> typedef long long ll; using namespace std; int main() { int n, m, total = 0, nums[105]; cin >> n >> m; ll sum = 0; for (int i = 0; i < n; i++) { int a; cin >> a; sum += a; nums[i] = a; } for (int i = 0; i < n; i++) { if (nums[i] >= sum / (4.00 * m)) tota...
[["-", 51, 16, 12, 16, 12, 23, 0, 16, 31, 13], ["+", 51, 16, 12, 16, 12, 23, 0, 16, 31, 13]]
1
133
#include <algorithm> #include <iostream> int main() { int n, m; double total = 0; std::cin >> n >> m; int a[n]; std::string result; for (int i = 0; i < n; ++i) { std::cin >> a[i]; total += a[i]; } total = total * (1 / (4 * (double)m)); for (int i = 0; i < n; ++i) { if (a[i] > total) ...
#include <algorithm> #include <iostream> int main() { int n, m; double total = 0; std::cin >> n >> m; int a[n]; std::string result; for (int i = 0; i < n; ++i) { std::cin >> a[i]; total += a[i]; } total = total * (1 / (4 * (double)m)); for (int i = 0; i < n; ++i) { if (a[i] >= total) ...
[["-", 8, 9, 0, 57, 15, 339, 51, 16, 17, 47], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 17, 20]]
1
141
#include <bits/stdc++.h> using namespace std; #define ll long long void solve() { long long t, n, m, i, j, k = 0, kk = 0, x, y, z = 0, mn = 0, mx, a[10], cnt = 0; vector<ll> v; cin >> n >> m; for (i = 0; i < n; i++) { cin >> x; v.push_back(x); mn += x; } sort(v.beg...
#include <bits/stdc++.h> using namespace std; #define ll long long void solve() { long long t, n, m, i, j, k = 0, kk = 0, x, y, z = 0, mn = 0, mx, a[10], cnt = 0; vector<ll> v; cin >> n >> m; for (i = 0; i < n; i++) { cin >> x; v.push_back(x); mn += x; } sort(v.beg...
[["-", 8, 9, 0, 57, 15, 339, 51, 16, 17, 47], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 17, 20]]
1
257
#include <bits/stdc++.h> using namespace std; int main() { int n, k, x, i, C, sum = 0, l = 0; cin >> n >> k; vector<int> v; while (n--) { cin >> x; sum += x; v.push_back(x); } C = sum / (4 * k); for (i = 0; i < v.size(); i++) { if (v[i] >= C) l++; if (l == k) break; } l...
#include <bits/stdc++.h> using namespace std; int main() { double n, k, x, i, C, sum = 0, l = 0; cin >> n >> k; vector<int> v; while (n--) { cin >> x; sum += x; v.push_back(x); } C = sum / (4 * k); for (i = 0; i < v.size(); i++) { if (v[i] >= C) l++; if (l == k) break; }...
[["-", 0, 30, 0, 14, 8, 9, 0, 43, 39, 40], ["+", 0, 30, 0, 14, 8, 9, 0, 43, 39, 40]]
1
133
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 sum = 0; int count = 0; for (int i = 0; i < n; i++) { a[i] = sc.nextInt(); sum += a[...
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 sum = 0; int count = 0; for (int i = 0; i < n; i++) { a[i] = sc.nextInt(); sum += a[...
[["-", 8, 196, 0, 57, 15, 15, 0, 16, 17, 47], ["+", 8, 196, 0, 57, 15, 15, 0, 16, 17, 20]]
3
169
/***************************************************************************\ ! JUBAYER ABDULLAH JOY ! 5th Batch, CSE, University of Barishal ! ...
/***************************************************************************\ ! JUBAYER ABDULLAH JOY ! 5th Batch, CSE, University of Barishal ! ...
[["+", 0, 57, 15, 339, 51, 16, 12, 2, 63, 22], ["-", 12, 23, 0, 16, 12, 23, 0, 16, 31, 13], ["+", 3, 4, 0, 16, 12, 23, 0, 16, 31, 13]]
1
774
n,m = map(int,input().split()) a = list(map(int,input().split())) sum = 0 count = 0 for i in range(n): sum += a[i] sum //= 4*m for i in range(n): if a[i] >= sum: count +=1 if count >= m: print("Yes") else: print("No")
n,m = map(int,input().split()) a = list(map(int,input().split())) sum = 0 count = 0 for i in range(n): sum += a[i] sum /= 4*m for i in range(n): if a[i] >= sum: count +=1 if count >= m: print("Yes") else: print("No")
[["-", 36, 36, 0, 656, 0, 1, 0, 677, 17, 691], ["+", 36, 36, 0, 656, 0, 1, 0, 677, 17, 90]]
5
96
#include <bits/stdc++.h> #define ll long long using namespace std; int gcd(int x, int y) { return (x % y) ? gcd(y, x % y) : y; } int main() { int n, m; ll f = 0, sum = 0; cin >> n >> m; double num[n]; for (int i = 0; i < n; i++) { cin >> num[i]; sum = sum + num[i]; } for (int j = 0; j < n; j++) { ...
#include <bits/stdc++.h> #define ll long long using namespace std; int gcd(int x, int y) { return (x % y) ? gcd(y, x % y) : y; } int main() { int n, m; ll f = 0, sum = 0; cin >> n >> m; double num[n]; for (int i = 0; i < n; i++) { cin >> num[i]; sum = sum + num[i]; } for (int j = 0; j < n; j++) { ...
[["-", 8, 9, 0, 57, 15, 339, 51, 16, 17, 18], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 17, 19]]
1
175
#include <iostream> 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]; } double ok = (double)sum / (4 * m); int count = 0; for (int i = 0; i < n; i++) { if (ok < a[i]) { count++; } } if (count >=...
#include <iostream> 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]; } double ok = (double)sum / (4 * m); int count = 0; for (int i = 0; i < n; i++) { if (ok <= a[i]) { count++; } } if (count >...
[["-", 8, 9, 0, 57, 15, 339, 51, 16, 17, 18], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 17, 19]]
1
139
#include <cstdio> #include <iostream> using namespace std; int n, m, sum, cnt, a[105]; double x; int main() { int i; cin >> n >> m; for (i = 0; i < n; i++) cin >> a[i], sum += a[i]; x = sum / (4 * m); for (i = 0; i < n; i++) if (a[i] >= x) cnt++; puts(cnt >= m ? "Yes" : "No"); return 0; }
#include <cstdio> #include <iostream> using namespace std; int n, m, sum, cnt, a[105]; double x; int main() { int i; cin >> n >> m; for (i = 0; i < n; i++) cin >> a[i], sum += a[i]; x = sum / (4.0 * m); for (i = 0; i < n; i++) if (a[i] >= x) cnt++; puts(cnt >= m ? "Yes" : "No"); return 0; }
[["-", 0, 11, 12, 16, 12, 23, 0, 16, 31, 13], ["+", 0, 11, 12, 16, 12, 23, 0, 16, 31, 13]]
1
120
n, m = map(int, input().split()) A = list(map(int, input().split())) sum = 0 for i in range(n): sum += A[i] counter = 0 rate = 4 * m rate = sum / rate for i in range(n): if A[i] > rate: counter += 1 if counter >= m: print('Yes') else: print('No')
n, m = map(int, input().split()) A = list(map(int, input().split())) sum = 0 for i in range(n): sum += A[i] counter = 0 rate = 4 * m rate = sum / rate for i in range(n): if A[i] >= rate: counter += 1 if counter >= 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