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(void) { int N, M; cin >> N >> M; vector<int> A(N); int sum = 0; for (int i = 0; i < N; i++) { cin >> A[i]; sum += A[i]; } int border = sum / (4 * M); int cnt = 0; for (int i = 0; i < N; i++) { if (A[i] >= border) cnt++; } ...
#include <bits/stdc++.h> using namespace std; int main(void) { int N, M; cin >> N >> M; vector<int> A(N); int sum = 0; for (int i = 0; i < N; i++) { cin >> A[i]; sum += A[i]; } double border = sum / (4.0 * M); int cnt = 0; for (int i = 0; i < N; i++) { if (A[i] >= border) cnt++; ...
[["-", 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
138
#include <iostream> using namespace std; int main() { int n, m, i, sumt; double mm; int k; sumt = 0; k = 0; cin >> n >> m; int a[n]; for (i = 1; i <= n; i++) { cin >> a[i]; sumt += a[i]; } mm = sumt / (4.0 * m); for (i = 1; i <= n; i++) { if (a[i] >= mm) k++; } if (k >= m)...
#include <iostream> using namespace std; int main() { int n, m, i, sumt; double mm; int k; sumt = 0; k = 0; cin >> n >> m; int a[n]; for (i = 1; i <= n; i++) { cin >> a[i]; sumt += a[i]; } mm = sumt / (4.0 * m); for (i = 1; i <= n; i++) { if (a[i] >= mm) k++; } if (k >= m...
[["-", 0, 1, 0, 16, 31, 16, 12, 5, 0, 6], ["+", 0, 1, 0, 16, 31, 16, 12, 5, 0, 6]]
1
143
import math n,m=map(int,input().split()) a=list(map(int,input().split())) s=sum(a) t=math.floor(s/4/m) a.sort() cnt=0 for i in a: if i>=t: cnt+=1 if cnt>=m: print('Yes') else: print('No')
import math n,m=map(int,input().split()) a=list(map(int,input().split())) s=sum(a) t=math.ceil(s/4/m) a.sort() cnt=0 for i in a: if i>=t: cnt+=1 if cnt>=m: print('Yes') else: print('No')
[["-", 0, 1, 0, 662, 12, 652, 63, 319, 319, 22], ["+", 0, 1, 0, 662, 12, 652, 63, 319, 319, 22]]
5
93
#include <bits/stdc++.h> using namespace std; int N, M; vector<int> A; int main() { cin >> N >> M; A.resize(N); int sum; for (int i = 0; i < N; i++) { cin >> A[i]; sum += A[i]; } int count = 0; double x = sum / (4 * M); for (int i = 0; i < N; i++) { if (A[i] >= x) count++; } if (...
#include <bits/stdc++.h> using namespace std; int N, M; vector<int> A; int main() { cin >> N >> M; A.resize(N); double sum; for (int i = 0; i < N; i++) { cin >> A[i]; sum += A[i]; } int count = 0; double x = sum / (4 * M); for (int i = 0; i < N; i++) { if (A[i] >= x) count++; } i...
[["-", 0, 30, 0, 14, 8, 9, 0, 43, 39, 40], ["+", 0, 30, 0, 14, 8, 9, 0, 43, 39, 40]]
1
141
N, M = map(int, input().split()) A = list(input().split()) A = list(map(int, A)) #A = list(map(int, input().split())) A.sort(reverse=True) if A[M-1] >= sum(A)/4*M: print('Yes') else: print('No')
N, M = map(int, input().split()) A = list(input().split()) A = list(map(int, A)) #A = list(map(int, input().split())) A.sort(reverse=True) #print(A) #print(A[M-1], sum(A), 4*M, sum(A)/(4*M)) if A[M-1] >= sum(A)/(4*M): print('Yes') else: print('No')
[["+", 0, 57, 15, 666, 0, 657, 12, 23, 0, 24], ["+", 0, 57, 15, 666, 0, 657, 12, 23, 0, 25]]
5
79
n, m = map(int, input().split(" ")) a = list(map(int, input().split(" "))) a.sort(reverse=True) print(a) if a[m - 1] < sum(a) /4 / m: print("No") else: print("Yes")
n, m = map(int, input().split(" ")) a = list(map(int, input().split(" "))) a.sort(reverse=True) #print(a) if a[m - 1] < sum(a) /4 / m: print("No") else: print("Yes")
[["-", 36, 36, 0, 656, 0, 1, 0, 652, 63, 22], ["-", 0, 656, 0, 1, 0, 652, 3, 4, 0, 24], ["-", 0, 656, 0, 1, 0, 652, 3, 4, 0, 22], ["-", 0, 656, 0, 1, 0, 652, 3, 4, 0, 25]]
5
82
/* ----------------------- reclone_rk -------------------------*/ #include <bits/stdc++.h> using namespace std; #define int long long int const int mod = 1e9 + 7; int gcd(int a, int b) { if (a == 0) return b; return gcd(b % a, a); } int MOD(int n) { return ((n % mod) + mod) % mod; } int power(int a, int b) { ...
/* ----------------------- reclone_rk -------------------------*/ #include <bits/stdc++.h> using namespace std; #define int long long int const int mod = 1e9 + 7; int gcd(int a, int b) { if (a == 0) return b; return gcd(b % a, a); } int MOD(int n) { return ((n % mod) + mod) % mod; } int power(int a, int b) { ...
[["-", 8, 9, 0, 57, 15, 339, 51, 16, 17, 47], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 17, 20]]
1
368
N,M = map(int, input().split()) A = 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, 1, 0, 662, 12, 652, 63, 22], ["+", 0, 1, 0, 662, 12, 652, 3, 4, 0, 24], ["+", 0, 652, 3, 4, 0, 652, 3, 4, 0, 25]]
5
74
#include <iostream> #include <vector> using namespace std; int main() { int N, M; int sum = 0, count = 0; vector<int> A; cin >> N >> M; A.resize(N); 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 * M)) count++; } if (c...
#include <iostream> #include <vector> using namespace std; int main() { int N, M; int sum = 0, count = 0; vector<int> A; cin >> N >> M; A.resize(N); for (int i = 0; i < N; i++) { cin >> A[i]; sum += A[i]; } for (int i = 0; i < N; i++) { if (A[i] >= (float)sum / (4 * M)) count++; } ...
[["+", 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
137
#include <bits/stdc++.h> using namespace std; #include <ext/pb_ds/assoc_container.hpp> #include <ext/pb_ds/tree_policy.hpp> using namespace __gnu_pbds; #define ll long long #define REP(i, a, b) for (ll i = a; i < b; i++) #define REPI(i, a, b) for (ll i = b - 1; i >= a; i--) #define i_os ...
#include <bits/stdc++.h> using namespace std; #include <ext/pb_ds/assoc_container.hpp> #include <ext/pb_ds/tree_policy.hpp> using namespace __gnu_pbds; #define ll long long #define REP(i, a, b) for (ll i = a; i < b; i++) #define REPI(i, a, b) for (ll i = b - 1; i >= a; i--) #define i_os ...
[["+", 51, 16, 12, 16, 31, 74, 39, 77, 39, 40], ["+", 15, 339, 51, 16, 12, 16, 31, 74, 0, 25], ["+", 51, 16, 12, 16, 31, 74, 51, 23, 0, 24]]
1
246
#include <iostream> int main(int argc, char *argv[]) { int n, m; std::cin >> n >> m; int a[n]; int sum = 0; for (int i = 0; i < n; ++i) { int ai; std::cin >> ai; sum += ai; a[i] = ai; } int count = 0; float k = sum / (4 * m); for (int i = 0; i < n; ++i) { if (a[i] >= k) ++...
#include <iostream> int main(int argc, char *argv[]) { int n, m; std::cin >> n >> m; int a[n]; float sum = 0; for (int i = 0; i < n; ++i) { int ai; std::cin >> ai; sum += ai; a[i] = ai; } int count = 0; float k = sum / (4 * m); for (int i = 0; i < n; ++i) { if (a[i] >= k) ...
[["-", 0, 30, 0, 14, 8, 9, 0, 43, 39, 40], ["+", 0, 30, 0, 14, 8, 9, 0, 43, 39, 40]]
1
142
#include <bits/stdc++.h> using namespace std; int main() { int N, M; cin >> N >> M; vector<int> A(N); for (int &i : A) { cin >> i; } int cnt = 0; int ttl = accumulate(A.begin(), A.end(), 0); double x = (double)ttl / (4 * M); for (int i = 0; i < N; i++) { if (A[i] >= x) cnt++; } if ...
#include <bits/stdc++.h> using namespace std; int main() { int N, M; cin >> N >> M; vector<int> A(N); for (int &i : A) { cin >> i; } int cnt = 0; int ttl = accumulate(A.begin(), A.end(), 0); double x = (double)ttl / (4 * M); for (int i = 0; i < N; i++) { if (A[i] >= x) cnt++; } if ...
[["-", 8, 9, 0, 57, 15, 339, 51, 16, 17, 19], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 17, 20]]
1
139
N, M = map(int, input().split(' ')) A = sorted(tuple(map(int, input().split(' '))), reverse=True) total = sum(A) border = total // (2 * M) for i in range(M): if A[i] < border: print('No') break else: print('Yes')
N, M = map(int, input().split(' ')) A = sorted(tuple(map(int, input().split(' '))), reverse=True) total = sum(A) border = total / (4 * M) for i in range(M): if A[i] < border: print('No') break else: print('Yes')
[["-", 0, 656, 0, 1, 0, 662, 12, 657, 17, 676], ["+", 0, 656, 0, 1, 0, 662, 12, 657, 17, 85], ["-", 0, 662, 12, 657, 12, 23, 0, 657, 31, 612], ["+", 0, 662, 12, 657, 12, 23, 0, 657, 31, 612]]
5
92
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 count = 0; int sumA = 0; for (int i = 0; i < N; i++) { A[i] = sc.nextInt(); sumA += A[i];...
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 count = 0; int sumA = 0; for (int i = 0; i < N; i++) { A[i] = sc.nextInt(); sumA += A[i];...
[["-", 8, 196, 0, 57, 15, 15, 0, 16, 17, 47], ["+", 8, 196, 0, 57, 15, 15, 0, 16, 17, 20]]
3
184
# coding: utf-8 # Your code here! #入力Nの全ての並べ方 #print(list(itertools.permutations([1, 2, 3]))) N,M = map(int,input().split()) A = list(map(int,input().split())) total = sum(A) count = 0 for i in range(N): if A[i] > total / 4 / M: count += 1 if count >= M: print("Yes") else: print("No")
N,M = map(int,input().split()) A = list(map(int,input().split())) total = sum(A) count = 0 for i in range(N): if A[i] >= total / 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]]
5
88
import heapq N, M = map(int,input().split()) a = list(map(int,input().split())) count = 0 for i in heapq.nlargest(M,a): if(1 / (4 * M) < i / sum(a)): count += 1 if(count == M): print("Yes") else: print("No")
import heapq N, M = map(int,input().split()) a = list(map(int,input().split())) count = 0 for i in heapq.nlargest(M,a): if(1 / (4 * M) <= i / sum(a)): count += 1 if(count == M): print("Yes") else: print("No")
[["-", 8, 196, 0, 57, 15, 23, 0, 666, 667, 18], ["+", 8, 196, 0, 57, 15, 23, 0, 666, 667, 19]]
5
92
N, M = map(int, input().split()) A = list(map(int, input().split())) judge = sum(A) / (4 * M) L = [i for i in A if i >= judge] print(L) if len(L) >= M: print("Yes") else: print("No")
N, M = map(int, input().split()) A = list(map(int, input().split())) judge = sum(A) / (4 * M) L = [i for i in A if i >= judge] if len(L) >= M: print("Yes") else: print("No")
[["-", 36, 36, 0, 656, 0, 1, 0, 652, 63, 22], ["-", 0, 656, 0, 1, 0, 652, 3, 4, 0, 24], ["-", 0, 656, 0, 1, 0, 652, 3, 4, 0, 22], ["-", 0, 656, 0, 1, 0, 652, 3, 4, 0, 25]]
5
84
/** * code generated by JHelper * More info: https://github.com/AlexeyDmitriev/JHelper * @author */ #include <algorithm> #include <bitset> #include <cmath> #include <cstdio> #include <cstring> #include <deque> #include <forward_list> #include <functional> #include <iostream> #include <map> #include <numeric> #incl...
/** * code generated by JHelper * More info: https://github.com/AlexeyDmitriev/JHelper * @author */ #include <algorithm> #include <bitset> #include <cmath> #include <cstdio> #include <cstring> #include <deque> #include <forward_list> #include <functional> #include <iostream> #include <map> #include <numeric> #incl...
[["-", 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
287
// ABC161-A //#include <math.h> #include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < (n); i++) #include <iostream> #include <set> #include <stdio.h> #include <vector> //#include <string.h> using namespace std; using Graph = vector<vector<int>>; int main() { int n = 0, m = 0; cin >> n >> m; vector<int> ...
//#include <math.h> #include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < (n); i++) #include <iostream> #include <set> #include <stdio.h> #include <vector> //#include <string.h> using namespace std; using Graph = vector<vector<int>>; int main() { int n = 0, m = 0; cin >> n >> m; vector<double> A; dou...
[["-", 0, 43, 39, 344, 3, 347, 0, 77, 39, 40], ["+", 0, 43, 39, 344, 3, 347, 0, 77, 39, 40], ["-", 0, 30, 0, 14, 8, 9, 0, 43, 39, 40], ["+", 0, 30, 0, 14, 8, 9, 0, 43, 39, 40]]
1
150
#include <bits/stdc++.h> 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 th = sum / (4 * M); int cnt = 0; for (int i = 0; i < N; i++) { if (A[i] >= th) { cnt++; } } if (cnt >= M) ...
#include <bits/stdc++.h> 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 th = sum / (4 * M); int cnt = 0; for (int i = 0; i < N; i++) { if (A[i] >= th) { cnt++; } } if (c...
[["-", 0, 30, 0, 14, 8, 9, 0, 43, 39, 40], ["+", 0, 30, 0, 14, 8, 9, 0, 43, 39, 40]]
1
133
import sys sys.setrecursionlimit(10**7) input = lambda: sys.stdin.readline().strip() def main(): N,M = map(int,input().split()) A_list = sorted(list(map(int,input().split())),reverse=True) print("Yes" if A_list[M-1]>sum(A_list)*(1/(4*M)) else "No") main()
import sys sys.setrecursionlimit(10**7) input = lambda: sys.stdin.readline().strip() def main(): N,M = map(int,input().split()) A_list = sorted(list(map(int,input().split())),reverse=True) print("Yes" if A_list[M-1]>=sum(A_list)*(1/(4*M)) else "No") main()
[["-", 0, 652, 3, 4, 0, 41, 0, 666, 667, 47], ["+", 0, 652, 3, 4, 0, 41, 0, 666, 667, 20]]
5
105
#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); int sum = 0; rep(i, n) { cin >> a.at(i); sum += a.at(i); } sort(a.begin(), a.end()); reverse(a.begin(), a.end()); if (a.at(m - 1) >= sum /...
#include <bits/stdc++.h> using namespace std; #define rep(i, n) for (int i = 0; i < (int)(n); i++) int main() { double n, m; cin >> n >> m; vector<int> a(n); double sum = 0; rep(i, n) { cin >> a.at(i); sum += a.at(i); } sort(a.begin(), a.end()); reverse(a.begin(), a.end()); if (a.at(m - 1) >=...
[["-", 0, 30, 0, 14, 8, 9, 0, 43, 39, 40], ["+", 0, 30, 0, 14, 8, 9, 0, 43, 39, 40]]
1
137
#include <algorithm> #include <cstdio> #include <iomanip> #include <iostream> #include <list> #include <map> #include <math.h> #include <numeric> #include <sstream> #include <stack> #include <stdio.h> #include <string> #include <unordered_map> #include <vector> typedef long long ll; #define pi 3.14159265358979323846 #...
#include <algorithm> #include <cstdio> #include <iomanip> #include <iostream> #include <list> #include <map> #include <math.h> #include <numeric> #include <sstream> #include <stack> #include <stdio.h> #include <string> #include <unordered_map> #include <vector> typedef long long ll; #define pi 3.14159265358979323846 #...
[["+", 0, 57, 15, 339, 51, 16, 31, 23, 0, 24], ["-", 8, 9, 0, 57, 15, 339, 51, 16, 17, 47], ["+", 0, 57, 15, 339, 51, 16, 31, 23, 0, 25], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 17, 20]]
1
575
#include <stdio.h> #include <stdlib.h> #include <string.h> int main() { int n, m; int *a; char buff[1000000]; // data loading if (fgets(buff, sizeof(buff), stdin) != NULL) { sscanf(buff, "%d%d", &n, &m); } a = (int *)malloc(sizeof(int) * n); if (fgets(buff, sizeof(buff), stdin) != NULL) { int...
#include <stdio.h> #include <stdlib.h> #include <string.h> int main() { int n, m; int *a; char buff[1000000]; // data loading if (fgets(buff, sizeof(buff), stdin) != NULL) { sscanf(buff, "%d%d", &n, &m); } a = (int *)malloc(sizeof(int) * n); if (fgets(buff, sizeof(buff), stdin) != NULL) { int...
[["-", 0, 16, 12, 16, 12, 23, 0, 16, 31, 13], ["+", 0, 16, 12, 16, 12, 23, 0, 16, 31, 13]]
0
260
#include <bits/stdc++.h> using namespace std; int main() { int n, m, sum = 0, cnt = 0; cin >> n >> m; vector<int> a(n); for (int i = 0; i < n; i++) { cin >> a.at(i); sum += a.at(i); } for (int i = 1; i < n; i++) { if (4 * m * a.at(i) >= sum) { cnt++; } } if (cnt >= m) { cout <...
#include <bits/stdc++.h> using namespace std; int main() { int n, m, sum = 0, cnt = 0; cin >> n >> m; vector<int> a(n); for (int i = 0; i < n; i++) { cin >> a.at(i); sum += a.at(i); } for (int i = 0; i < n; i++) { if (4 * m * a.at(i) >= sum) { cnt++; } } if (cnt >= m) { cout <...
[["-", 8, 9, 0, 7, 10, 43, 49, 50, 51, 13], ["+", 8, 9, 0, 7, 10, 43, 49, 50, 51, 13]]
1
137
#include <algorithm> #include <bitset> #include <cmath> #include <iomanip> #include <iostream> #include <map> #include <math.h> #include <queue> #include <stack> #include <stdio.h> #include <string> #include <vector> using namespace std; typedef long long ll; typedef vector<vector<int>> vvi; typedef vector<int> vi; ...
#include <algorithm> #include <bitset> #include <cmath> #include <iomanip> #include <iostream> #include <map> #include <math.h> #include <queue> #include <stack> #include <stdio.h> #include <string> #include <vector> using namespace std; typedef long long ll; typedef vector<vector<int>> vvi; typedef vector<int> vi; ...
[["-", 0, 30, 0, 14, 8, 9, 0, 43, 39, 78], ["+", 0, 14, 8, 9, 0, 43, 39, 344, 141, 78], ["+", 8, 9, 0, 43, 39, 344, 3, 347, 0, 18], ["+", 0, 43, 39, 344, 3, 347, 0, 77, 39, 40], ["+", 8, 9, 0, 43, 39, 344, 3, 347, 0, 47], ["-", 0, 30, 0, 14, 8, 9, 0, 43, 39, 40], ["+", 0, 30, 0, 14, 8, 9, 0, 43, 39, 40]]
1
235
#include <algorithm> #include <cmath> #include <cstdio> #include <functional> #include <iomanip> #include <iostream> #include <map> #include <numeric> #include <stack> #include <stdlib.h> #include <string> #include <vector> int main() { long long n, m; std::cin >> n >> m; std::vector<long long> v(n); long lo...
#include <algorithm> #include <cmath> #include <cstdio> #include <functional> #include <iomanip> #include <iostream> #include <map> #include <numeric> #include <stack> #include <stdlib.h> #include <string> #include <vector> int main() { long long n, m; std::cin >> n >> m; std::vector<long long> v(n); long lo...
[["-", 3, 4, 0, 16, 12, 23, 0, 16, 31, 13], ["+", 3, 4, 0, 16, 12, 23, 0, 16, 31, 13]]
1
187
N, M = map(int, input().split()) A = list(map(int, input().split())) A.sort(reverse = True) if A[M - 1] >=1/4*M: print('Yes') else: print('No')
N, M = map(int, input().split()) A = list(map(int, input().split())) A.sort(reverse = True) if A[M - 1] >=sum(A)/(4*M): print('Yes') else: print('No')
[["-", 0, 57, 15, 666, 0, 657, 31, 657, 31, 612], ["+", 0, 57, 15, 666, 0, 657, 31, 652, 63, 22], ["+", 15, 666, 0, 657, 31, 652, 3, 4, 0, 24], ["+", 15, 666, 0, 657, 31, 652, 3, 4, 0, 22], ["+", 15, 666, 0, 657, 31, 652, 3, 4, 0, 25], ["+", 0, 57, 15, 666, 0, 657, 12, 23, 0, 24], ["+", 0, 57, 15, 666, 0, 657, 12, 23, ...
5
69
#include <bits/stdc++.h> using namespace std; using Graph = vector<vector<int>>; int main(void) { int N, M, ans = 0; cin >> N >> M; int A[N]; int cnt = 0; for (int i = 0; i < N; i++) { cin >> A[i]; cnt += A[i]; } double tmp; tmp = cnt / (4ll * M); sort(A, A + N); reverse(A, A + N); boo...
#include <bits/stdc++.h> using namespace std; using Graph = vector<vector<int>>; int main(void) { int N, M, ans = 0; cin >> N >> M; double A[N]; double cnt = 0; for (int i = 0; i < N; i++) { cin >> A[i]; cnt += A[i]; } double tmp; tmp = cnt / (4ll * M); sort(A, A + N); reverse(A, A + N);...
[["-", 0, 30, 0, 14, 8, 9, 0, 43, 39, 40], ["+", 0, 30, 0, 14, 8, 9, 0, 43, 39, 40]]
1
169
n, m = map(int, input().split()) a = sorted(map(int, input().split()), reverse=True) border = sum(a) / (4 * m) canChoose = a[m-1] >= border print(canChoose) print("Yes" if canChoose else "No")
n, m = map(int, input().split()) a = sorted(map(int, input().split()), reverse=True) border = sum(a) / (4 * m) canChoose = a[m-1] >= border print("Yes" if canChoose else "No")
[["-", 0, 656, 0, 1, 0, 652, 3, 4, 0, 22], ["-", 0, 656, 0, 1, 0, 652, 3, 4, 0, 25], ["-", 36, 36, 0, 656, 0, 1, 0, 652, 63, 22], ["-", 0, 656, 0, 1, 0, 652, 3, 4, 0, 24]]
5
75
#include <algorithm> #include <iostream> #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]; } double st = double(1) / (4 * m); int count = 0; for (int i = 0; i < n; i++) { if (...
#include <algorithm> #include <iostream> #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]; } double st = double(sum) / (4 * m); int count = 0; for (int i = 0; i < n; i++) { if...
[["-", 49, 50, 51, 16, 31, 2, 3, 4, 0, 13], ["+", 49, 50, 51, 16, 31, 2, 3, 4, 0, 22]]
1
150
#include <bits/stdc++.h> using namespace std; int main() { int N, M; cin >> N >> M; vector<int> A(N); for (int i = 0; i < N; i++) { cin >> A.at(i); } sort(A.begin(), A.end(), greater<int>()); int sum = 0; for (int i = 0; i < N; i++) { sum += A.at(i); } if (A.at(M - 1) < sum / (4 * M)) { ...
#include <bits/stdc++.h> using namespace std; int main() { int N, M; cin >> N >> M; vector<int> A(N); for (int i = 0; i < N; i++) { cin >> A.at(i); } sort(A.begin(), A.end(), greater<int>()); int sum = 0; for (int i = 0; i < N; i++) { sum += A.at(i); } if (A.at(M - 1) < sum / (4.0 * M)) { ...
[["-", 51, 16, 12, 16, 12, 23, 0, 16, 31, 13], ["+", 51, 16, 12, 16, 12, 23, 0, 16, 31, 13]]
1
149
#include <algorithm> #include <iostream> #include <string> #include <vector> #define ll long long using namespace std; const ll mod = 1e9 + 7; ll C[2005][2005]; ll dp[100005][13]; int main() { ll N, M, s = 0, ans = 0; cin >> N >> M; vector<int> A(N + 10); for (int i = 0; i < N; i++) { cin >> A[i]; s ...
#include <algorithm> #include <iostream> #include <string> #include <vector> #define ll long long using namespace std; const ll mod = 1e9 + 7; ll C[2005][2005]; ll dp[100005][13]; int main() { ll N, M, s = 0, ans = 0; cin >> N >> M; vector<int> A(N + 10); for (int i = 0; i < N; i++) { cin >> A[i]; s ...
[["-", 51, 16, 12, 16, 12, 23, 0, 16, 31, 13], ["+", 51, 16, 12, 16, 12, 23, 0, 16, 31, 13]]
1
168
import java.util.*; class Main { static public void main(String[] args) { Scanner sc = new Scanner(System.in); int n = sc.nextInt(); int m = sc.nextInt(); int[] a = new int[n]; boolean jubge = false; int sum = 0; for (int i = 0; i < n; i++) { a[i] = sc.nextInt(); sum += a[i]...
import java.util.*; class Main { static public void main(String[] args) { Scanner sc = new Scanner(System.in); int n = sc.nextInt(); int m = sc.nextInt(); int[] a = new int[n]; boolean jubge = false; double sum = 0; for (int i = 0; i < n; i++) { a[i] = sc.nextInt(); sum += a...
[["-", 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]]
3
254
#include <algorithm> #include <iostream> #include <vector> using namespace std; int main() { int N, M, Q = 0; cin >> N >> M; vector<int> A(N); for (int i = 0; i < N; i++) { cin >> A[i]; Q += A[i]; } sort(A.rbegin(), A.rend()); if (A.at(M - 1) > Q / (4 * M)) { cout << "Yes" << endl; } el...
#include <algorithm> #include <iostream> #include <vector> using namespace std; int main() { int N, M; float Q = 0; cin >> N >> M; vector<int> A(N); for (int i = 0; i < N; i++) { cin >> A[i]; Q += A[i]; } sort(A.rbegin(), A.rend()); if (A.at(M - 1) >= Q / (4 * M)) { cout << "Yes" << end...
[["-", 0, 30, 0, 14, 8, 9, 0, 43, 0, 21], ["+", 0, 30, 0, 14, 8, 9, 0, 43, 0, 35], ["+", 0, 30, 0, 14, 8, 9, 0, 43, 39, 40], ["-", 8, 9, 0, 57, 15, 339, 51, 16, 17, 47], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 17, 20]]
1
123
#include <algorithm> #include <iostream> #include <map> #include <set> #include <stdio.h> #include <string> #include <vector> using namespace std; #define ll long long #define rep(i, n) for (ll i = 0; i < n; i++) // #define req(j, n) for (ll j = 1; j < (n+1); j++) // #define rer(k, n) for (ll k = 1; k < (n+1); k++) ...
#include <algorithm> #include <iostream> #include <map> #include <set> #include <stdio.h> #include <string> #include <vector> using namespace std; #define ll long long #define rep(i, n) for (ll i = 0; i < n; i++) // #define req(j, n) for (ll j = 1; j < (n+1); j++) // #define rer(k, n) for (ll k = 1; k < (n+1); k++) ...
[["-", 0, 30, 0, 14, 8, 9, 0, 43, 39, 78], ["+", 0, 30, 0, 14, 8, 9, 0, 43, 39, 40]]
1
142
#include <bits/stdc++.h> using namespace std; int main() { int n, m, sum, p; p = 0; sum = 0; cin >> n >> m; vector<int> a(n); 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) { p++; } } if (p >= m) cout << "...
#include <bits/stdc++.h> using namespace std; int main() { int n, m, sum, p; p = 0; sum = 0; cin >> n >> m; vector<int> a(n); 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) { p++; } } if (p >= m) cout << ...
[["-", 8, 9, 0, 57, 15, 339, 51, 16, 17, 47], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 17, 20]]
1
131
#include <bits/stdc++.h> using namespace std; int main() { int n, m; cin >> n >> m; vector<int> a(n); int c = 0; int sum = 0; for (int i = 0; i < n; i++) { cin >> a.at(i); sum += a.at(i); } for (int i = 0; i < n; i++) { if (a.at(i) >= sum / (4 * m)) { c++; } } if (c >= m) ...
#include <bits/stdc++.h> using namespace std; int main() { int n, m; cin >> n >> m; vector<int> a(n); int c = 0; long long sum = 0; for (int i = 0; i < n; i++) { cin >> a.at(i); sum += a.at(i); } for (int i = 0; i < n; i++) { if (a.at(i) >= sum / (4.0 * m)) { c++; } } if (c ...
[["-", 0, 30, 0, 14, 8, 9, 0, 43, 39, 40], ["+", 0, 14, 8, 9, 0, 43, 39, 86, 0, 96], ["-", 51, 16, 12, 16, 12, 23, 0, 16, 31, 13], ["+", 51, 16, 12, 16, 12, 23, 0, 16, 31, 13]]
1
137
#include <bits/stdc++.h> using namespace std; int main() { long long n, m; cin >> n >> m; vector<int> a(n); long long sum = 0; for (auto &&i : a) { cin >> i; sum += i; } long long int count = 0; // cerr << sum << endl; for (auto &&i : a) { if (i >= (sum / (4 * m))) { count++; } ...
#include <bits/stdc++.h> using namespace std; int main() { long long n, m; cin >> n >> m; vector<long long int> a(n); long long sum = 0; for (auto &&i : a) { cin >> i; sum += i; } long long count = 0; // cerr << sum << endl; for (auto &&i : a) { if (i >= (sum / (4.0 * m))) { count++...
[["+", 39, 344, 3, 347, 0, 77, 39, 86, 0, 96], ["-", 0, 14, 8, 9, 0, 43, 39, 86, 39, 40], ["-", 12, 23, 0, 16, 12, 23, 0, 16, 31, 13], ["+", 12, 23, 0, 16, 12, 23, 0, 16, 31, 13]]
1
121
#include <bits/stdc++.h> #include <string.h> using namespace std; int main() { int N, M, sum = 0, count = 0; cin >> N >> M; vector<int> A(N); for (int i = 0; i < N; i++) { cin >> A.at(i); sum += A.at(i); } for (int i = 0; i < N; i++) { if (A.at(i) < (sum / (4 * M))) { // count++; } el...
#include <bits/stdc++.h> #include <string.h> using namespace std; int main() { double N, M, sum = 0, count = 0; cin >> N >> M; vector<int> A(N); for (int i = 0; i < N; i++) { cin >> A.at(i); sum += A.at(i); } for (int i = 0; i < N; i++) { if (A.at(i) < (sum / (4 * M))) { // 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, 47], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 17, 20]]
1
147
N, M = map(int, input().split()) A = list(map(int, input().split())) vote = sum(A) #print(vote) count = 0 line = 4*M line2 = vote//line ans = "No" for i in A: if (i >= line2): count += 1 #print(count) if (count > M): ans = "Yes" print(ans)
N,M = map(int, input().split()) A = list(map(int, input().split())) vote = sum(A) #print(vote) count = 0 line = 4*M line2 = vote/line #print(line2) ans = "No" for i in A: if (i >= line2): count += 1 #print(count) if (count >= M): ans = "Yes" print(ans)
[["-", 0, 656, 0, 1, 0, 662, 12, 657, 17, 676], ["+", 0, 656, 0, 1, 0, 662, 12, 657, 17, 85], ["-", 0, 656, 0, 57, 15, 23, 0, 666, 667, 47], ["+", 0, 656, 0, 57, 15, 23, 0, 666, 667, 20]]
5
90
line1 = input().split() n = int(line1[0]) m = int(line1[1]) line2 = input().split() line2 = [int(i) for i in line2] total = sum(line2) line2 = sorted(line2) if line2[m-1] > total / (4 * m): print("Yes") else: print("No")
line1 = input().split() n = int(line1[0]) m = int(line1[1]) line2 = input().split() line2 = [int(i) for i in line2] total = sum(line2) line2 = sorted(line2, reverse=True) if line2[m-1] >= total / (4 * m): print("Yes") else: print("No")
[["+", 0, 1, 0, 662, 12, 652, 3, 4, 0, 21], ["+", 0, 662, 12, 652, 3, 4, 0, 653, 141, 22], ["+", 0, 662, 12, 652, 3, 4, 0, 653, 0, 32], ["+", 0, 662, 12, 652, 3, 4, 0, 653, 51, 146], ["-", 36, 36, 0, 656, 0, 57, 15, 666, 667, 47], ["+", 36, 36, 0, 656, 0, 57, 15, 666, 667, 20]]
5
90
#include <bits/stdc++.h> using namespace std; int main() { double N, M, sum = 0; cin >> N >> M; vector<double> vote(N); for (int i = 1; i < N; i++) { cin >> vote.at(i); sum += vote.at(i); } sort(vote.begin(), vote.end()); if (vote.at(N - M) * 4 * M >= sum) { cout << "Yes" << endl; } else { ...
#include <bits/stdc++.h> using namespace std; int main() { int N, M, sum = 0; cin >> N >> M; vector<int> vote(N); for (int i = 0; i < N; i++) { cin >> vote.at(i); sum += vote.at(i); } sort(vote.begin(), vote.end()); if (vote.at(N - M) * 4 * M >= sum) { cout << "Yes" << endl; } else { co...
[["-", 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], ["-", 8, 9, 0, 7, 10, 43, 49, 50, 51, 13], ["+", 8, 9, 0, 7, 10, 43, 49, 50, 51, 13]]
1
123
#include <bits/stdc++.h> using namespace std; #define ll long long #define ld long double #define pi 3.14159265359 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); } sum /= 4 * M; int cnt = 0; for (int i = 0; i...
#include <bits/stdc++.h> using namespace std; #define ll long long #define ld long double #define pi 3.14159265359 int main() { int N, M; cin >> N >> M; vector<int> A(N); double sum = 0; for (int i = 0; i < N; i++) { cin >> A.at(i); sum += A.at(i); } sum /= 4 * M; int cnt = 0; for (int i = 0...
[["-", 0, 30, 0, 14, 8, 9, 0, 43, 39, 40], ["+", 0, 30, 0, 14, 8, 9, 0, 43, 39, 40]]
1
150
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(); ArrayList<Integer> list = new ArrayList<>(); int sum = 0; int res; for (int i = 0; i < n; i++) { int hoge = sc.nextInt();...
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(); ArrayList<Integer> list = new ArrayList<>(); int sum = 0; int res; for (int i = 0; i < n; i++) { int hoge = sc.nextInt();...
[["+", 15, 15, 0, 16, 12, 16, 12, 23, 0, 24], ["+", 15, 15, 0, 16, 12, 16, 12, 23, 0, 25]]
3
183
N, M = map(int, input().split()) votes = [int(i) for i in input().split()] count = [1 for vote in votes if vote >= sum(votes) * 1 / (4 * M)] if count >= M: print('Yes') else: print('No')
N, M = map(int, input().split()) votes = [int(i) for i in input().split()] count = [1 for vote in votes if vote >= sum(votes) * 1 / (4 * M)] if sum(count) >= M: print('Yes') else: print('No')
[["+", 0, 656, 0, 57, 15, 666, 0, 652, 63, 22], ["+", 0, 57, 15, 666, 0, 652, 3, 4, 0, 24], ["+", 0, 57, 15, 666, 0, 652, 3, 4, 0, 25]]
5
77
#include <bits/stdc++.h> using namespace std; int main(void) { int n, m; cin >> n >> m; vector<int> data(n); int sum = 0; for (int i = 0; i < n; i++) { cin >> data[i]; sum += data[i]; } sort(data.begin(), data.end(), greater<int>()); if (data[m - 1] < sum / (4 * m)) { cout << "No" << endl; ...
#include <bits/stdc++.h> using namespace std; int main(void) { double n, m; cin >> n >> m; vector<double> data(n); int sum = 0; for (int i = 0; i < n; i++) { cin >> data[i]; sum += data[i]; } sort(data.begin(), data.end(), greater<int>()); if (data[m - 1] < sum / (4 * m)) { cout << "No" << e...
[["-", 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
128
N,M=gets.chomp.split.map(&:to_i) A=gets.chomp.split.map(&:to_i) total_vote_count=A.inject(:+) if (A.sort.reverse)[M-1]<total_vote_count/(4*M) puts "No" else puts "Yes" end
N,M=gets.chomp.split.map(&:to_i) A=gets.chomp.split.map(&:to_f) total_vote_count=A.inject(:+) if (A.sort.reverse)[M-1]<total_vote_count/(4*M) 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]]
4
67
#include <iostream> using namespace std; int main() { int n, m; cin >> n >> m; int t = 0; double a[n]; for (int i = 0; i < n; i++) { cin >> a[i]; t += a[i]; } int c = 0; double cc = t / (4 * m); for (int i = 0; i < n; i++) { if (a[i] >= cc) { c++; } } if (c >= m) { cout...
#include <iostream> using namespace std; int main() { int n, m; cin >> n >> m; int t = 0; double a[n]; for (int i = 0; i < n; i++) { cin >> a[i]; t += a[i]; } int c = 0; double cc = (double)t / (4 * (double)m); for (int i = 0; i < n; i++) { if (a[i] >= cc) { c++; } } if (c ...
[["+", 0, 43, 49, 50, 51, 16, 31, 74, 0, 24], ["+", 49, 50, 51, 16, 31, 74, 39, 77, 39, 40], ["+", 0, 43, 49, 50, 51, 16, 31, 74, 0, 25], ["+", 51, 16, 12, 23, 0, 16, 12, 74, 0, 24], ["+", 12, 23, 0, 16, 12, 74, 39, 77, 39, 40], ["+", 51, 16, 12, 23, 0, 16, 12, 74, 0, 25]]
1
140
#include <bits/stdc++.h> using namespace std; typedef long long ll; using P = pair<int, int>; /* ちゃんと考えてわかって実装 */ int main(void) { int n, m; cin >> n >> m; int sum = 0; vector<int> a; for (int i = 0; i < n; i++) { int tmp; cin >> tmp; a.push_back(tmp); sum += tmp; } int ok = 0; double...
#include <bits/stdc++.h> using namespace std; typedef long long ll; using P = pair<int, int>; /* ちゃんと考えてわかって実装 */ int main(void) { int n, m; cin >> n >> m; double sum = 0; vector<int> a; for (int i = 0; i < n; i++) { int tmp; cin >> tmp; a.push_back(tmp); sum += tmp; } int ok = 0; dou...
[["-", 0, 30, 0, 14, 8, 9, 0, 43, 39, 40], ["+", 0, 30, 0, 14, 8, 9, 0, 43, 39, 40]]
1
155
#include <algorithm> #include <iostream> using namespace std; int main() { int n, m; int a[100]; int total = 0; // number of votes total cin >> n >> m; for (int i = 0; i < n; i++) { cin >> a[i]; total += a[i]; } sort(a, a + n); // put in order double threshold = total / (4 * m); if (a[n - ...
#include <algorithm> #include <iostream> using namespace std; int main() { int n, m; double a[100]; double total = 0; // number of votes total cin >> n >> m; for (int i = 0; i < n; i++) { cin >> a[i]; total += a[i]; } sort(a, a + n); // put in order double threshold = total / (4 * m); if (...
[["-", 0, 30, 0, 14, 8, 9, 0, 43, 39, 40], ["+", 0, 30, 0, 14, 8, 9, 0, 43, 39, 40]]
1
122
array = [] for i in range(2): val = input() array.append(val.split()) kinds = int(array[0][0]) populars = int(array[0][1]) votes_sum = 0 for vote in array[1]: votes_sum = votes_sum + int(vote) winning = votes_sum / (4 * populars) numbers = 0 for vote in array[1]: if int(vote) > winning: num...
array = [] for i in range(2): val = input() array.append(val.split()) kinds = int(array[0][0]) populars = int(array[0][1]) votes_sum = 0 for vote in array[1]: votes_sum = votes_sum + int(vote) winning = votes_sum / (4 * populars) numbers = 0 for vote in array[1]: if int(vote) >= winning: nu...
[["-", 0, 7, 8, 196, 0, 57, 15, 666, 667, 47], ["+", 0, 7, 8, 196, 0, 57, 15, 666, 667, 20]]
5
122
n,m=map(int,input().split()) a=list(map(int, input().split())) cnt=0 sou=sum(a) print(sou) for i in range(n): if a[i]>=sou/(4*m): cnt+=1 print('Yes' if cnt>=m else 'No')
n,m=map(int,input().split()) a=list(map(int, input().split())) cnt=0 sou=sum(a) for i in range(n): if a[i]>=sou/(4*m): cnt+=1 print('Yes' if cnt>=m else 'No')
[["-", 36, 36, 0, 656, 0, 1, 0, 652, 63, 22], ["-", 0, 656, 0, 1, 0, 652, 3, 4, 0, 24], ["-", 0, 656, 0, 1, 0, 652, 3, 4, 0, 22], ["-", 0, 656, 0, 1, 0, 652, 3, 4, 0, 25]]
5
85
n,m=map(int,input().split()) l=list(map(int,input().split())) c=len([i for i in l if i > sum(l)/(4*m)]) print("Yes" if c>=m else "No")
n,m=map(int,input().split()) l=list(map(int,input().split())) c=len([i for i in l if i >= sum(l)/(4*m)]) print("Yes" if c>=m else "No")
[["-", 3, 4, 0, 658, 0, 678, 0, 666, 667, 47], ["+", 3, 4, 0, 658, 0, 678, 0, 666, 667, 20]]
5
72
N,M = map(int,input().split()) A = list(map(int,input().split())) s = sum(A) p = s/4/M cnt = 0 for i in range(N): if A[i] >= p: cnt += 1 if cnt > M: print("Yes") else: print("No")
N,M = map(int,input().split()) A = list(map(int,input().split())) s = sum(A) p = s/4/M cnt = 0 for i in range(N): if A[i] >= p: cnt += 1 if cnt >= 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
87
#include "bits/stdc++.h" #include <set> using namespace std; #define FOR(i, a, b) for (int i = (a); i < (b); i++) #define RFOR(i, a, b) for (int i = (b)-1; i >= (a); i--) #define rep(i, n) for (int i = 0; i < (n); i++) #define rep1(i, n) for (int i = 1; i < (n); i++) #define rrep(i, n) for (int i = (n)-1; i >= 0; i--)...
#include "bits/stdc++.h" #include <set> using namespace std; #define FOR(i, a, b) for (int i = (a); i < (b); i++) #define RFOR(i, a, b) for (int i = (b)-1; i >= (a); i--) #define rep(i, n) for (int i = 0; i < (n); i++) #define rep1(i, n) for (int i = 1; i < (n); i++) #define rrep(i, n) for (int i = (n)-1; i >= 0; i--)...
[["-", 0, 30, 0, 14, 8, 9, 0, 43, 39, 40], ["+", 0, 30, 0, 14, 8, 9, 0, 43, 39, 40]]
1
245
n,m = map(int,input().split()) a = list(map(int,input().split())) sum = 0 for i in range(a): sum = sum + a[i] sum_divided = sum/(4*m) cnt = 0 for i in range(a): if a[i] >= sum_divided: cnt = cnt + 1 if cnt >= 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 = sum + a[i] sum_divided = sum/(4*m) cnt = 0 for i in range(n): if a[i] >= sum_divided: cnt = cnt + 1 if cnt >= m: print('Yes') else: print('No')
[["-", 0, 656, 0, 7, 12, 652, 3, 4, 0, 22], ["+", 0, 656, 0, 7, 12, 652, 3, 4, 0, 22]]
5
104
#include <algorithm> #include <cstdio> #include <iostream> using namespace std; #define MAX 1010 int nums[MAX]; int main() { int n, m; int sum = 0; scanf("%d %d", &n, &m); for (int i = 0; i < n; i++) { scanf("%d", &nums[i]); sum += nums[i]; } double temp = 1.0 / (m * 4) * sum; int cnt = 0; for (...
#include <algorithm> #include <cstdio> #include <iostream> using namespace std; #define MAX 1010 int nums[MAX]; int main() { int n, m; int sum = 0; scanf("%d %d", &n, &m); for (int i = 0; i < n; i++) { scanf("%d", &nums[i]); sum += nums[i]; } double temp = 1.0 / (m * 4) * sum; int cnt = 0; for (...
[["-", 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> #define rep(i, n) for (int i = 0; i < (n); i++) using namespace std; typedef long long ll; int main() { int n, m, sum = 0; cin >> n >> m; vector<int> a(n); for (int i = 0; i < n; i++) { cin >> a[i]; sum += a[i]; } sort(a.rbegin(), a.rend()); for (int i = 0; i < m; i++) {...
#include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < (n); i++) using namespace std; typedef long long ll; int main() { int n, m; double sum = 0; cin >> n >> m; vector<int> a(n); for (int i = 0; i < n; i++) { cin >> a[i]; sum += a[i]; } sort(a.rbegin(), a.rend()); for (int i = 0; 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], ["-", 51, 16, 12, 16, 12, 23, 0, 16, 31, 13], ["+", 51, 16, 12, 16, 12, 23, 0, 16, 31, 13]]
1
149
n,m = map(int, input().split()) a = sorted(list(map(int, input().split())), reverse=True) t = int(sum(a)/(4*m)) for i in range(m): if a[i] < t: print("No") exit() print("Yes")
n,m = map(int, input().split()) a = sorted(list(map(int, input().split())), reverse=True) t = sum(a)/(4*m) for i in range(m): if a[i] < t: print("No") exit() 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
86
import numpy as np N, M = map(int, input().split()) A = np.array(input().split(), dtype=np.int16) print(["Yes", "No"][(A > A.sum() / (4 * M)).sum() < M])
import numpy as np N, M = map(int, input().split()) A = np.array(input().split(), dtype=np.int16) print(["Yes", "No"][(A >= A.sum() / (4 * M)).sum() < M])
[["-", 0, 652, 63, 319, 500, 23, 0, 666, 667, 47], ["+", 0, 652, 63, 319, 500, 23, 0, 666, 667, 20]]
5
75
N,M=map(int,(input().split())) A=list(map(int,(input().split()))) count=0 for i in A: if i >= (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 A: if i >= (sum(A)/(4*M)): count+=1 if count>=M: print('Yes') else: print('No')
[["+", 15, 666, 0, 23, 0, 657, 12, 23, 0, 24], ["+", 15, 666, 0, 23, 0, 657, 12, 23, 0, 25]]
5
81
#include <stdio.h> int main(void) { int n, m, a[100], i, x = 0, s = 0; scanf("%d%d", &n, &m); for (i = 0; i < n; i++) { scanf("%d", &a[i]); s = s + a[i]; } for (i = 0; i < n; i++) if (4 * m * a[i] >= s) x++; if (x > m) printf("Yes\n"); else printf("No\n"); return 0; }
#include <stdio.h> int main(void) { int n, m, a[100], i, x = 0, s = 0; scanf("%d%d", &n, &m); for (i = 0; i < n; i++) { scanf("%d", &a[i]); s = s + a[i]; } for (i = 0; i < n; i++) if (4 * m * a[i] >= s) x++; if (x >= m) printf("Yes\n"); else printf("No\n"); return 0; }
[["-", 8, 9, 0, 57, 15, 23, 0, 16, 17, 47], ["+", 8, 9, 0, 57, 15, 23, 0, 16, 17, 20]]
0
134
#include <bits/stdc++.h> #define fastio \ ios_base::sync_with_stdio(false); \ cin.tie(NULL); \ cout.tie(NULL); #define endl "\n" #define PI 3.14...
#include <bits/stdc++.h> #define fastio \ ios_base::sync_with_stdio(false); \ cin.tie(NULL); \ cout.tie(NULL); #define endl "\n" #define PI 3.14...
[["-", 0, 16, 31, 16, 12, 23, 0, 16, 31, 13], ["+", 0, 16, 31, 16, 12, 23, 0, 16, 31, 13]]
1
154
#! env/bin/local python3 # -*- coding:utf-8 -*- is_first = True while True: try: if is_first: n, m = [int(i) for i in input().split()] is_first = False else: arr = [int(i) for i in input().split()] except EOFError: break total_vote = sum(arr) sorted...
#! env/bin/local python3 # -*- coding:utf-8 -*- is_first = True while True: try: if is_first: n, m = [int(i) for i in input().split()] is_first = False else: arr = [int(i) for i in input().split()] except EOFError: break total_vote = sum(arr) sorted...
[["+", 8, 196, 0, 57, 15, 666, 0, 657, 17, 48], ["+", 8, 196, 0, 57, 15, 666, 0, 657, 12, 22]]
5
117
def readInts(): return list(map(int, input(), split())) n, m = readInts() a = readInts() s = sum(a) cnt = 0 for i in range(n): if a[i]*4*m >=s: cnt +=1 if cnt >= m: print("Yes") else: print("No")
def readInts(): return list(map(int, input().split())) n, m = readInts() a = readInts() s = sum(a) cnt = 0 for i in range(n): if a[i]*4*m >=s: cnt +=1 if cnt >= m: print("Yes") else: print("No")
[["-", 0, 652, 3, 4, 0, 652, 3, 4, 0, 21], ["+", 0, 652, 3, 4, 0, 652, 63, 319, 0, 131]]
5
84
#include <bits/stdc++.h> using namespace std; #define MOD 1000000007 typedef long long ll; int main() { ll n, m, sum, temp, count; cin >> n >> m; vector<ll> v; bool judge = false; sum = 0; count = 0; for (ll i = 0; i < n; i++) { cin >> temp; sum += temp; v.push_back(temp); } sort(v.begin()...
#include <bits/stdc++.h> using namespace std; #define MOD 1000000007 typedef long long ll; int main() { ll n, m, sum, temp, count; cin >> n >> m; vector<ll> v; bool judge = false; sum = 0; count = 0; for (ll i = 0; i < n; i++) { cin >> temp; sum += temp; v.push_back(temp); } sort(v.begin()...
[["-", 15, 339, 51, 16, 12, 16, 31, 16, 12, 13], ["+", 15, 339, 51, 16, 12, 16, 12, 23, 0, 24], ["+", 51, 16, 12, 16, 12, 23, 0, 16, 31, 13], ["+", 15, 339, 51, 16, 12, 16, 12, 23, 0, 25]]
1
184
#include <iostream> using namespace std; #define f(i, n) for (int i = 0; i < n; i++) signed main() { int n, m; cin >> n >> m; int a[n]; int total = 0; f(i, n) { cin >> a[i]; total += a[i]; } int selectable = 0; double criterai = total / (4 * m); f(i, n) { if (a[i] >= criterai) sele...
#include <iostream> using namespace std; #define f(i, n) for (int i = 0; i < n; i++) signed main() { int n, m; cin >> n >> m; int a[n]; int total = 0; f(i, n) { cin >> a[i]; total += a[i]; } int selectable = 0; double criterai = total / (4.0 * m); // cout<<criterai<<endl; f(i, n) { if ...
[["-", 49, 50, 51, 16, 12, 23, 0, 16, 31, 13], ["+", 49, 50, 51, 16, 12, 23, 0, 16, 31, 13]]
1
130
import sys sys.setrecursionlimit(10 ** 6) # input = sys.stdin.readline #### int1 = lambda x: int(x) - 1 def II(): return int(input()) def MI(): return map(int, input().split()) def MI1(): return map(int1, input().split()) def LI(): return list(map(int, input().split())) def LI1(): return list(map(int1, input().spl...
import sys sys.setrecursionlimit(10 ** 6) # input = sys.stdin.readline #### int1 = lambda x: int(x) - 1 def II(): return int(input()) def MI(): return map(int, input().split()) def MI1(): return map(int1, input().split()) def LI(): return list(map(int, input().split())) def LI1(): return list(map(int1, input().spl...
[["-", 0, 7, 8, 196, 0, 57, 15, 666, 667, 47], ["+", 0, 7, 8, 196, 0, 57, 15, 666, 667, 20]]
5
206
from collections import defaultdict, deque, Counter from heapq import heappush, heappop from itertools import permutations, accumulate from math import sqrt, ceil, floor from bisect import bisect_left, bisect_right from copy import deepcopy from operator import itemgetter from math import gcd import sys def I(): return...
from collections import defaultdict, deque, Counter from heapq import heappush, heappop from itertools import permutations, accumulate from math import sqrt, ceil, floor from bisect import bisect_left, bisect_right from copy import deepcopy from operator import itemgetter from math import gcd import sys def I(): return...
[["-", 0, 7, 8, 196, 0, 57, 15, 666, 667, 47], ["+", 0, 7, 8, 196, 0, 57, 15, 666, 667, 20]]
5
359
#include <bits/stdc++.h> using namespace std; int main() { int N, M; int sum = 0; cin >> N >> M; vector<int> vec(110); for (int i = 0; i < N; i++) { cin >> vec.at(i); sum += vec.at(i); } sort(vec.begin(), vec.end()); reverse(vec.begin(), vec.end()); double evaluate = (sum / 4) / M; if (ve...
#include <bits/stdc++.h> using namespace std; int main() { int N, M; int sum = 0; cin >> N >> M; vector<int> vec(110); for (int i = 0; i < N; i++) { cin >> vec.at(i); sum += vec.at(i); } sort(vec.begin(), vec.end()); reverse(vec.begin(), vec.end()); double evaluate = (double)sum / (4 * M); ...
[["+", 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, 23, 0, 24], ["-", 0, 43, 49, 50, 51, 16, 31, 23, 0, 25], ["-", 8, 9, 0, 43, 49, 50, 51, 16, 17, 85], ["+", 49, 50, 51, 16, 12, 23, 0, 16, 17, 48], ["+", 0, 43, 49, 50, 51, 16, 12, 23, 0, 25]]
1
146
#include <bits/stdc++.h> #define rep(i, n) for (int(i) = 0; (i) < (n); i++) #define ll long long using namespace std; int main() { ll N = 0, M = 0; ll total = 0; cin >> N >> M; vector<ll> vec(N); rep(i, N) { cin >> vec[i]; total += vec[i]; } sort(vec.begin(), vec.end()); reverse(vec.begin(), vec...
#include <bits/stdc++.h> #define rep(i, n) for (int(i) = 0; (i) < (n); i++) #define ll long long using namespace std; int main() { ll N = 0, M = 0; long double total = 0; cin >> N >> M; vector<ll> vec(N); rep(i, N) { cin >> vec[i]; total += vec[i]; } sort(vec.begin(), vec.end()); reverse(vec.beg...
[["-", 0, 30, 0, 14, 8, 9, 0, 43, 39, 78], ["+", 0, 14, 8, 9, 0, 43, 39, 86, 0, 96], ["+", 0, 14, 8, 9, 0, 43, 39, 86, 39, 40]]
1
144
#include <bits/stdc++.h> using namespace std; using namespace std; #define ll long long #define f(i, a, b) for (int i = a; i < b; i++) #define endl '\n' #define spc " " #define pb push_back #define mp make_pair #define mod 1000000007 vector<vector<ll>> vii; int main() { ios::sync_with_stdio(0); cin.tie(0); //...
#include <bits/stdc++.h> using namespace std; using namespace std; #define ll long long #define f(i, a, b) for (int i = a; i < b; i++) #define endl '\n' #define spc " " #define pb push_back #define mp make_pair #define mod 1000000007 vector<vector<ll>> vii; int main() { ios::sync_with_stdio(0); cin.tie(0); //...
[["-", 0, 30, 0, 14, 8, 9, 0, 43, 39, 78], ["+", 0, 30, 0, 14, 8, 9, 0, 43, 39, 40], ["-", 0, 14, 8, 9, 0, 43, 49, 50, 51, 13], ["+", 0, 14, 8, 9, 0, 43, 49, 50, 51, 13]]
1
182
#include <bits/stdc++.h> using namespace std; #define ll long long int int main() { ll n, m; cin >> n >> m; ll arr[n], i, sum = 0; for (i = 0; i < n; i++) { cin >> arr[i]; sum = sum + arr[i]; } sort(arr, arr + n, greater<int>()); if ((float)arr[m - 1] >= (float)sum / (4 * m)) cout << "YES" <...
#include <bits/stdc++.h> using namespace std; #define ll long long int int main() { ll n, m; cin >> n >> m; ll arr[n], i, sum = 0; for (i = 0; i < n; i++) { cin >> arr[i]; sum = sum + arr[i]; } sort(arr, arr + n, greater<int>()); if ((float)arr[m - 1] >= (float)sum / (4 * m)) cout << "Yes" <...
[["-", 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
125
#include <algorithm> #include <climits> #include <cmath> #include <cstdio> #include <cstdlib> #include <cstring> #include <fstream> #include <iomanip> #include <iostream> #include <map> #include <queue> #include <set> #include <stack> #include <string> #include <vector> #define MOD (1000000007) using namespace std; ...
#include <algorithm> #include <climits> #include <cmath> #include <cstdio> #include <cstdlib> #include <cstring> #include <fstream> #include <iomanip> #include <iostream> #include <map> #include <queue> #include <set> #include <stack> #include <string> #include <vector> #define MOD (1000000007) using namespace std; ...
[["-", 51, 16, 12, 16, 12, 23, 0, 16, 31, 13], ["+", 51, 16, 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
191
#include <algorithm> #include <bitset> #include <cassert> #include <cmath> #include <complex> #include <cstdio> #include <cstdlib> #include <fstream> #include <iomanip> #include <iostream> #include <limits> #include <map> #include <memory> #include <queue> #include <random> #include <set> #include <sstream> #include <s...
#include <algorithm> #include <bitset> #include <cassert> #include <cmath> #include <complex> #include <cstdio> #include <cstdlib> #include <fstream> #include <iomanip> #include <iostream> #include <limits> #include <map> #include <memory> #include <queue> #include <random> #include <set> #include <sstream> #include <s...
[["+", 51, 16, 31, 23, 0, 16, 31, 74, 0, 24], ["+", 31, 23, 0, 16, 31, 74, 39, 77, 39, 40], ["+", 51, 16, 31, 23, 0, 16, 31, 74, 0, 25], ["+", 51, 16, 31, 23, 0, 16, 12, 74, 0, 24], ["+", 31, 23, 0, 16, 12, 74, 39, 77, 39, 40], ["+", 51, 16, 31, 23, 0, 16, 12, 74, 0, 25]]
1
202
#include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < (n); i++) using namespace std; typedef long long ll; typedef pair<ll, ll> P; const char wall = '#'; vector<vector<char>> fields; vector<vector<bool>> used; vector<vector<ll>> dist; const int dx[4] = {0, -1, 0, 1}; const int dy[4] = {1, 0, -1, 0}; ll N, M;...
#include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < (n); i++) using namespace std; typedef long long ll; typedef pair<ll, ll> P; const char wall = '#'; vector<vector<char>> fields; vector<vector<bool>> used; vector<vector<ll>> dist; const int dx[4] = {0, -1, 0, 1}; const int dy[4] = {1, 0, -1, 0}; ll N, M;...
[["+", 49, 50, 51, 16, 31, 16, 31, 2, 63, 40], ["+", 51, 16, 31, 16, 31, 2, 3, 4, 0, 24], ["+", 51, 16, 31, 16, 31, 2, 3, 4, 0, 25], ["+", 0, 14, 8, 9, 0, 57, 64, 9, 0, 45], ["+", 0, 14, 8, 9, 0, 57, 64, 9, 0, 46]]
1
276
#include <algorithm> #include <cmath> #include <iostream> #include <limits> #include <map> #include <queue> #include <set> #include <sstream> #include <stack> #include <string> #include <unordered_map> #include <vector> using namespace std; typedef long long ll; typedef unsigned long long ull; typedef int itn; const...
#include <algorithm> #include <cmath> #include <iostream> #include <limits> #include <map> #include <queue> #include <set> #include <sstream> #include <stack> #include <string> #include <unordered_map> #include <vector> using namespace std; typedef long long ll; typedef unsigned long long ull; typedef int itn; const...
[["+", 0, 57, 15, 339, 51, 16, 31, 74, 0, 24], ["+", 15, 339, 51, 16, 31, 74, 39, 77, 39, 40], ["+", 0, 57, 15, 339, 51, 16, 31, 74, 0, 25], ["+", 15, 339, 51, 16, 12, 16, 31, 74, 0, 24], ["+", 51, 16, 12, 16, 31, 74, 39, 77, 39, 40], ["+", 15, 339, 51, 16, 12, 16, 31, 74, 0, 25]]
1
548
#include <math.h> #include <stdbool.h> #include <stdio.h> #include <stdlib.h> #include <string.h> #define LL long long #define DB double #define PI 3.14159265358979 #define MOD 1000000007 #define ERR 0.00000000000001 #define NUM 200010 int compare_int(const void *a, const void *b) { return *(int *)b - *(int *)a; } in...
#include <math.h> #include <stdbool.h> #include <stdio.h> #include <stdlib.h> #include <string.h> #define LL long long #define DB double #define PI 3.14159265358979 #define MOD 1000000007 #define ERR 0.00000000000001 #define NUM 200010 int compare_int(const void *a, const void *b) { return *(int *)b - *(int *)a; } in...
[["-", 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], ["-", 51, 16, 12, 16, 12, 23, 0, 16, 31, 13], ["+", 51, 16, 12, 16, 12, 23, 0, 16, 31, 13]]
1
183
N,M = map(int, input().split()) A = sorted(list (map(int, input() .split() ) ) ) if A[M-1] >= sum(A)/M/4 : print( 'Yes' ) else : print( 'No' )
N,M = map(int, input().split()) A = sorted(list (map(int, input() .split() ) ) ) if A[N-M] >= sum(A)/M/4 : print( 'Yes' ) else : print( 'No' )
[["-", 0, 57, 15, 666, 0, 206, 206, 657, 31, 22], ["+", 0, 57, 15, 666, 0, 206, 206, 657, 31, 22], ["-", 0, 57, 15, 666, 0, 206, 206, 657, 12, 612], ["+", 0, 57, 15, 666, 0, 206, 206, 657, 12, 22]]
5
67
N,M = map(int,input().split()) A = list(map(int,input().split())) s = sum(A) A = sorted(A, reverse = True) if A[M-1] >= s//(4*M): print("Yes") else: print("No")
N,M = map(int,input().split()) A = list(map(int,input().split())) s = sum(A) A = sorted(A, reverse = True) 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
79
N,M=map(int,input().split()) a=list(map(int,input().split())) a=sorted(a, reversed =True) if sum(a)/(4*M)<=a[M-1]: print("Yes") else: print("No")
N,M=map(int,input().split()) a=list(map(int,input().split())) a=sorted(a, reverse=True) if sum(a)/(4*M)<=a[M-1]: print("Yes") else: print("No")
[["-", 0, 662, 12, 652, 3, 4, 0, 653, 141, 22], ["+", 0, 662, 12, 652, 3, 4, 0, 653, 141, 22]]
5
76
#include <iostream> #include <stdio.h> //#include <bits/stdc++.h> #include <algorithm> #include <cassert> #include <cmath> #include <cmath> #include <cstdint> #include <cstring> #include <float.h> #include <iomanip> #include <map> #include <math.h> #include <queue> #include <set> #include <sstream> #include <string> #i...
#include <iostream> #include <stdio.h> //#include <bits/stdc++.h> #include <algorithm> #include <cassert> #include <cmath> #include <cmath> #include <cstdint> #include <cstring> #include <float.h> #include <iomanip> #include <map> #include <math.h> #include <queue> #include <set> #include <sstream> #include <string> #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, 30, 0, 14, 8, 9, 0, 43, 39, 78]]
1
273
#include <iostream> #include <stdio.h> //#include <bits/stdc++.h> #include <algorithm> #include <cassert> #include <cmath> #include <cmath> #include <cstdint> #include <cstring> #include <float.h> #include <iomanip> #include <map> #include <math.h> #include <queue> #include <set> #include <sstream> #include <string> #i...
#include <iostream> #include <stdio.h> //#include <bits/stdc++.h> #include <algorithm> #include <cassert> #include <cmath> #include <cmath> #include <cstdint> #include <cstring> #include <float.h> #include <iomanip> #include <map> #include <math.h> #include <queue> #include <set> #include <sstream> #include <string> #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, 2, 63, 346, 3, 347, 0, 77, 39, 40], ["+", 0, 2, 63, 346, 3, 347, 0, 77, 39, 40]]
1
317
#include <bits/stdc++.h> using namespace std; int main() { int N, M; cin >> N >> M; vector<int> product(N); for (int i = 0; i < N; i++) { cin >> product.at(i); } int sum = 0; for (int i = 0; i < N; i++) { sum += product.at(i); } sort(product.begin(), product.end()); reverse(product.begin...
#include <bits/stdc++.h> using namespace std; int main() { int N, M; cin >> N >> M; vector<int> product(N); for (int i = 0; i < N; i++) { cin >> product.at(i); } int sum = 0; for (int i = 0; i < N; i++) { sum += product.at(i); } sort(product.begin(), product.end()); reverse(product.begin...
[["-", 8, 9, 0, 57, 15, 339, 51, 16, 17, 18], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 17, 19], ["+", 15, 339, 51, 16, 12, 16, 31, 23, 0, 24], ["+", 51, 16, 12, 16, 31, 23, 0, 16, 17, 33], ["+", 51, 16, 12, 16, 31, 23, 0, 16, 12, 13], ["+", 15, 339, 51, 16, 12, 16, 31, 23, 0, 25]]
1
181
#include <bits/stdc++.h> using namespace std; int a[100]; int main(int argc, const char *argv[]) { int m, n, sum = 0; cin >> n >> m; for (int i = 0; i < n; i++) { cin >> a[i]; sum += a[i]; } sort(a, a + n); reverse(a, a + n); if (a[m - 1] < sum / (4 * m)) cout << "No" << endl; else cout ...
#include <bits/stdc++.h> using namespace std; int a[100]; int main(int argc, const char *argv[]) { int m, n, sum = 0; cin >> n >> m; for (int i = 0; i < n; i++) { cin >> a[i]; sum += a[i]; } sort(a, a + n); reverse(a, a + n); if (a[m - 1] * 4 * m < sum) cout << "No" << endl; else cout <<...
[["-", 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
127
n, m = map(int, input().split()) A = list(map(int, input().split())) l = int(sum(A)/(4*m)) cnt = 0 for a in A: if a >= l: cnt += 1 print("Yes" if cnt >= m else "No")
import math n, m = map(int, input().split()) A = list(map(int, input().split())) l = math.ceil(sum(A)/(4*m)) cnt = 0 for a in A: if a >= l: cnt += 1 print("Yes" if cnt >= m else "No")
[["+", 36, 36, 36, 36, 0, 656, 0, 596, 0, 487], ["+", 36, 36, 0, 656, 0, 596, 141, 673, 0, 22], ["-", 0, 656, 0, 1, 0, 662, 12, 652, 63, 22], ["+", 0, 1, 0, 662, 12, 652, 63, 319, 500, 22], ["+", 0, 1, 0, 662, 12, 652, 63, 319, 0, 131], ["+", 0, 1, 0, 662, 12, 652, 63, 319, 319, 22]]
5
78
n, m = map(int, input().split()) A = list(map(int, input().split())) l = int(sum(A)/(4*m)) cnt = 0 for a in A: if a >= l: cnt += 1 print("Yes" if cnt >= m else "No")
n, m = map(int, input().split()) A = list(map(int, input().split())) l = sum(A)/(4*m) cnt = 0 for a in A: if a >= l: cnt += 1 print("Yes" if cnt >= m else "No")
[["-", 0, 656, 0, 1, 0, 662, 12, 652, 63, 22], ["-", 0, 1, 0, 662, 12, 652, 3, 4, 0, 24], ["-", 12, 652, 3, 4, 0, 657, 12, 23, 0, 25]]
5
78
#include <bits/stdc++.h> using namespace std; int main() { double N, M; int64_t sum = 0; vector<double> a(1001); bool chk = true; cin >> N >> M; for (int i = 0; i < N; i++) { cin >> a.at(i); } 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; int main() { double N, M; int64_t sum = 0; vector<double> a(1001); bool chk = true; cin >> N >> M; for (int i = 0; i < N; i++) { cin >> a.at(i); } for (int i = 0; i < N; i++) { sum += a.at(i); } sort(a.begin(), a.end()); reverse(a.begin(), a.e...
[["-", 0, 14, 8, 9, 0, 7, 15, 16, 12, 22], ["+", 0, 14, 8, 9, 0, 7, 15, 16, 12, 22]]
1
186
def solve n, m = gets.split.map!(&:to_i) a = gets.split.map!(&:to_i) tot_votes = 0 a.map { |vote| tot_votes += vote } cnt = 0 (0..(n - 1)).each do |i| cnt += 1 if a[i] >= (tot_votes / (4 * m)).to_i return 'Yes' if cnt == m end 'No' end print solve
def solve n, m = gets.split.map!(&:to_i) a = gets.split.map!(&:to_i) tot_votes = 0 a.map { |vote| tot_votes += vote } cnt = 0 (0..(n - 1)).each do |i| cnt += 1 if a[i] >= tot_votes / (4 * m).to_f end return 'Yes' if cnt >= m 'No' end print solve
[["-", 0, 751, 15, 738, 12, 652, 486, 739, 0, 24], ["-", 12, 652, 486, 739, 0, 738, 12, 739, 0, 25], ["-", 8, 736, 0, 751, 15, 738, 12, 652, 735, 22], ["+", 0, 751, 15, 738, 12, 738, 12, 652, 735, 22], ["+", 0, 735, 8, 736, 0, 652, 196, 737, 0, 444], ["-", 196, 737, 8, 736, 0, 751, 15, 738, 17, 60], ["+", 0, 735, 8, 73...
4
93
#include <algorithm> #include <cstdio> #include <iostream> #include <string.h> #include <vector> using namespace std; int main() { int n, m; cin >> n >> m; vector<long long> A; int count = 0; long long sum = 0; // int mm = 0; int x; for (int i = 0; i < n; i++) { scanf("%d", &x); sum = sum...
#include <algorithm> #include <cstdio> #include <iostream> #include <string.h> #include <vector> using namespace std; int main() { int n, m; cin >> n >> m; vector<long long> A; int count = 0; double sum = 0; // int mm = 0; int x; for (int i = 0; i < n; i++) { scanf("%d", &x); sum = sum + ...
[["-", 0, 14, 8, 9, 0, 43, 39, 86, 0, 96], ["+", 0, 30, 0, 14, 8, 9, 0, 43, 39, 40]]
1
185
n,m=map(int,input().split()) a=list(map(int,input().split())) s = sum(a) a.sort() a.reverse() for i in range(n): if i >= m: print('Yes') exit() if a[i]*4*m < s: print('No') exit()
n,m=map(int,input().split()) a=list(map(int,input().split())) s = sum(a) a.sort() a.reverse() for i in range(n): if i >= m: print('Yes') exit() if a[i]*4*m < s: print('No') exit() print('Yes')
[["+", 36, 36, 0, 656, 0, 1, 0, 652, 63, 22], ["+", 0, 656, 0, 1, 0, 652, 3, 4, 0, 24], ["+", 0, 1, 0, 652, 3, 4, 0, 557, 0, 654], ["+", 0, 1, 0, 652, 3, 4, 0, 557, 0, 6], ["+", 0, 1, 0, 652, 3, 4, 0, 557, 0, 655], ["+", 0, 656, 0, 1, 0, 652, 3, 4, 0, 25]]
5
92
# B - Popular Vote # https://atcoder.jp/contests/abc161/tasks/abc161_bß # N 商品の種類数 # M 選択したい商品数 # votes 各商品ごとの投票数 N,M = list(map(int,input().split())) votes = list(map(int,input().split())) # 総投票数 total_vote = 0 # 総投票数算出 for vote in votes: total_vote += vote # 購入できる商品数 i = 0 for vote in votes: # 得票数が総投票数の ...
# B - Popular Vote # https://atcoder.jp/contests/abc161/tasks/abc161_bß # N 商品の種類数 # M 選択したい商品数 # votes 各商品ごとの投票数 N,M = list(map(int,input().split())) votes = list(map(int,input().split())) # 総投票数 total_vote = 0 # 総投票数算出 for vote in votes: total_vote += vote # 購入できる商品数 i = 0 for vote in votes: # 得票数が総投票数の ...
[["-", 0, 7, 8, 196, 0, 57, 15, 666, 667, 47], ["+", 0, 7, 8, 196, 0, 57, 15, 666, 667, 20]]
5
102
#include <bits/stdc++.h> using namespace std; int main() { int n, m; cin >> n >> m; vector<int> vec_a(n); int total = 0; for (int i = 0; i < n; i++) { int a; cin >> a; vec_a.at(i) = a; total += a; } int res = 0; for (int i = 0; i < n; i++) { if (vec_a.at(i) >= total / (4 * m)) { ...
#include <bits/stdc++.h> using namespace std; int main() { int n, m; cin >> n >> m; vector<int> vec_a(n); int total = 0; for (int i = 0; i < n; i++) { int a; cin >> a; vec_a.at(i) = a; total += a; } int res = 0; for (int i = 0; i < n; i++) { if ((double)vec_a.at(i) >= (double)tota...
[["+", 0, 57, 15, 339, 51, 16, 31, 74, 0, 24], ["+", 15, 339, 51, 16, 31, 74, 39, 77, 39, 40], ["+", 0, 57, 15, 339, 51, 16, 31, 74, 0, 25], ["+", 15, 339, 51, 16, 12, 16, 31, 74, 0, 24], ["+", 51, 16, 12, 16, 31, 74, 39, 77, 39, 40], ["+", 15, 339, 51, 16, 12, 16, 31, 74, 0, 25]]
1
144
#include <bits/stdc++.h> using namespace std; typedef long long ll; int main() { int N, M; cin >> N >> M; vector<int> A; for (int i = 0; i < N; i++) { int tmp; cin >> tmp; A.push_back(tmp); } int allp = accumulate(A.begin(), A.end(), 0); // cout << "allp:" << allp << "\n"; float toku = al...
#include <bits/stdc++.h> using namespace std; typedef long long ll; int main() { int N, M; cin >> N >> M; vector<int> A; for (int i = 0; i < N; i++) { int tmp; cin >> tmp; A.push_back(tmp); } int allp = accumulate(A.begin(), A.end(), 0); // cout << "allp:" << allp << "\n"; float toku = (f...
[["+", 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
170
#include <bits/stdc++.h> using namespace std; int main() { int N, M; cin >> N >> M; int A[110], sum = 0; for (int i = 0; i < N; i++) { cin >> A[i]; sum += A[i]; } int cnt = 0; for (int i = 0; i < N; i++) { if (A[i] >= sum / (4 * M)) cnt++; } if (cnt >= M) cout << "Yes" << endl...
#include <bits/stdc++.h> using namespace std; int main() { int N, M; cin >> N >> M; int A[110], sum = 0; for (int i = 0; i < N; i++) { cin >> A[i]; sum += A[i]; } int cnt = 0; for (int i = 0; i < N; i++) { if (A[i] >= sum * 1.0 / (4 * M)) cnt++; } if (cnt >= M) cout << "Yes" <...
[["+", 15, 339, 51, 16, 12, 16, 31, 16, 17, 48], ["+", 15, 339, 51, 16, 12, 16, 31, 16, 12, 13]]
1
125
n, m = map(int, input().split()) A = list(map(int, input().split())) A.sort(reverse=True) chk = True s = sum(A) for i in range(m): if A[i] >= s//(4*m): pass else: chk = False if chk == True: print('Yes') else: print('No')
n, m = map(int, input().split()) A = list(map(int, input().split())) A.sort(reverse=True) chk = True s = sum(A) for i in range(m): if A[i] >= s/(4*m): pass else: chk = False if chk == True: print('Yes') else: print('No')
[["-", 8, 196, 0, 57, 15, 666, 0, 657, 17, 676], ["+", 8, 196, 0, 57, 15, 666, 0, 657, 17, 85]]
5
97
n, m = map(int, input().split()) a = list(map(int, input().split())) print("Yes") if len([a[i] for i in range(m) if a[i] > sum(a) / 4 / m]) >= m else print("No")
n, m = map(int, input().split()) a = list(map(int, input().split())) print("Yes") if len([a[i] for i in range(n) if a[i] >= sum(a) / 4 / m]) >= m else print("No")
[["-", 0, 658, 0, 659, 12, 652, 3, 4, 0, 22], ["+", 0, 658, 0, 659, 12, 652, 3, 4, 0, 22], ["-", 3, 4, 0, 658, 0, 678, 0, 666, 667, 47], ["+", 3, 4, 0, 658, 0, 678, 0, 666, 667, 20]]
5
79
#include <algorithm> #include <iostream> #include <numeric> #include <vector> using namespace std; using ll = long long; int main() { int n, m; cin >> n >> m; vector<int> v(n); for (auto i = 0; i != n; ++i) { cin >> v[i]; } const auto threshold = accumulate(begin(v), end(v), 0) / (4 * m); cout << ...
#include <algorithm> #include <iostream> #include <numeric> #include <vector> using namespace std; using ll = long long; int main() { int n, m; cin >> n >> m; vector<int> v(n); for (auto i = 0; i != n; ++i) { cin >> v[i]; } const auto threshold = accumulate(begin(v), end(v), 0.) / (4 * m); cout <<...
[["-", 49, 50, 51, 16, 31, 2, 3, 4, 0, 13], ["+", 49, 50, 51, 16, 31, 2, 3, 4, 0, 13]]
1
139
N,M=map(int,input().split()) L=list(map(int,input().split())) S=sum(L) L.sort() a=L[N-M] if a*4*M<S: print('NO') else: print('Yes')
N,M=map(int,input().split()) L=list(map(int,input().split())) S=sum(L) L.sort() a=L[N-M] if a*4*M<S: 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
75