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
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 cnt = 0; int all = 0; String flag = "No"; int num[] = new int[n]; double check = 0; // int x = 1; // System.out....
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 cnt = 0; int all = 0; String flag = "No"; int num[] = new int[n]; double check = 0.0; // int x = 1; // System.ou...
[["-", 0, 195, 8, 196, 0, 503, 49, 200, 51, 499], ["+", 0, 195, 8, 196, 0, 503, 49, 200, 51, 515], ["+", 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
191
# coding: utf-8 # Your code here! N, M = map(int, input().split()) A = list(map(int, input().split())) A.sort(reverse = True) quart = sum(A) / N for i in range(M): if A[i] < quart: print('No') exit() else: print('Yes')
# coding: utf-8 # Your code here! N, M = map(int, input().split()) A = list(map(int, input().split())) A.sort(reverse = True) quart = sum(A) / (4 * M) for i in range(M): if A[i] < quart: print('No') exit() else: print('Yes')
[["-", 0, 656, 0, 1, 0, 662, 12, 657, 12, 22], ["+", 0, 1, 0, 662, 12, 657, 12, 23, 0, 24], ["+", 0, 662, 12, 657, 12, 23, 0, 657, 31, 612], ["+", 0, 662, 12, 657, 12, 23, 0, 657, 17, 48], ["+", 0, 662, 12, 657, 12, 23, 0, 657, 12, 22], ["+", 0, 1, 0, 662, 12, 657, 12, 23, 0, 25]]
5
84
#include <iostream> #include <vector> int main() { int N = 0; int M = 0; std::cin >> N >> M; std::vector<int> vec(N); for (int cnt = 0; cnt < N; cnt++) { std::cin >> vec.at(cnt); } int border = 0; for (int num : vec) { border += num; } if (border % (4 * M) == 0) { border /= 4 * M; }...
#include <iostream> #include <vector> int main() { int N = 0; int M = 0; std::cin >> N >> M; std::vector<int> vec(N); for (int cnt = 0; cnt < N; cnt++) { std::cin >> vec.at(cnt); } int border = 0; for (int num : vec) { border += num; } if (border % (4 * M) == 0) { border /= 4 * M; }...
[["-", 8, 9, 0, 57, 15, 339, 51, 16, 17, 18], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 17, 19]]
1
179
#include <algorithm> #include <iostream> #include <math.h> #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]; long long sum = 0; for (int i = 0; i < n; i++) sum += A[i]; int count = 0; for (int i = 0; i < n; ...
#include <algorithm> #include <iostream> #include <math.h> #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]; long long sum = 0; for (int i = 0; i < n; i++) sum += A[i]; int count = 0; for (int i = 0; i < n; ...
[["+", 51, 16, 12, 16, 31, 74, 39, 77, 39, 40], ["+", 15, 339, 51, 16, 12, 16, 31, 74, 0, 25], ["-", 51, 16, 12, 23, 0, 16, 12, 23, 0, 25]]
1
154
#include <limits.h> #include <math.h> #include <stdio.h> #include <stdlib.h> #include <string.h> #define rep(i, n) for (int i = 0; i < n; i++) typedef long long ll; const ll mod = 1e9 + 7; int main() { ll N, M, tmp, idx, sum = 0; ll *A; // int i; scanf("%lld%lld", &N, &M); A = (ll *)malloc(sizeof(ll) * N);...
#include <limits.h> #include <math.h> #include <stdio.h> #include <stdlib.h> #include <string.h> #define rep(i, n) for (int i = 0; i < n; i++) typedef long long ll; const ll mod = 1e9 + 7; int main() { ll N, M, tmp, idx, sum = 0; ll *A; // int i; scanf("%lld%lld", &N, &M); A = (ll *)malloc(sizeof(ll) * N);...
[["+", 0, 41, 15, 16, 12, 16, 31, 74, 0, 24], ["+", 15, 16, 12, 16, 31, 74, 39, 77, 39, 40], ["+", 0, 41, 15, 16, 12, 16, 31, 74, 0, 25]]
0
233
import java.util.*; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int n = Integer.parseInt(sc.next()); double m = Double.parseDouble(sc.next()); double[] ary = new double[n]; double sum = 0.0; double c = 0.0; for (int i = 0; i < n; i++)...
import java.util.*; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int n = Integer.parseInt(sc.next()); double m = Double.parseDouble(sc.next()); double[] ary = new double[n]; double sum = 0.0; double c = 0.0; for (int i = 0; i < n; i++)...
[["-", 8, 196, 0, 57, 15, 15, 0, 16, 17, 47], ["+", 8, 196, 0, 57, 15, 15, 0, 16, 17, 20]]
3
193
#include <math.h> #include <stdbool.h> #include <stdio.h> #include <stdlib.h> #define LINE_BUF_SIZE 1024 int main(void) { int i; int N, M; int A[1000]; int count = 0; int sum = 0; scanf("%d %d", &N, &M); for (i = 0; i < N; i++) { A[i] = 0; } for (i = 0; i < N; i++) { scanf("%d", &A[i]); ...
#include <math.h> #include <stdbool.h> #include <stdio.h> #include <stdlib.h> #define LINE_BUF_SIZE 1024 int main(void) { int i; int N, M; int A[1000]; int count = 0; int sum = 0; scanf("%d %d", &N, &M); for (i = 0; i < N; i++) { A[i] = 0; } for (i = 0; i < N; i++) { scanf("%d", &A[i]); ...
[["+", 12, 74, 51, 23, 0, 16, 31, 74, 0, 24], ["+", 51, 23, 0, 16, 31, 74, 39, 77, 39, 40], ["+", 12, 74, 51, 23, 0, 16, 31, 74, 0, 25], ["+", 12, 74, 51, 23, 0, 16, 12, 74, 0, 24], ["+", 51, 23, 0, 16, 12, 74, 39, 77, 39, 40], ["+", 12, 74, 51, 23, 0, 16, 12, 74, 0, 25]]
0
180
N, M = map(int, input().split()) A = list(map(int, input().split())) flg = False A.sort(reverse=True) for i in range(M): if 1 / 4 / M <= A[i]: flg = True else: flg = False if flg: print('Yes') else: print('No')
N, M = map(int, input().split()) A = list(map(int, input().split())) flg = False A.sort(reverse=True) for i in range(M): if sum(A) / 4 / M <= A[i]: flg = True else: flg = False if flg: print('Yes') else: print('No')
[["-", 0, 57, 15, 666, 0, 657, 31, 657, 31, 612], ["+", 15, 666, 0, 657, 31, 657, 31, 652, 63, 22], ["+", 0, 657, 31, 657, 31, 652, 3, 4, 0, 24], ["+", 0, 657, 31, 657, 31, 652, 3, 4, 0, 22], ["+", 0, 657, 31, 657, 31, 652, 3, 4, 0, 25]]
5
89
import java.util.*; public class Main { public static void main(String[] args) { Scanner scanner = new Scanner(System.in); int n, m; n = scanner.nextInt(); m = scanner.nextInt(); Integer[] a = new Integer[n]; int sum = 0; for (int i = 0; i < n; i++) { a[i] = scanner.nextInt(); ...
import java.util.*; public class Main { public static void main(String[] args) { Scanner scanner = new Scanner(System.in); int n, m; n = scanner.nextInt(); m = scanner.nextInt(); Integer[] a = new Integer[n]; int sum = 0; for (int i = 0; i < n; i++) { a[i] = scanner.nextInt(); ...
[["-", 49, 200, 51, 16, 12, 23, 0, 16, 12, 499], ["+", 49, 200, 51, 16, 12, 23, 0, 16, 12, 515]]
3
170
#include <bits/stdc++.h> using namespace std; int main(void) { int N, M; cin >> N >> M; vector<int> A(N); for (int i = 0; i < N; i++) { cin >> A[i]; } int sum = 0; for (int i = 0; i < N; i++) { sum += A[i]; } int count = 0; for (int i = 0; i < N; i++) { if (A[i] * 4 * M > sum) cou...
#include <bits/stdc++.h> using namespace std; int main(void) { int N, M; cin >> N >> M; vector<int> A(N); for (int i = 0; i < N; i++) { cin >> A[i]; } int sum = 0; for (int i = 0; i < N; i++) { sum += A[i]; } int count = 0; for (int i = 0; i < N; i++) { if (A[i] * 4 * M >= sum) co...
[["-", 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())) a = sorted(a, reverse=True) total = 0 for i in range(n): total += a[i] min = total // (4 * m) bool = True for i in range(m): if a[i] >= min: continue else: bool = False if bool == True: print('Yes') else: print('...
n, m = map(int, input().split()) a = list(map(int, input().split())) a = sorted(a, reverse=True) total = 0 for i in range(n): total += a[i] min = total / (4 * m) bool = True for i in range(m): if a[i] >= min: continue else: bool = False if bool == True: print('Yes') else: print('N...
[["-", 0, 656, 0, 1, 0, 662, 12, 657, 17, 676], ["+", 0, 656, 0, 1, 0, 662, 12, 657, 17, 85]]
5
113
#include <algorithm> #include <iostream> #include <math.h> #include <string.h> #include <utility> #include <vector> using namespace std; typedef long long int ll; const ll mod = 998244353; const ll INF = 1e9 + 5; int a[100]; void solve() { int n, m, sum = 0; cin >> n >> m; for (int i = 0; i < n; i++) cin >> ...
#include <algorithm> #include <iostream> #include <math.h> #include <string.h> #include <utility> #include <vector> using namespace std; typedef long long int ll; const ll mod = 998244353; const ll INF = 1e9 + 5; int a[100]; void solve() { int n, m, sum = 0; cin >> n >> m; for (int i = 0; i < n; i++) cin >> ...
[["-", 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
162
#include <bits/stdc++.h> #include <ext/pb_ds/assoc_container.hpp> #include <ext/pb_ds/tree_policy.hpp> #define FOR0(i, n) for (i = 0; i < n; i++) #define FOR(i, j, n) for (i = j; i < n; i++) #define FORD(i, j, k) for (i = j; i >= k; i--) #define pb push_back #define mp make_pair #define ff first #define ss second #defi...
#include <bits/stdc++.h> #include <ext/pb_ds/assoc_container.hpp> #include <ext/pb_ds/tree_policy.hpp> #define FOR0(i, n) for (i = 0; i < n; i++) #define FOR(i, j, n) for (i = j; i < n; i++) #define FORD(i, j, k) for (i = j; i >= k; i--) #define pb push_back #define mp make_pair #define ff first #define ss second #defi...
[["-", 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
437
#include <iostream> #include <math.h> #include <stdlib.h> #include <string.h> int downint(const void *a, const void *b) { return *(int *)a < *(int *)b ? 1 : *(int *)a > *(int *)b ? -1 : 0; } int main() { int M, N; scanf("%d %d", &N, &M); int A[N]; int SUM = 0; for (int i = 0; i < N; ++i) { scanf("%d", ...
#include <iostream> #include <math.h> #include <stdlib.h> #include <string.h> int downint(const void *a, const void *b) { return *(int *)a < *(int *)b ? 1 : *(int *)a > *(int *)b ? -1 : 0; } int main() { int M, N; scanf("%d %d", &N, &M); int A[N]; int SUM = 0; for (int i = 0; i < N; ++i) { scanf("%d", ...
[["+", 15, 339, 51, 16, 12, 16, 31, 16, 31, 13], ["+", 15, 339, 51, 16, 12, 16, 31, 16, 17, 48]]
1
241
import numpy as np n, m = map(int, input().split()) A = np.array([int(i) for i in input().split()], dtype=int) A -= sum(A) // (4 * m) print('Yes' if np.sum(A > 0) >= m else 'No')
import numpy as np n, m = map(int, input().split()) A = np.array([int(i) for i in input().split()], dtype=int) low = sum(A)/(4*m) print('Yes' if np.sum(A >= low) >= m else 'No')
[["-", 36, 36, 0, 656, 0, 1, 0, 677, 31, 22], ["-", 36, 36, 0, 656, 0, 1, 0, 677, 17, 110], ["+", 36, 36, 0, 656, 0, 1, 0, 662, 31, 22], ["+", 36, 36, 0, 656, 0, 1, 0, 662, 0, 32], ["-", 0, 656, 0, 1, 0, 677, 12, 657, 17, 676], ["+", 0, 656, 0, 1, 0, 662, 12, 657, 17, 85], ["-", 0, 666, 0, 652, 3, 4, 0, 666, 667, 47], ...
5
80
n,m = map(int, input().split()) s = input() t = s.rstrip().split(' ') c = 0 for a in t: c += int(a) d = 0 for a in t: if int(a) >= c: d += 1 if d < m: print('No') else: print('Yes')
n,m = map(int, input().split()) s = input() t = s.rstrip().split(' ') c = 0 for a in t: c += int(a) d = 0 for a in t: if int(a) >= c/4/m : d += 1 if d < m: print('No') else: print('Yes')
[["+", 0, 57, 15, 666, 0, 657, 31, 657, 17, 85], ["+", 0, 57, 15, 666, 0, 657, 31, 657, 12, 612], ["+", 8, 196, 0, 57, 15, 666, 0, 657, 17, 85], ["+", 8, 196, 0, 57, 15, 666, 0, 657, 12, 22]]
5
87
N, M = map(int,input().split()) An = list(map(int,input().split())) S = sum(An) A = [a for a in An if a * 4 * M >= S] if len(A)>=M: print('Yes') else: print('NO')
N, M = map(int,input().split()) An = list(map(int,input().split())) S = sum(An) A = [a for a in An if a * 4 * M >= S] if len(A)>=M: print('Yes') else: print('No')
[["-", 0, 1, 0, 652, 3, 4, 0, 557, 0, 6], ["+", 0, 1, 0, 652, 3, 4, 0, 557, 0, 6]]
5
78
#include <stdio.h> #include <stdlib.h> int cmpfunc(const void *a, const void *b) { if ((*(int *)a - *(int *)b) > 0) { return -1; } if ((*(int *)a - *(int *)b) < 0) { return 1; } if (*(int *)a == *(int *)b) { return 0; } } int main(void) { int n, m, a[100], sum = 0, count = 0; scanf("%d%d", &...
#include <stdio.h> #include <stdlib.h> int cmpfunc(const void *a, const void *b) { if ((*(int *)a - *(int *)b) > 0) { return -1; } if ((*(int *)a - *(int *)b) < 0) { return 1; } if (*(int *)a == *(int *)b) { return 0; } } int main(void) { int n, m, a[100], sum = 0, count = 0; scanf("%d%d", &...
[["-", 0, 30, 0, 14, 8, 9, 0, 43, 39, 40], ["+", 0, 30, 0, 14, 8, 9, 0, 43, 39, 40], ["+", 0, 43, 49, 50, 51, 16, 31, 74, 0, 24], ["+", 49, 50, 51, 16, 31, 74, 39, 77, 39, 40], ["+", 0, 43, 49, 50, 51, 16, 31, 74, 0, 25]]
0
249
[N,M]=list(map(int,input().split())) A=list(map(int,input().split())) print(["No","Yes"][int(len (list(filter(lambda Ai:Ai>sum(A)/4/M,A)))>M-1)])
[N,M]=list(map(int,input().split())) A=list(map(int,input().split())) print(["No","Yes"] [int(len(list(filter(lambda Ai:Ai>=sum(A)/4/M,A)))>M-1)])
[["-", 0, 652, 3, 4, 0, 670, 8, 666, 667, 47], ["+", 0, 652, 3, 4, 0, 670, 8, 666, 667, 20]]
5
83
#include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < (n); ++i) using namespace std; int main() { int n, m; cin >> n >> m; vector<int> a(n); int topVote = 0, allVote = 0; int input; rep(i, n) { cin >> input; a.push_back(input); allVote += input; } sort(a.begin(), a.end(), greater<i...
#include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < (n); ++i) using namespace std; int main() { int n, m; cin >> n >> m; vector<int> a(n); int topVote = 0, allVote = 0; int input; rep(i, n) { cin >> input; a.push_back(input); allVote += input; } sort(a.begin(), a.end(), greater<i...
[["-", 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
149
N,M=map(int,input().split()) A=list(map(int,input().split())) G=sum(A)/(4*M) A.sort() A.reverse() m=0 i=0 while A[i]>G: m+=1 if m==M: print("Yes") exit() i+=1 print("No")
N,M=map(int,input().split()) A=list(map(int,input().split())) G=sum(A)/(4*M) A.sort() A.reverse() m=0 i=0 while A[i]>=G: m+=1 if m==M: print("Yes") exit() i+=1 print("No")
[["-", 36, 36, 0, 656, 0, 52, 15, 666, 667, 47], ["+", 36, 36, 0, 656, 0, 52, 15, 666, 667, 20]]
5
95
#include <algorithm> #include <iostream> using namespace std; int n, m; int a[105]; int main() { cin >> n >> m; int sum = 0; for (int i = 1; i <= n; i++) { cin >> a[i]; sum += a[i]; } int cnt = 0; for (int i = 1; i <= n; i++) { if (a[i] >= sum / m / 4) cnt++; } if (cnt >= m) cout ...
#include <algorithm> #include <iostream> using namespace std; int n, m; int a[105]; int main() { cin >> n >> m; double sum = 0; for (int i = 1; i <= n; i++) { cin >> a[i]; sum += a[i]; } int cnt = 0; for (int i = 1; i <= n; i++) { if (a[i] >= sum / m / 4) cnt++; } if (cnt >= m) co...
[["-", 0, 30, 0, 14, 8, 9, 0, 43, 39, 40], ["+", 0, 30, 0, 14, 8, 9, 0, 43, 39, 40]]
1
129
#import numpy as np import math def solve(): tv = sum(a) min_votes = math.ceil(tv * 1/4 * m) cnt = 0 for ai in a: if ai>=min_votes: cnt+=1 if cnt>=m: print("Yes") else: print("No") return #s = input() n, m = [int(i) for i in input().split(" ")] a = [i...
#import numpy as np import math def solve(): tv = sum(a) min_votes = math.ceil(tv * 1/4 / m) cnt = 0 for ai in a: if ai>=min_votes: cnt+=1 if cnt>=m: print("Yes") else: print("No") return #s = input() n, m = [int(i) for i in input().split(" ")] a = [i...
[["-", 0, 662, 12, 652, 3, 4, 0, 657, 17, 48], ["+", 0, 662, 12, 652, 3, 4, 0, 657, 17, 85]]
5
112
#include <bits/stdc++.h> using namespace std; #define ll long long int int main() { int n, cnt = 0, sum = 0, x; float m; cin >> n >> m; vector<int> a; for (int i = 0; i < n; i++) { cin >> x; a.push_back(x); sum += x; } // float v = (1/(4*m))*sum; for (int i = 0; i < n; i++) { if (a[i] >...
#include <bits/stdc++.h> using namespace std; #define ll long long int int main() { int n, cnt = 0, sum = 0, x; float m; cin >> n >> m; vector<int> a; for (int i = 0; i < n; i++) { cin >> x; a.push_back(x); sum += x; } // float v = (1/(4*m))*sum; for (int i = 0; i < n; i++) { if (a[i] >...
[["-", 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
136
#include <bits/stdc++.h> using namespace std; int main() { int N, M; cin >> N >> M; vector<int> A(N); int count = 0; for (int i = 0; i < N; i++) { cin >> A.at(i); count += A.at(i); } sort(A.begin(), A.end()); reverse(A.begin(), A.end()); bool ans = true; for (int i = 0; i < M; i++) { if...
#include <bits/stdc++.h> using namespace std; int main() { int N, M; cin >> N >> M; vector<int> A(N); int count = 0; for (int i = 0; i < N; i++) { cin >> A.at(i); count += A.at(i); } sort(A.begin(), A.end()); reverse(A.begin(), A.end()); bool ans = true; for (int i = 0; i < M; i++) { if...
[["-", 0, 1, 0, 16, 31, 16, 12, 5, 0, 6], ["+", 0, 1, 0, 16, 31, 16, 12, 5, 0, 6]]
1
172
#include <bits/stdc++.h> using namespace std; #define ll long long #define fast \ ios_base::sync_with_stdio(false); \ cin.tie(NULL); \ cout.ti...
#include <bits/stdc++.h> using namespace std; #define ll long long #define fast \ ios_base::sync_with_stdio(false); \ cin.tie(NULL); \ cout.ti...
[["-", 8, 9, 0, 52, 8, 9, 0, 43, 39, 78], ["+", 8, 9, 0, 52, 8, 9, 0, 43, 39, 40], ["-", 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, 31, 74, 51, 23, 0, 24], ["-", 31, 74, 51, 23, 0, 16, 12, 23, 0, 25]]
1
196
#include <algorithm> #include <array> #include <iostream> int main() { int m, n; std::cin >> n >> m; std::array<int, 100> a = {0}; for (int i = 0; i < n; ++i) std::cin >> a[i]; std::sort(a.begin(), a.end(), std::greater<int>()); int sum = 0; for (int i = 0; i < n; ++i) sum += a[i]; std::cou...
#include <algorithm> #include <array> #include <iostream> int main() { int m, n; std::cin >> n >> m; std::array<int, 100> a = {0}; for (int i = 0; i < n; ++i) std::cin >> a[i]; std::sort(a.begin(), a.end(), std::greater<int>()); int sum = 0; for (int i = 0; i < n; ++i) sum += a[i]; std::cou...
[["+", 31, 16, 31, 69, 341, 342, 0, 16, 17, 33], ["+", 31, 16, 31, 69, 341, 342, 0, 16, 12, 13]]
1
146
#include <bits/stdc++.h> #define PI 3.14159265359 #define INF 1e9 #define LINF 1e18 #define IMOD 1000000007 #define irep(i, n) for (int i = 0; i < n; i++) #define irep2(i, a, n) for (int i = (a); i <= (int)(n); i++) #define lrep(i, n) for (long long i = 0; i < (long long)(n); i++) #define lrep2(i, a, n) for (long long...
#include <bits/stdc++.h> #define PI 3.14159265359 #define INF 1e9 #define LINF 1e18 #define IMOD 1000000007 #define irep(i, n) for (int i = 0; i < n; i++) #define irep2(i, a, n) for (int i = (a); i <= (int)(n); i++) #define lrep(i, n) for (long long i = 0; i < (long long)(n); i++) #define lrep2(i, a, n) for (long long...
[["-", 64, 9, 0, 57, 15, 339, 51, 16, 17, 18], ["+", 64, 9, 0, 57, 15, 339, 51, 16, 17, 19]]
1
397
import java.util.Arrays; import java.util.Collections; 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 sum = 0; Integer[] arr = new Integer[N]; for (int i = 0; i < N; i...
import java.util.Arrays; import java.util.Collections; import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int N = sc.nextInt(); int M = sc.nextInt(); float sum = 0; Integer[] arr = new Integer[N]; for (int i = 0; i < N;...
[["-", 0, 195, 8, 196, 0, 503, 39, 506, 0, 507], ["+", 0, 195, 8, 196, 0, 503, 39, 511, 0, 531], ["+", 8, 498, 0, 195, 8, 196, 0, 503, 39, 78]]
3
216
#include <algorithm> #include <cmath> #include <iostream> #include <string> #include <vector> using namespace std; int main() { int n, m, t = 0; cin >> n >> m; vector<int> v(n); for (int i = 0; i < n; ++i) { cin >> v[i]; t += v[i]; } sort(v.rbegin(), v.rend()); cout << (v[m - 1] < t / (4 * m) ? "...
#include <algorithm> #include <cmath> #include <iostream> #include <string> #include <vector> using namespace std; int main() { int n, m, t = 0; cin >> n >> m; vector<int> v(n); for (int i = 0; i < n; ++i) { cin >> v[i]; t += v[i]; } sort(v.rbegin(), v.rend()); cout << (v[m - 1] < float(t) / (4 *...
[["+", 0, 41, 15, 16, 12, 16, 31, 2, 63, 40], ["+", 15, 16, 12, 16, 31, 2, 3, 4, 0, 24], ["+", 15, 16, 12, 16, 31, 2, 3, 4, 0, 25]]
1
116
import java.util.Scanner; public class Main { public static void main(String[] args) { // TODO Auto-generated method stub Scanner kb = new Scanner(System.in); int n = kb.nextInt(); int m = kb.nextInt(); int p = m; int[] a = new int[n]; int count = 0; for (int i = 0; i < n; i++) { ...
import java.util.Scanner; public class Main { public static void main(String[] args) { // TODO Auto-generated method stub Scanner kb = new Scanner(System.in); int n = kb.nextInt(); int m = kb.nextInt(); int p = m; int[] a = new int[n]; int count = 0; for (int i = 0; i < n; i++) { ...
[["-", 0, 16, 31, 16, 12, 23, 0, 16, 31, 499], ["+", 0, 16, 31, 16, 12, 23, 0, 16, 31, 515]]
3
177
#include <bits/stdc++.h> using namespace std; int main() { int N, M; cin >> N >> M; int sum = 0; vector<int> vec(N); for (int i = 0; i < N; i++) { cin >> vec[i]; sum += vec[i]; } int a = 0; for (int i = 0; i < N; i++) { if (vec[i] >= sum / (4 * M)) { a++; } } if (a >= M) c...
#include <bits/stdc++.h> using namespace std; int main() { double N, M; cin >> N >> M; int sum = 0; vector<double> vec(N); for (int i = 0; i < N; i++) { cin >> vec[i]; sum += vec[i]; } int a = 0; for (int i = 0; i < N; i++) { if (vec[i] >= sum / (4 * M)) { a++; } } if (a >= 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
131
#include <iostream> using namespace std; int main(void) { float n, m; cin >> n >> m; int a[100]; float sum = 0; int b = 0; for (int i = 0; i < n; i++) { cin >> a[i]; sum += a[i]; } for (int i = 0; i < n; i++) { if (a[i] > sum / 4 / m) { b++; } } if (b >= m) cout << "Yes" <<...
#include <iostream> using namespace std; int main(void) { float n, m; cin >> n >> m; int a[100]; float sum = 0; int b = 0; for (int i = 0; i < n; i++) { cin >> a[i]; sum += a[i]; } for (int i = 0; i < n; i++) { if (a[i] >= sum / 4 / m) { b++; } } if (b >= m) cout << "Yes" <...
[["-", 8, 9, 0, 57, 15, 339, 51, 16, 17, 47], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 17, 20]]
1
127
import numpy as np N, M = map(int, input().split()) A = list(map(int, input().split())) min_ = sum(A) / (4*M) item = sum(x>min_ for x in A) print("Yes" if item>= M else "No")
import numpy as np N, M = map(int, input().split()) A = list(map(int, input().split())) min_ = sum(A) / (4*M) item = sum(x>=min_ for x in A) print("Yes" if item>= M else "No")
[["-", 0, 662, 12, 652, 3, 668, 8, 666, 667, 47], ["+", 0, 662, 12, 652, 3, 668, 8, 666, 667, 20]]
5
75
N, M = map(int, input().split()) *A, = map(int, input().split()) ans = 'No' count = 0 s = sum(A) for a in A: if 4 * a * M > s: count += 1 if count >= M: ans = 'Yes' break print(ans)
N, M = map(int, input().split()) *A, = map(int, input().split()) ans = 'No' count = 0 s = sum(A) for a in A: if 4 * a * M >= s: count += 1 if count >= M: ans = 'Yes' break print(ans)
[["-", 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())) A.sort() A.reverse() for i in range(M): if A[i] < sum(A) // (4 * M): print('No') exit(0) else: continue print('Yes')
N, M = map(int, input().split()) *A, = list(map(int, input().split())) A.sort() A.reverse() for i in range(M): if A[i] < sum(A) / (4 * M): print('No') exit(0) else: continue print('Yes')
[["-", 8, 196, 0, 57, 15, 666, 0, 657, 17, 676], ["+", 8, 196, 0, 57, 15, 666, 0, 657, 17, 85]]
5
89
#include <iostream> #include <vector> using namespace std; int main() { int n, m; vector<int> a; int ak; cin >> n >> m; int cnt = 0, sum = 0; for (int i = 0; i < n; i++) { cin >> ak; a.push_back(ak); sum += ak; } for (int i = 0; i < n; i++) { if (a[i] >= sum / (4 * m)) { cnt++; ...
#include <iostream> #include <vector> using namespace std; int main() { int n, m; vector<int> a; int ak; cin >> n >> m; int cnt = 0; double sum = 0; for (int i = 0; i < n; i++) { cin >> ak; a.push_back(ak); sum += ak; } // cout << sum/(4*m) << endl; for (int i = 0; i < n; i++) { if (...
[["-", 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, 74, 0, 24], ["+", 51, 16, 12, 16, 12, 74, 39, 77, 39, 40], ["+", 15, 339, 51, 16, 12, 16, 12, 74, 0, 25]]
1
140
#include <bits/stdc++.h> #include <bitset> using namespace std; #define ll long long #define ld long double #define MOD 1000000007 #define mod9 1000000009 #define mod 1000003 #define fast \ ios_base ::sync_with_stdio(0); ...
#include <bits/stdc++.h> #include <bitset> using namespace std; #define ll long long #define ld long double #define MOD 1000000007 #define mod9 1000000009 #define mod 1000003 #define fast \ ios_base ::sync_with_stdio(0); ...
[["-", 0, 30, 0, 14, 8, 9, 0, 43, 39, 78], ["+", 0, 30, 0, 14, 8, 9, 0, 43, 39, 40], ["+", 49, 50, 51, 23, 0, 16, 31, 16, 31, 13], ["+", 49, 50, 51, 23, 0, 16, 31, 16, 17, 48]]
1
923
#include <bits/stdc++.h> using namespace std; int main() { int N, M, sum_a, count; cin >> N >> M; vector<int> vec(N); sum_a = 0; count = 0; for (int i = 0; i < N; i++) { int a; cin >> a; vec.at(i) = a; sum_a += a; } double W = (double)sum_a / (4 * M); for (int x : vec) { if (x >...
#include <bits/stdc++.h> using namespace std; int main() { int N, M, sum_a, count; cin >> N >> M; vector<int> vec(N); sum_a = 0; count = 0; for (int i = 0; i < N; i++) { int a; cin >> a; vec.at(i) = a; sum_a += a; } double W = (double)sum_a / (4 * M); for (int x : vec) { if (x >...
[["-", 8, 9, 0, 57, 15, 339, 51, 16, 17, 47], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 17, 20]]
1
146
#include <algorithm> #include <iostream> #include <numeric> #include <vector> 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; int a = 0; rep(i, n) { cin >> a; A.push_back(a); } sort(A.begin(), A.end(), greater<int>())...
#include <algorithm> #include <iostream> #include <numeric> #include <vector> using namespace std; #define rep(i, n) for (int i = 0; i < (int)(n); i++) int main() { float n, m; cin >> n >> m; vector<float> A; float a = 0; rep(i, n) { cin >> a; A.push_back(a); } sort(A.begin(), A.end(), greater<f...
[["-", 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
138
N,M=list(map(int,input().split())) A=list(map(int,input().split())) sum=sum(A) check=0 for a in A: if a>=sum/(4*M): check+=1 if check>=M: print("Yes") else: print("")
N,M=list(map(int,input().split())) A=list(map(int,input().split())) sum=sum(A) check=0 for a in A: if a>=sum/(4*M): check+=1 if check>=M: print("Yes") else: print("No")
[["+", 0, 1, 0, 652, 3, 4, 0, 557, 0, 6]]
5
82
x = input().split(" ") a = input().split(" ") n = int(x[0]) m = int(x[1]) sum = 0 counter = 0 for i in a: sum += int(i) bunsu = sum / 4 / m for i in a: if float(i) > bunsu: if counter <= m: counter += 1 if counter >= m: print("Yes") else: print("No")
x = input().split(" ") a = input().split(" ") n = int(x[0]) m = int(x[1]) sum = 0 counter = 0 for i in a: sum += int(i) bunsu = sum / 4 / m for i in a: if float(i) >= bunsu: if counter <= m: 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
106
import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner scanner = new Scanner(System.in); int n = scanner.nextInt(); int m = scanner.nextInt(); int sum = 0; int vote = 0; int[] a = new int[n]; for (int i = 0; i < n; i++) { a[i] = scanner.nextInt...
import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner scanner = new Scanner(System.in); int n = scanner.nextInt(); int m = scanner.nextInt(); int sum = 0; int vote = 0; int[] a = new int[n]; for (int i = 0; i < n; i++) { a[i] = scanner.nextInt...
[["+", 15, 15, 0, 16, 12, 16, 31, 74, 0, 24], ["+", 0, 16, 12, 16, 31, 74, 39, 511, 0, 512], ["+", 15, 15, 0, 16, 12, 16, 31, 74, 0, 25]]
3
179
#include <stdio.h> #include <stdlib.h> int compare_int(const void *a, const void *b) { return *(int *)b - *(int *)a; } int main() { int n, m, a[102] = {0}, i, sum = 0; scanf("%d %d", &n, &m); for (i = 0; i < n; i++) { scanf("%d", &a[i]); sum += a[i]; } qsort(a, n, sizeof(int), compare_int); sum =...
#include <stdio.h> #include <stdlib.h> int compare_int(const void *a, const void *b) { return *(int *)b - *(int *)a; } int main() { int n, m, a[103] = {0}, i; double sum = 0.00; scanf("%d %d", &n, &m); for (i = 0; i < n; i++) { scanf("%d", &a[i]); sum += a[i]; } qsort(a, n, sizeof(int), compare_in...
[["-", 8, 9, 0, 43, 49, 50, 49, 80, 81, 13], ["+", 8, 9, 0, 43, 49, 50, 49, 80, 81, 13], ["-", 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, 14, 8, 9, 0, 43, 49, 50, 51, 13], ["+", 0, 14, 8, 9, 0, 43, 49, 50, 51, 13]]
0
165
#include "bits/stdc++.h" using namespace std; #define rep(i, n) for (int i = 0; i < n; i++) #define rep2(i, l, r) for (int i = (l); i < (r); i++) #define ALL(x) (x).begin(), (x).end() //昇順 #define RALL(x) (x).rbegin(), (x).rend() // 降順 const long long mod = 1e9 + 7; typedef long long ll; // ll とdoubleは違う typedef pri...
#include "bits/stdc++.h" using namespace std; #define rep(i, n) for (int i = 0; i < n; i++) #define rep2(i, l, r) for (int i = (l); i < (r); i++) #define ALL(x) (x).begin(), (x).end() //昇順 #define RALL(x) (x).rbegin(), (x).rend() // 降順 const long long mod = 1e9 + 7; typedef long long ll; // ll とdoubleは違う typedef pri...
[["+", 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
467
/* Miles Morales : When will I know I'm ready? Peter B. Parker : You won't. It's a leap of faith. That's all it is, Miles. A leap of faith. */ // KEEP IT SIMPLE STUPID /*#pragma GCC optimize ("O3") #pragma GCC target ("avx") #pragma GCC optimize("Ofast") #pragma GCC optimize ("unroll-loops") #pragma GCC target("sse,sse...
/* Miles Morales : When will I know I'm ready? Peter B. Parker : You won't. It's a leap of faith. That's all it is, Miles. A leap of faith. */ // KEEP IT SIMPLE STUPID /*#pragma GCC optimize ("O3") #pragma GCC target ("avx") #pragma GCC optimize("Ofast") #pragma GCC optimize ("unroll-loops") #pragma GCC target("sse,sse...
[["-", 0, 14, 8, 9, 0, 7, 15, 16, 17, 47], ["+", 0, 14, 8, 9, 0, 7, 15, 16, 17, 20]]
1
223
#include <iostream> #include <vector> using namespace std; int main() { int N, M, ave = 0, cnt = 0; cin >> N >> M; vector<int> A(N); for (int i = 0; i < N; i++) { cin >> A[i]; ave += A[i]; } ave /= 4 * M; for (int i = 0; i < N; i++) { if (A[i] >= ave) { cnt++; } } if (cnt >= M) {...
#include <iostream> #include <vector> using namespace std; int main() { int N, M, cnt = 0; float ave = 0; cin >> N >> M; vector<int> A(N); for (int i = 0; i < N; i++) { cin >> A[i]; ave += A[i]; } ave /= 4 * M; for (int i = 0; i < N; i++) { if (A[i] >= ave) { cnt++; } } if (cnt...
[["-", 0, 14, 8, 9, 0, 43, 49, 50, 49, 22], ["+", 0, 14, 8, 9, 0, 43, 49, 50, 49, 22], ["-", 0, 30, 0, 14, 8, 9, 0, 43, 0, 21], ["+", 0, 30, 0, 14, 8, 9, 0, 43, 0, 35], ["+", 0, 30, 0, 14, 8, 9, 0, 43, 39, 40]]
1
131
N, M = map(int, input().split()) A = list(map(int, input().split())) F = 0 trigger = 1 / (4 * M) for i in range(len(A)): if A[i]/sum(A) < trigger: F = F + 1 if F < M: print('Yes') else: print('No')
N, M = map(int, input().split()) A = list(map(int, input().split())) F = 0 trigger = 1 / (4 * M) for i in range(len(A)): if A[i]/sum(A) < trigger: F = F + 1 if N - F >= M: print('Yes') else: print('No')
[["+", 0, 656, 0, 57, 15, 666, 0, 657, 31, 22], ["+", 0, 656, 0, 57, 15, 666, 0, 657, 17, 33], ["-", 36, 36, 0, 656, 0, 57, 15, 666, 667, 18], ["+", 36, 36, 0, 656, 0, 57, 15, 666, 667, 20]]
5
93
N, M = map(int, input().split()) A = list(map(int, input().split())) F = 0 trigger = 1 / (4 * M) for i in range(len(A)): if A[i]/sum(A) > trigger: F = F + 1 if F >= M: print('Yes') else: print('No')
N, M = map(int, input().split()) A = list(map(int, input().split())) F = 0 trigger = 1 / (4 * M) for i in range(len(A)): if A[i]/sum(A) >= trigger: F = F + 1 if F >= 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
93
#include <bits/stdc++.h> using namespace std; typedef long long ll; const int MOD = (int)1e9 + 7; const double PI = 3.14159265359; int main() { ios_base::sync_with_stdio(false); cin.tie(NULL); int t; // ctrl + /cin>>t; t = 1; while (t--) { int n, m; cin >> n >> m; ll sum = 0; vector<int> a(...
#include <bits/stdc++.h> using namespace std; typedef long long ll; const int MOD = (int)1e9 + 7; const double PI = 3.14159265359; int main() { ios_base::sync_with_stdio(false); cin.tie(NULL); int t; // ctrl + /cin>>t; t = 1; while (t--) { int n, m; cin >> n >> m; ll sum = 0; vector<int> a(...
[["-", 0, 57, 64, 1, 0, 16, 12, 5, 0, 6], ["+", 0, 57, 64, 1, 0, 16, 12, 5, 0, 6], ["-", 75, 76, 0, 1, 0, 16, 12, 5, 0, 6], ["+", 75, 76, 0, 1, 0, 16, 12, 5, 0, 6]]
1
179
#include <bits/stdc++.h> using namespace std; int main() { int N, M, sum = 0; cin >> N >> M; vector<int> vo(N); for (int i = 0; i, N; i++) { cin >> vo.at(i); sum += vo.at(i); } sort(vo.begin(), vo.end(), greater<int>()); cout << ((vo.at(M - 1) >= (sum + 4 * M - 1) / (4 * M)) ? "Yes" : "No") ...
#include <bits/stdc++.h> using namespace std; int main() { int N, M, sum = 0; cin >> N >> M; vector<int> vo(N); for (int i = 0; i < N; i++) { cin >> vo.at(i); sum += vo.at(i); } sort(vo.begin(), vo.end(), greater<int>()); cout << ((vo.at(M - 1) >= (sum + 4 * M - 1) / (4 * M)) ? "Yes" : "No") ...
[["-", 0, 14, 8, 9, 0, 7, 15, 34, 0, 21], ["+", 0, 14, 8, 9, 0, 7, 15, 16, 17, 18]]
1
133
#include <bits/stdc++.h> using namespace std; int main() { int n, m; cin >> n >> m; int ar[n]; int total_votes = 0; for (int i = 0; i < n; i++) { cin >> ar[i]; total_votes = total_votes + ar[i]; } int cnbeselected = 0; for (int i = 0; i < n; i++) { if (ar[i] > static_cast<double>(total_votes...
#include <bits/stdc++.h> using namespace std; int main() { int n, m; cin >> n >> m; int ar[n]; int total_votes = 0; for (int i = 0; i < n; i++) { cin >> ar[i]; total_votes = total_votes + ar[i]; } int cnbeselected = 0; for (int i = 0; i < n; i++) { if (ar[i] >= static_cast<double>(total_vote...
[["-", 8, 9, 0, 57, 15, 339, 51, 16, 17, 47], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 17, 20], ["+", 51, 16, 12, 16, 31, 2, 3, 4, 0, 25], ["-", 12, 2, 3, 4, 0, 16, 12, 23, 0, 25]]
1
132
import java.util.*; public class Main { public static void main(String[] ages) { Scanner sc = new Scanner(System.in); int n = sc.nextInt(); int m = sc.nextInt(); int sum = 0; int count = 0; int[] a = new int[n]; for (int i = 0; i < n; i++) { a[i] = sc.nextInt(); sum += a[i]; ...
import java.util.*; public class Main { public static void main(String[] ages) { Scanner sc = new Scanner(System.in); int n = sc.nextInt(); int m = sc.nextInt(); double sum = 0; int count = 0; int[] a = new int[n]; for (int i = 0; i < n; i++) { a[i] = sc.nextInt(); sum += a[i];...
[["-", 0, 195, 8, 196, 0, 503, 39, 506, 0, 507], ["+", 0, 195, 8, 196, 0, 503, 39, 511, 0, 512]]
3
177
from sys import stdin n,m = map(int,input().split()) sen = list(map(int,input().split())) count = 0 al = 0 for i in sen: al += i for i in sen: if i > al/(4*m): count += 1 if count >= m: print("Yes") else: print("No")
from sys import stdin n,m = map(int,input().split()) sen = list(map(int,input().split())) count = 0 al = 0 for i in sen: al += i for i in sen: if i >= al/(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
89
n=[int(i) for i in input().split()] m=[int(j) for j in input().split()] a=sum(m)*1/(4*n[1]) l=[] for k in m: if k>=a: l.append(k) if len(l)>n[1]: print("Yes") else: print("No")
n=[int(i) for i in input().split()] m=[int(j) for j in input().split()] a=sum(m)*1/(4*n[1]) l=[] for k in m: if k>=a: l.append(k) if len(l)>=n[1]: 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
98
N,M=(int(x) for x in input().split()) a=list(map(int, input().split())) b=0 c=0 for i in range(N-1): b+=a[i] for i in range(N-1): if(a[i]>=b/(4*M)):c+=1 if(c>=M):print('Yes') else:print('No')
N,M=(int(x) for x in input().split()) a=list(map(int, input().split())) b=0 c=0 for i in range(N): b+=a[i] #print(i) for i in range(N): if(a[i]>=b/(4*M)):c+=1 #print(i) if(c>=M):print('Yes') else:print('No')
[["-", 0, 7, 12, 652, 3, 4, 0, 657, 17, 33], ["-", 0, 7, 12, 652, 3, 4, 0, 657, 12, 612]]
5
109
#include <iostream> #include <vector> using namespace std; int main(void) { // Your code here! int N, M; cin >> N >> M; vector<int> vote; int sum = 0; for (int i = 0; i < N; i++) { int tmp; cin >> tmp; vote.push_back(tmp); sum += tmp; } int cnt = 0; for (int i = 0; i < N; i++) { i...
#include <iostream> #include <vector> using namespace std; int main(void) { // Your code here! int N, M; cin >> N >> M; vector<int> vote; int sum = 0; for (int i = 0; i < N; i++) { int tmp; cin >> tmp; vote.push_back(tmp); sum += tmp; } int cnt = 0; for (int i = 0; i < N; i++) { i...
[["-", 8, 9, 0, 57, 15, 339, 51, 16, 17, 47], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 17, 20]]
1
152
N,M = map(int,input().split()) a = input().split() for i in a: if int(i) >= sum(map(int,a))* 1/(4*M): ans+=1 if ans >= M: print("Yes") else: print("No")
N,M = map(int,input().split()) a = input().split() ans =0 for i in a: if int(i) >= sum(map(int,a))* 1/(4*M): ans+=1 if ans >= M: print("Yes") else: print("No")
[["+", 36, 36, 0, 656, 0, 1, 0, 662, 31, 22], ["+", 36, 36, 0, 656, 0, 1, 0, 662, 0, 32], ["+", 36, 36, 0, 656, 0, 1, 0, 662, 12, 612]]
5
76
n , m = map(int , input().split()) a = input().split() print(a) ans = 0 for i in a: if int(i) >= sum(map(int , a)) * 1/(4*m): ans += 1 if ans >= m: print("Yes") else: print("No")
n , m = map(int , input().split()) a = input().split() ans = 0 for i in a: if int(i) >= sum(map(int , a)) * 1/(4*m): ans += 1 if ans >= 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
83
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 t = 0; double[] arr = new double[n]; for (int i = 0; i < n; i++) { arr[i] = sc.nextDouble(); t += arr[i]; ...
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(); double t = 0; double[] arr = new double[n]; for (int i = 0; i < n; i++) { arr[i] = sc.nextDouble(); t += arr[i];...
[["-", 0, 195, 8, 196, 0, 503, 39, 506, 0, 507], ["+", 0, 195, 8, 196, 0, 503, 39, 511, 0, 512]]
3
168
#include <stdio.h> int main(void) { int m, m2, n, i; int count = 0, sum = 0; int a[2000]; scanf("%d", &n); scanf("%d", &m); for (i = 0; i < n; i++) { scanf("%d", &a[i]); sum += a[i]; } m2 = m * 4; sum = sum / m2; for (i = 0; i < n; i++) { if (a[i] >= sum) count += 1; } if (...
#include <stdio.h> int main(void) { int m, m2, n, i; int count = 0; float sum = 0; int a[2000]; scanf("%d", &n); scanf("%d", &m); for (i = 0; i < n; i++) { scanf("%d", &a[i]); sum += a[i]; } m2 = m * 4; sum = float(sum / m2); for (i = 0; i < n; i++) { if (a[i] >= sum) count +...
[["-", 0, 30, 0, 14, 8, 9, 0, 43, 0, 21], ["+", 0, 30, 0, 14, 8, 9, 0, 43, 0, 35], ["+", 0, 30, 0, 14, 8, 9, 0, 43, 39, 40], ["+", 8, 9, 0, 1, 0, 11, 12, 2, 63, 40], ["+", 0, 1, 0, 11, 12, 2, 3, 4, 0, 24], ["+", 0, 1, 0, 11, 12, 2, 3, 4, 0, 25]]
1
152
n, m = map(int, input().split()) a = list(map(int, input().split())) a.sort(reverse = True) print('Yes' if a[m-1] >= 1/4/m else 'No')
n, m = map(int, input().split()) a = list(map(int, input().split())) a.sort(reverse = True) print('Yes' if a[m-1] >= sum(a)/4/m else 'No')
[["-", 0, 41, 0, 666, 0, 657, 31, 657, 31, 612], ["+", 0, 666, 0, 657, 31, 657, 31, 652, 63, 22], ["+", 0, 657, 31, 657, 31, 652, 3, 4, 0, 24], ["+", 0, 657, 31, 657, 31, 652, 3, 4, 0, 22], ["+", 0, 657, 31, 657, 31, 652, 3, 4, 0, 25]]
5
64
#include <algorithm> #include <iostream> #include <vector> #define NUM 100; using namespace std; int main() { bool ans = 1; long long n, m; long long sum = 0; cin >> n >> m; vector<long long> a(n); for (int i = 0; i < n; i++) { cin >> a.at(i); sum += a.at(i); } sum /= 4 * m; /**/ sort(a.beg...
#include <algorithm> #include <iostream> #include <vector> #define NUM 100; using namespace std; int main() { bool ans = 1; long long n, m; double sum = 0; cin >> n >> m; vector<long long> a(n); for (int i = 0; i < n; i++) { cin >> a.at(i); sum += a.at(i); } sum /= 4 * m; /**/ sort(a.begin(...
[["-", 0, 14, 8, 9, 0, 43, 39, 86, 0, 96], ["+", 0, 30, 0, 14, 8, 9, 0, 43, 39, 40]]
1
155
#include <algorithm> #include <iostream> #include <string> #include <vector> using namespace std; int main() { 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]; } sort(a.begin(), a.end()); reverse(a.begin(), a.end()); if (4 * m * a...
#include <algorithm> #include <iostream> #include <string> #include <vector> using namespace std; int main() { 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]; } sort(a.begin(), a.end()); reverse(a.begin(), a.end()); if (4 * m * a...
[["-", 0, 57, 15, 339, 51, 16, 31, 16, 17, 48], ["-", 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
137
NM = list(map(int, input().split())) A = list(map(int, input().split())) count = 0 sumA = sum(A) board = sumA // (4*NM[1]) # print(sumA) # print(board) for i in range(len(A)): if A[i] >= board: count += 1 else: continue if count > NM[1]: print("Yes") else: print("No")
NM = list(map(int, input().split())) A = list(map(int, input().split())) count = 0 sumA = sum(A) board = sumA / (4*NM[1]) # print(sumA) # print(board) for i in range(len(A)): if float(A[i]) >= board: count += 1 else: continue if count >= NM[1]: print("Yes") else: print("No")
[["-", 0, 656, 0, 1, 0, 662, 12, 657, 17, 676], ["+", 0, 656, 0, 1, 0, 662, 12, 657, 17, 85], ["+", 8, 196, 0, 57, 15, 666, 0, 652, 63, 22], ["+", 0, 57, 15, 666, 0, 652, 3, 4, 0, 24], ["+", 0, 57, 15, 666, 0, 652, 3, 4, 0, 25], ["-", 36, 36, 0, 656, 0, 57, 15, 666, 667, 47], ["+", 36, 36, 0, 656, 0, 57, 15, 666, 667, ...
5
104
N,M = map(int,input().split()) A = list(map(int,input().split())) S = sum(A) cnt = 0 for a in A: if a<=S/(4*M): cnt += 1 print("Yes" if cnt>=M else "No")
N,M = map(int,input().split()) A = list(map(int,input().split())) S = sum(A) cnt = 0 for a in A: if a>=S/(4*M): cnt += 1 print("Yes" if cnt>=M else "No")
[["-", 0, 7, 8, 196, 0, 57, 15, 666, 667, 19], ["+", 0, 7, 8, 196, 0, 57, 15, 666, 667, 20]]
5
75
#include <algorithm> #include <bits/stdc++.h> #include <iostream> #include <math.h> #include <string> #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.rbegin(), a.rend()); int sum = 0; for (int i = 0; i < n; ...
#include <algorithm> #include <bits/stdc++.h> #include <iostream> #include <math.h> #include <string> #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.rbegin(), a.rend()); double sum = 0; for (int i = 0; i < ...
[["-", 0, 30, 0, 14, 8, 9, 0, 43, 39, 40], ["+", 0, 30, 0, 14, 8, 9, 0, 43, 39, 40]]
1
138
#include <bits/stdc++.h> using namespace std; typedef long long ll; typedef pair<int, int> pi; #define rep(i, n) for (int i = 0; i < n; i++) #define rep_op(i, a, n) for (int i = a; i < n; i++) #define rep_d(j, n) for (int j = n; j >= 0; j--) #define rep_d_op(j, n, a) for (int j = n; j >= a; j--) template <class T> i...
#include <bits/stdc++.h> using namespace std; typedef long long ll; typedef pair<int, int> pi; #define rep(i, n) for (int i = 0; i < n; i++) #define rep_op(i, a, n) for (int i = a; i < n; i++) #define rep_d(j, n) for (int j = n; j >= 0; j--) #define rep_d_op(j, n, a) for (int j = n; j >= a; j--) template <class T> i...
[["-", 0, 30, 0, 14, 8, 9, 0, 43, 39, 40], ["+", 0, 30, 0, 14, 8, 9, 0, 43, 39, 40]]
1
374
#include <bits/stdc++.h> #define forn(i, b) for (int i = 0; i < b; i++) #define for1(i, b) for (int i = 1; i <= b; i++) #define reps(i, a, b) for (int i = a; i < b.length(); i++) typedef long long ll; #define MOD 1000000007 using namespace std; int main() { int n, m, val = 0, total = 0, qot = 0; int tab[1001]; ...
#include <bits/stdc++.h> #define forn(i, b) for (int i = 0; i < b; i++) #define for1(i, b) for (int i = 1; i <= b; i++) #define reps(i, a, b) for (int i = a; i < b.length(); i++) typedef long long ll; #define MOD 1000000007 using namespace std; int main() { float n, m, val = 0, total = 0, qot = 0; float tab[1001]...
[["-", 0, 30, 0, 14, 8, 9, 0, 43, 39, 40], ["+", 0, 30, 0, 14, 8, 9, 0, 43, 39, 40]]
1
165
#include <bits/stdc++.h> #define rep(i, c) for (int i = 0; i < (int)c; i++) using namespace std; int main() { int N, M; cin >> N >> M; vector<int> data(N); int sum = 0; rep(i, N) { cin >> data.at(i); sum += data.at(i); } sort(data.begin(), data.end()); int cnt = 0; double tmp = (double)sum / (...
#include <bits/stdc++.h> #define rep(i, c) for (int i = 0; i < (int)c; i++) using namespace std; int main() { int N, M; cin >> N >> M; vector<int> data(N); int sum = 0; rep(i, N) { cin >> data.at(i); sum += data.at(i); } sort(data.begin(), data.end()); int cnt = 0; double tmp = (double)sum / (...
[["-", 8, 9, 0, 57, 15, 339, 51, 16, 17, 47], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 17, 20]]
1
158
#include <bits/stdc++.h> #define all(x) (x).begin(), (x).end() #define rall(x) (x).rbegin(), (x).rend() #define sz(x) (int)((x).size()) #define debug(x) cout << #x << ":" << x << ' '; #define debugg(x) cout << #x << ":" << x << ' ' << "\n"; #define endl "\n" #define L(X) ((X) << 1) #define R(X) (((X) << 1) | 1) #define...
#include <bits/stdc++.h> #define all(x) (x).begin(), (x).end() #define rall(x) (x).rbegin(), (x).rend() #define sz(x) (int)((x).size()) #define debug(x) cout << #x << ":" << x << ' '; #define debugg(x) cout << #x << ":" << x << ' ' << "\n"; #define endl "\n" #define L(X) ((X) << 1) #define R(X) (((X) << 1) | 1) #define...
[["-", 0, 30, 0, 14, 8, 9, 0, 43, 39, 40], ["+", 0, 30, 0, 14, 8, 9, 0, 43, 39, 40], ["-", 0, 30, 0, 14, 8, 9, 0, 43, 0, 21], ["+", 0, 30, 0, 14, 8, 9, 0, 43, 0, 35]]
1
649
#include <iostream> #include <vector> using namespace std; int main() { int n, m, aux = 0, total_votes = 0; cin >> n >> m; vector<int> a(n); for (int i = 0; i < n; i++) { cin >> a[i]; total_votes += a[i]; } for (int i = 0; i < n; i++) { if (a[i] >= (total_votes / (4 * m))) aux++; } if ...
#include <iostream> #include <vector> using namespace std; int main() { int n, m, aux = 0, total_votes = 0; cin >> n >> m; vector<int> a(n); for (int i = 0; i < n; i++) { cin >> a[i]; total_votes += a[i]; } for (int i = 0; i < n; i++) { if (a[i] >= ((double)total_votes / (4 * m))) aux++; ...
[["+", 51, 16, 12, 23, 0, 16, 31, 74, 0, 24], ["+", 12, 23, 0, 16, 31, 74, 39, 77, 39, 40], ["+", 51, 16, 12, 23, 0, 16, 31, 74, 0, 25]]
1
134
def main(): n, m = (int(x) for x in input().split()) a_list = list(map(int, input().split())) sum_num = 0 sum_num = sum(a_list) count = 0 for i in a_list: if(i >= sum_num/(4 * m)): count += 1 print(count) if(count >= m): print('Yes') else: print('No') if __name__ == '__main__': m...
def main(): n, m = (int(x) for x in input().split()) a_list = list(map(int, input().split())) sum_num = 0 sum_num = sum(a_list) count = 0 for i in a_list: if(i >= sum_num/(4 * m)): count += 1 if(count >= m): print('Yes') else: print('No') if __name__ == '__main__': main()
[["-", 0, 14, 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
110
#include <bits/stdc++.h> using namespace std; int main() { int N, M; cin >> N >> M; int total = 0; vector<int> A(N); for (int i = 0; i < N; i++) { cin >> A.at(i); total += A.at(i); } sort(A.begin(), A.end()); reverse(A.begin(), A.end()); double thr = 0.25 / M; if ((double)A.at(M - 1) < th...
#include <bits/stdc++.h> using namespace std; int main() { int N, M; cin >> N >> M; int total = 0; vector<int> A(N); for (int i = 0; i < N; i++) { cin >> A.at(i); total += A.at(i); } sort(A.begin(), A.end()); reverse(A.begin(), A.end()); double thr = total * 0.25 / M; if ((double)A.at(M -...
[["+", 0, 43, 49, 50, 51, 16, 31, 16, 31, 22], ["+", 0, 43, 49, 50, 51, 16, 31, 16, 17, 48]]
1
148
#include <iostream> #include <stdio.h> #include <stdlib.h> using namespace std; #define lli long ling int; int main() { int N, M, sum = 0; scanf("%d %d", &N, &M); int A[N]; for (int i = 0; i < N; i++) { scanf("%d", &A[i]); sum += A[i]; } int count = 0; for (int i = 0; i < N; i++) { if (A[i...
#include <iostream> #include <stdio.h> #include <stdlib.h> using namespace std; #define lli long ling int; int main() { int N, M, sum = 0; scanf("%d %d", &N, &M); int A[N]; for (int i = 0; i < N; i++) { scanf("%d", &A[i]); sum += A[i]; } int count = 0; for (int i = 0; i < N; i++) { if (A[i...
[["-", 8, 9, 0, 57, 15, 339, 51, 16, 17, 47], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 17, 20]]
1
151
#include <iostream> using namespace std; int main() { int N, M, cnt = 0, sum = 0; cin >> N >> M; int A[N]; for (int i = 0; i < N; i++) cin >> A[i]; for (int i = 0; i < N; i++) sum += A[i]; for (int i = 0; i < N; i++) { if (A[i] * 4 * M >= sum) cnt++; } if (cnt <= M) cout << "No" ...
#include <iostream> using namespace std; int main() { int N, M, cnt = 0, sum = 0; cin >> N >> M; int A[N]; for (int i = 0; i < N; i++) cin >> A[i]; for (int i = 0; i < N; i++) sum += A[i]; for (int i = 0; i < N; i++) { if (A[i] * 4 * M >= sum) cnt++; } if (cnt < M) cout << "No" <...
[["-", 8, 9, 0, 57, 15, 339, 51, 16, 17, 19], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 17, 18]]
1
137
#include <bits/stdc++.h> #define mod 1000000007 using namespace std; int main() { int i, N, M; cin >> N >> M; vector<int> A(N); int sum = 0; for (i = 0; i < N; i++) { cin >> A[i]; sum += A[i]; } int min = sum / (4 * M); sort(A.begin(), A.end()); // cout << A[N-M] << min; if (A[N - M] >= mi...
#include <bits/stdc++.h> #define mod 1000000007 using namespace std; int main() { int i, N, M; cin >> N >> M; vector<int> A(N); int sum = 0; for (i = 0; i < N; i++) { cin >> A[i]; sum += A[i]; } int min = sum / (4 * M); sort(A.begin(), A.end()); if (A[N - M] * 4 * M >= sum) cout << "Yes"...
[["+", 15, 339, 51, 16, 31, 16, 31, 16, 17, 48], ["+", 15, 339, 51, 16, 31, 16, 31, 16, 12, 13], ["+", 0, 57, 15, 339, 51, 16, 31, 16, 17, 48], ["+", 0, 57, 15, 339, 51, 16, 31, 16, 12, 22], ["-", 8, 9, 0, 57, 15, 339, 51, 16, 12, 22], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 12, 22]]
1
125
N,M = map(int,input().split()) A = list(map(int, input().split())) sumVal = sum(A) // 4 // M ansCnt = 0 for i in A: if i >= sumVal: ansCnt += 1 if ansCnt >= M: print("Yes") else: print("No")
N,M = map(int,input().split()) A = list(map(int, input().split())) sumVal = sum(A) / (4 * M) ansCnt = 0 for i in A: if i >= sumVal: ansCnt += 1 if ansCnt >= M: print("Yes") else: print("No")
[["-", 0, 1, 0, 662, 12, 657, 31, 657, 17, 676], ["+", 0, 656, 0, 1, 0, 662, 12, 657, 17, 85], ["+", 0, 1, 0, 662, 12, 657, 12, 23, 0, 24], ["-", 0, 656, 0, 1, 0, 662, 12, 657, 17, 676], ["+", 0, 662, 12, 657, 12, 23, 0, 657, 17, 48], ["+", 0, 1, 0, 662, 12, 657, 12, 23, 0, 25]]
5
78
n,m=map(int,input().split()) a=list(map(int,input().split())) a.sort() 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() if a[-m]<(sum(a)/(4*m)): print("No") else: print("Yes")
[["-", 0, 57, 15, 666, 0, 206, 206, 657, 17, 72], ["-", 0, 57, 15, 666, 0, 206, 206, 657, 12, 612]]
5
74
#include <algorithm> //sort,二分探索,など #include <bitset> //固定長bit集合 #include <cmath> //pow,logなど #include <complex> //複素数 #include <deque> //両端アクセスのキュー #include <functional> //sortのgreater #include <iomanip> //setprecision(浮動小数点の出力の誤差) #include <iostream> //入出力 #include <iter...
#include <algorithm> //sort,二分探索,など #include <bitset> //固定長bit集合 #include <cmath> //pow,logなど #include <complex> //複素数 #include <deque> //両端アクセスのキュー #include <functional> //sortのgreater #include <iomanip> //setprecision(浮動小数点の出力の誤差) #include <iostream> //入出力 #include <iter...
[["+", 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], ["-", 49, 50, 51, 16, 12, 23, 0, 16, 31, 13], ["+", 49, 50, 51, 16, 12, 23, 0, 16, 31, 13]]
1
273
#include <bits/stdc++.h> using namespace std; typedef long long int ll; const ll mod = 1e9 + 7; const ll mod1 = 998244353; #define rep(i, a, b) for (ll i = a; i < b; i++) void swap(ll &a, ll &b) { ll t = a; a = b; b = t; } ll min(ll a, ll b) { if (a < b) return a; return b; } ll max(ll a, ll b) { if ...
#include <bits/stdc++.h> using namespace std; typedef long long int ll; const ll mod = 1e9 + 7; const ll mod1 = 998244353; #define rep(i, a, b) for (ll i = a; i < b; i++) void swap(ll &a, ll &b) { ll t = a; a = b; b = t; } ll min(ll a, ll b) { if (a < b) return a; return b; } ll max(ll a, ll b) { if ...
[["-", 0, 9, 0, 57, 15, 339, 51, 16, 17, 47], ["+", 0, 9, 0, 57, 15, 339, 51, 16, 17, 20]]
1
290
N,M = map(int,input().split()) A = list(map(int,input().split())) num = 0 for i in range(N): if A[i] >= 1/(4*M): num += 1 if num >= M: print('Yes') else: print('No')
N,M = map(int,input().split()) A = list(map(int,input().split())) num = 0 for i in range(N): if A[i] >= sum(A) * 1/(4*M): num += 1 if num >= M: print('Yes') else: print('No')
[["+", 15, 666, 0, 657, 31, 657, 31, 652, 63, 22], ["+", 0, 657, 31, 657, 31, 652, 3, 4, 0, 24], ["+", 0, 657, 31, 657, 31, 652, 3, 4, 0, 22], ["+", 0, 657, 31, 657, 31, 652, 3, 4, 0, 25], ["+", 0, 57, 15, 666, 0, 657, 31, 657, 17, 48]]
5
80
#include <stdio.h> int main(void) { int n, m, i, s[100], sum = 0, cnt = 0; scanf("%d %d", &n, &m); for (i = 0; i < n; i++) { scanf("%d", &s[i]); sum = sum + s[i]; } for (i = 0; i < n; i++) { if (sum < 4 * m * s[i]) cnt++; } if (cnt == m) printf("Yes\n"); else printf("No\n"); ...
#include <stdio.h> int main(void) { int n, m, i, s[100], sum = 0, cnt = 0; scanf("%d %d", &n, &m); for (i = 0; i < n; i++) { scanf("%d", &s[i]); sum = sum + s[i]; } for (i = 0; i < n; i++) { if (sum <= 4 * m * s[i]) cnt++; } if (cnt >= m) printf("Yes\n"); else printf("No\n"); ...
[["-", 8, 9, 0, 57, 15, 23, 0, 16, 17, 18], ["+", 8, 9, 0, 57, 15, 23, 0, 16, 17, 19], ["-", 8, 9, 0, 57, 15, 23, 0, 16, 17, 60], ["+", 8, 9, 0, 57, 15, 23, 0, 16, 17, 20]]
0
136
//“ In order to be irreplaceable, one must always be different” #include <bits/stdc++.h> using namespace std; #define ll long long #define endl "\n" #define pi 3.14159265359 #define str string #define vll vector<ll> #define vstr vector<str> #define vchar vector<char> #define pb push_back #define popb pop_back #define p...
//“ In order to be irreplaceable, one must always be different” #include <bits/stdc++.h> using namespace std; #define ll long long #define endl "\n" #define pi 3.14159265359 #define str string #define vll vector<ll> #define vstr vector<str> #define vchar vector<char> #define pb push_back #define popb pop_back #define p...
[["-", 0, 14, 49, 53, 54, 55, 0, 56, 39, 78], ["+", 0, 14, 49, 53, 54, 55, 0, 56, 39, 78], ["-", 8, 9, 0, 57, 15, 339, 51, 16, 17, 20], ["+", 0, 57, 15, 339, 51, 16, 31, 16, 17, 33], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 17, 20], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 12, 13]]
1
469
#include <bits/stdc++.h> using namespace std; int main() { int n, m; cin >> n >> m; int a[110]; for (int i = 0; i < n; i++) cin >> a[i]; //配列に入力を取り込み int sum = 0; //投票合計 for (int i = 0; i < n; i++) { sum += a[i]; } int bl = sum / (4 * m); //最低得票数 int cnt = 0; sort(a, a + n, greater<int>())...
#include <bits/stdc++.h> using namespace std; int main() { int n, m; cin >> n >> m; int a[110]; for (int i = 0; i < n; i++) cin >> a[i]; //配列に入力を取り込み int sum = 0; //投票合計 for (int i = 0; i < n; i++) { sum += a[i]; } double bl = (double)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, 49, 50, 51, 16, 31, 74, 0, 24], ["+", 49, 50, 51, 16, 31, 74, 39, 77, 39, 40], ["+", 0, 43, 49, 50, 51, 16, 31, 74, 0, 25], ["-", 8, 9, 0, 57, 15, 339, 51, 16, 17, 47], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 17, 20]]
1
165
#include <bits/stdc++.h> using namespace std; int a[100010]; int32_t main() { int n, m; cin >> n >> m; int sum = 0; for (int i = 0; i < n; i++) cin >> a[i], sum += a[i]; sort(a, a + n); sum = sum / (4.0 * m); // cout << sum << endl; if (a[n - m] >= sum) cout << "Yes\n"; else cout ...
#include <bits/stdc++.h> using namespace std; int a[100010]; int32_t main() { int n, m; cin >> n >> m; double sum = 0; for (int i = 0; i < n; i++) cin >> a[i], sum += a[i]; sort(a, a + n); sum = sum / (4.0 * m); // cout << sum << endl; if (a[n - m] >= sum) cout << "Yes\n"; else co...
[["-", 0, 30, 0, 14, 8, 9, 0, 43, 39, 40], ["+", 0, 30, 0, 14, 8, 9, 0, 43, 39, 40]]
1
108
#include <bits/stdc++.h> using namespace std; #define ll long long #define lvector vector<ll> #define lque queue<ll> #define lpque priority_queue<ll> #define dlpque priority_queue<ll, lvector, greater<ll>> #define P pair<ll, ll> #define ALL(a) (a).begin(), (a).end() #define rep(i, n) for (ll(i) = 0; (i) < (n); ++(i)) #...
#include <bits/stdc++.h> using namespace std; #define ll long long #define lvector vector<ll> #define lque queue<ll> #define lpque priority_queue<ll> #define dlpque priority_queue<ll, lvector, greater<ll>> #define P pair<ll, ll> #define ALL(a) (a).begin(), (a).end() #define rep(i, n) for (ll(i) = 0; (i) < (n); ++(i)) #...
[["-", 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]]
1
159
#include <stdio.h> int main() { int i, j, n, m, tmp; int sum = 0, count = 0; int a[1000]; scanf("%d %d", &n, &m); for (i = 0; i < n; i++) { scanf("%d", &a[i]); sum += a[i]; } for (i = 0; i < n; i++) { for (j = i; j < n; j++) { if (a[i] < a[j]) { tmp = a[i]; a[i] = a[j]; ...
#include <stdio.h> int main() { int i, j, n, m, tmp; double sum = 0, count = 0; int a[1000]; scanf("%d %d", &n, &m); for (i = 0; i < n; i++) { scanf("%d", &a[i]); sum += a[i]; } for (i = 0; i < n; i++) { for (j = i; j < n; j++) { if (a[i] < a[j]) { tmp = a[i]; a[i] = a[j...
[["-", 0, 30, 0, 14, 8, 9, 0, 43, 39, 40], ["+", 0, 30, 0, 14, 8, 9, 0, 43, 39, 40]]
0
212
l = input() m = input() z = l.split(' ') M = int(z[1]) N = int(z[0]) F = m.split(' ') X = [] for item in F: votes = int(item) X.append(votes) S = sum(S) C = (S/(4*M)) X.sort(reverse=True) if X[M-1]<C: print("No") else: print("Yes")
l = input() m = input() z = l.split(' ') M = int(z[1]) N = int(z[0]) F = m.split(' ') X = [] for item in F: votes = int(item) X.append(votes) S = sum(X) C = (S/(4*M)) X.sort(reverse=True) if X[M-1]<C: print("No") else: print("Yes")
[["-", 0, 1, 0, 662, 12, 652, 3, 4, 0, 22], ["+", 0, 1, 0, 662, 12, 652, 3, 4, 0, 22]]
5
118
n,m = map(int,input().split()) a = list(map(int,input().split())) count=0 sum=0 for i in range(n): sum = sum + a[i] for i in range(n): if a[i] >= int(sum*(1/(4*m))): count +=1 else: pass if count>=m: print('Yes') else: print('No')
n,m = map(int,input().split()) a = list(map(int,input().split())) count=0 sum=0 for i in range(n): sum = sum + a[i] for i in range(n): if a[i] >= sum*(1/(4*m)): count +=1 else: pass 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, 657, 12, 23, 0, 657, 12, 23, 0, 25]]
5
109
n, m = map(int, input().split()) an = list(map(int, input().split())) counter = 0 for i in an: if i >= 1/(4*m): counter += 1 if counter >= m: print('Yes') else: print('No')
n, m = map(int, input().split()) an = list(map(int, input().split())) counter = 0 for i in an: if i >= sum(an)/(4*m): counter += 1 if counter >= m: print('Yes') else: print('No')
[["-", 8, 196, 0, 57, 15, 666, 0, 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]]
5
74
n, m = map(int, input().split()) a = list(map(int, input().split())) a.sort(reverse=True) s = sum(a) print(a,s) if a[m-1] < s/(4*m): print("No") else: print("Yes")
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("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, 21], ["-", 0, 656, 0, 1, 0, 652, 3, 4, 0, 25]]
5
83
#include <stdio.h> #include <algorithm> #include <cmath> #include <iostream> #include <numeric> #include <string> #include <vector> typedef long long ll; const ll BIGMOD = 1e9 + 7; using namespace std; int main() { int m, n; cin >> n >> m; vector<int> vec(n); for (int i = 0; i < n; ++i) cin >> vec[i]; s...
#include <stdio.h> #include <algorithm> #include <cmath> #include <iostream> #include <numeric> #include <string> #include <vector> typedef long long ll; const ll BIGMOD = 1e9 + 7; using namespace std; int main() { int m, n; cin >> n >> m; vector<int> vec(n); for (int i = 0; i < n; ++i) cin >> vec[i]; s...
[["-", 15, 339, 51, 16, 12, 16, 31, 16, 12, 13], ["+", 15, 339, 51, 16, 12, 16, 31, 16, 12, 13]]
1
155
n, m= input().split() n, m= int(n), int(m) eq=0 soma=0 cont=0 lista=[] for x in input().split(): x= int(x) lista.append(x) soma+=x eq= soma/4*m for x in range(n): if lista[x] >= eq: cont+=1 if cont < m: print('No') else: print('Yes')
n, m= input().split() n, m= int(n), int(m) eq=0 soma=0 cont=0 lista=[] for x in input().split(): x= int(x) lista.append(x) soma+=x eq= soma/(4*m) for x in range(n): if lista[x] >= eq: cont+=1 if cont < m: print('No') else: print('Yes')
[["+", 0, 1, 0, 662, 12, 657, 12, 23, 0, 24], ["+", 0, 1, 0, 662, 12, 657, 12, 23, 0, 25]]
5
108
#include <bits/stdc++.h> using namespace std; #define pb push_back typedef pair<int, int> pii; typedef vector<int> vi; typedef vector<pair<int, int>> vpii; typedef long long ll; int main() { ios::sync_with_stdio(false); cin.tie(0); cout.tie(0); int N, M, Ai; vi vet; int cont = 0; int polls = 0; cin...
#include <bits/stdc++.h> using namespace std; #define pb push_back typedef pair<int, int> pii; typedef vector<int> vi; typedef vector<pair<int, int>> vpii; typedef long long ll; int main() { ios::sync_with_stdio(false); cin.tie(0); cout.tie(0); int N, M, Ai; vi vet; int cont = 0; int polls = 0; cin...
[["-", 0, 30, 0, 14, 8, 9, 0, 43, 39, 40], ["+", 0, 30, 0, 14, 8, 9, 0, 43, 39, 40], ["+", 0, 43, 49, 50, 51, 16, 31, 74, 0, 24], ["+", 49, 50, 51, 16, 31, 74, 39, 77, 39, 40], ["+", 0, 43, 49, 50, 51, 16, 31, 74, 0, 25], ["-", 12, 23, 0, 41, 15, 16, 12, 16, 17, 72], ["-", 12, 23, 0, 41, 15, 16, 12, 16, 12, 13]]
1
195
#include <algorithm> #include <iostream> #include <vector> int main() { int N, M; std::cin >> N >> M; int sum{}; std::vector<int> data(N); for (int i = 0; i < N; ++i) { std::cin >> data[i]; sum += data[i]; } int line = sum / (4 * M); std::cout << ((std::count_if(data.begin(), data.end(), ...
#include <algorithm> #include <iostream> #include <vector> int main() { int N, M; std::cin >> N >> M; int sum{}; std::vector<int> data(N); for (int i = 0; i < N; ++i) { std::cin >> data[i]; sum += data[i]; } double line = sum / (4.0 * M); std::cout << ((std::count_if(data.begin(), data.end(...
[["-", 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 <algorithm> #include <iostream> int main() { int n, m; std::cin >> n >> m; int a[n]; int sum = 0; for (int i = 0; i < n; i++) { std::cin >> a[i]; sum += a[i]; } std::sort(a, a + n, std::greater<int>()); if (a[m - 1] < sum / 4 / m) { std::cout << "No" << '\n'; } else { std:...
#include <algorithm> #include <iostream> int main() { int n, m; std::cin >> n >> m; int a[n]; double sum = 0; for (int i = 0; i < n; i++) { std::cin >> a[i]; sum += a[i]; } std::sort(a, a + n, std::greater<int>()); if (a[m - 1] < sum / (4 * m)) { std::cout << "No" << '\n'; } else { ...
[["-", 0, 30, 0, 14, 8, 9, 0, 43, 39, 40], ["+", 0, 30, 0, 14, 8, 9, 0, 43, 39, 40], ["+", 15, 339, 51, 16, 12, 16, 12, 23, 0, 24], ["-", 0, 57, 15, 339, 51, 16, 12, 16, 17, 85], ["+", 51, 16, 12, 16, 12, 23, 0, 16, 17, 48], ["+", 15, 339, 51, 16, 12, 16, 12, 23, 0, 25]]
1
133
// omajinai c++ atcoder #include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < (int)(n); i++) #define all(x) (x).begin(), (x).end() #define itn int typedef long long ll; constexpr auto mod = 1000000007; using namespace std; int main() { int n, m; cin >> n >> m; vector<int> a(n); int sum = 0; int count...
// omajinai c++ atcoder #include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < (int)(n); i++) #define all(x) (x).begin(), (x).end() #define itn int typedef long long ll; constexpr auto mod = 1000000007; using namespace std; int main() { int n, m; cin >> n >> m; vector<double> a(n); double sum = 0; 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
144
# coding: utf-8 DATA = """ 12 3 4 56 78 901 2 345 67 890 123 45 6 789 """.split("\n") def get_debug_line(): for i in DATA: yield i if 1: get_line = input else: get_line = get_debug_line().__next__ get_line() N, M = [int(i) for i in get_line().strip().split(" ")] A = [int(i) for i in get_line().strip().split(" ...
# coding: utf-8 DATA = """ 12 3 4 56 78 901 2 345 67 890 123 45 6 789 """.split("\n") def get_debug_line(): for i in DATA: yield i if 1: get_line = input else: get_line = get_debug_line().__next__ get_line() N, M = [int(i) for i in get_line().strip().split(" ")] A = [int(i) for i in get_line().strip().split(" ...
[["-", 0, 7, 8, 196, 0, 57, 15, 666, 667, 47], ["+", 0, 7, 8, 196, 0, 57, 15, 666, 667, 20]]
5
142
n, m = gets.split().map(&:to_i) a = gets.split().map(&:to_i) vote = a.inject(&:+) border = vote / (4*m) a.sort.reverse.slice(0, m).each do |num| if num < border puts "No" exit end end puts "Yes"
n, m = gets.split().map(&:to_i) a = gets.split().map(&:to_i) vote = a.inject(&:+) border = vote / (4.0*m) a.sort.reverse.slice(0, m).each do |num| if num < border puts "No" exit end end puts "Yes"
[["-", 0, 662, 12, 738, 12, 739, 0, 738, 31, 612], ["+", 0, 662, 12, 738, 12, 739, 0, 738, 31, 531]]
4
79