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 <algorithm> #include <iostream> #include <vector> using namespace std; using ll = long long; using p = pair<int, int>; int main() { int n, m; cin >> n >> m; std::vector<int> a(n); int sum = 0; for (int i = 0; i < n; i++) { cin >> a[i]; sum += a[i]; } sort(a.rbegin(), a.rend()); string...
#include <algorithm> #include <iostream> #include <vector> using namespace std; using ll = long long; using p = pair<int, int>; int main() { int n, m; cin >> n >> m; std::vector<int> a(n); int sum = 0; for (int i = 0; i < n; i++) { cin >> a[i]; sum += a[i]; } sort(a.rbegin(), a.rend()); string...
[["+", 51, 16, 31, 69, 341, 342, 0, 16, 17, 33], ["+", 51, 16, 31, 69, 341, 342, 0, 16, 12, 13]]
1
149
#include "bits/stdc++.h" using namespace std; #define test \ int t; \ cin >> t; \ while (t--) #define fast ...
#include "bits/stdc++.h" using namespace std; #define test \ int t; \ cin >> t; \ while (t--) #define fast ...
[["-", 0, 30, 0, 14, 8, 9, 0, 43, 39, 78], ["+", 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
210
#include <bits/stdc++.h> #define REP(i, n) for ((int)(i) = 0; (i) < (int)(n); (i)++) #define ll long long using namespace std; int main() { int N, M, sum = 0; double div; cin >> N >> M; vector<int> A(N); for (int i = 0; i < N; i++) { cin >> A.at(i); sum += A.at(i); } div = sum / (4 * M); sor...
#include <bits/stdc++.h> #define REP(i, n) for ((int)(i) = 0; (i) < (int)(n); (i)++) #define ll long long using namespace std; int main() { int N, M, sum = 0; double div; cin >> N >> M; vector<int> A(N); for (int i = 0; i < N; i++) { cin >> A.at(i); sum += A.at(i); } div = (double)sum / (4 * (d...
[["+", 0, 1, 0, 11, 12, 16, 31, 74, 0, 24], ["+", 0, 11, 12, 16, 31, 74, 39, 77, 39, 40], ["+", 0, 1, 0, 11, 12, 16, 31, 74, 0, 25], ["+", 12, 16, 12, 23, 0, 16, 12, 74, 0, 24], ["+", 12, 23, 0, 16, 12, 74, 39, 77, 39, 40], ["+", 12, 16, 12, 23, 0, 16, 12, 74, 0, 25]]
1
153
n ,m = list(map(int,input().split())) A = list(map(int,input().split())) S= sum(A) count = 0 for i in range(n): if A[i]>=S/4*m: count+=1 if count>=m: print("Yes") if count<m: print("No")
n ,m = list(map(int,input().split())) A= list(map(int,input().split())) S= sum(A) count = 0 for i in range(n): if A[i]>=S*1/4*1/m: count+=1 if count>=m: print("Yes") if count<m: print("No")
[["+", 0, 657, 31, 657, 31, 657, 31, 657, 17, 48], ["+", 0, 657, 31, 657, 31, 657, 31, 657, 12, 612], ["+", 0, 57, 15, 666, 0, 657, 31, 657, 12, 612], ["+", 8, 196, 0, 57, 15, 666, 0, 657, 17, 85]]
5
90
#include <algorithm> #include <cctype> #include <cstdint> #include <cstdlib> #include <fstream> #include <iostream> #include <istream> #include <math.h> #include <set> #include <sstream> #include <string> #include <vector> #define fore(i, x, y) for (ll i = (x); i < (y); i++) #define disp(a) cout << a << endl; typedef l...
#include <algorithm> #include <cctype> #include <cstdint> #include <cstdlib> #include <fstream> #include <iostream> #include <istream> #include <math.h> #include <set> #include <sstream> #include <string> #include <vector> #define fore(i, x, y) for (ll i = (x); i < (y); i++) #define disp(a) cout << a << endl; typedef l...
[["-", 0, 9, 0, 57, 15, 339, 51, 16, 17, 47], ["+", 0, 9, 0, 57, 15, 339, 51, 16, 17, 20]]
1
189
#include <bits/stdc++.h> #define int long long #define quickie \ ios_base::sync_with_stdio(false); \ cin.tie(NULL); #define rep(i, a, b) for (int i = a; i < b; i++) #define rep1(i, a, b) for (int i = a; i <= b;...
#include <bits/stdc++.h> #define int long long #define quickie \ ios_base::sync_with_stdio(false); \ cin.tie(NULL); #define rep(i, a, b) for (int i = a; i < b; i++) #define rep1(i, a, b) for (int i = a; i <= b;...
[["-", 0, 9, 0, 57, 15, 339, 51, 16, 17, 47], ["+", 0, 9, 0, 57, 15, 339, 51, 16, 17, 20]]
1
331
#include <bits/stdc++.h> using namespace std; int main() { int n, m, sum = 0; cin >> n >> m; int a[n]; for (int i = 0; i < n; i++) { cin >> a[i]; sum += a[i]; } sort(a, a + n); sum = (double)sum / (4 * m); reverse(a, a + n); for (int i = 0; i < m; i++) { if (a[i] < sum) { cout << "No...
#include <bits/stdc++.h> using namespace std; int main() { int n, m, sum = 0; cin >> n >> m; int a[n]; for (int i = 0; i < n; i++) { cin >> a[i]; sum += a[i]; } sort(a, a + n); sum = ceil((double)sum / (4 * m)); reverse(a, a + n); for (int i = 0; i < m; i++) { if (a[i] < sum) { cout ...
[["+", 8, 9, 0, 1, 0, 11, 12, 2, 63, 22], ["+", 12, 2, 3, 4, 0, 16, 31, 74, 0, 24], ["+", 12, 2, 3, 4, 0, 16, 12, 23, 0, 25]]
1
139
#include <stdio.h> int main() { int n, m, number, is_false; scanf("%d %d", &n, &m); int a[n]; number = 0; for (int i = 0; i < n; i++) { scanf("%d", &a[i]); number += a[i]; } is_false = 0; for (int i = 0; i < n; i++) { if (a[i] < (int)(number / (4 * m))) { is_false++; } } if...
#include <stdio.h> int main() { int n, m, number, is_false; scanf("%d %d", &n, &m); int a[n]; number = 0; for (int i = 0; i < n; i++) { scanf("%d", &a[i]); number += a[i]; } is_false = 0; for (int i = 0; i < n; i++) { if (a[i] < (number / (double)(4 * m))) { is_false++; } } ...
[["-", 15, 23, 0, 16, 12, 74, 39, 77, 39, 40], ["-", 0, 57, 15, 23, 0, 16, 12, 74, 0, 25], ["-", 15, 23, 0, 16, 12, 74, 51, 23, 0, 24], ["+", 0, 16, 12, 23, 0, 16, 12, 74, 0, 24], ["+", 12, 23, 0, 16, 12, 74, 39, 77, 39, 40], ["+", 0, 16, 12, 23, 0, 16, 12, 74, 0, 25]]
0
151
import java.util.*; import java.util.Collections; class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int N = sc.nextInt(); int M = sc.nextInt(); Integer[] A = new Integer[N]; int sum = 0; String ret = "Yes"; for (int i = 0; i < A.length; i++) { ...
import java.util.*; import java.util.Collections; class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int N = sc.nextInt(); double M = sc.nextDouble(); Double[] A = new Double[N]; double sum = 0; String ret = "Yes"; for (int i = 0; i < A.length; i++)...
[["-", 0, 195, 8, 196, 0, 503, 39, 506, 0, 507], ["+", 0, 195, 8, 196, 0, 503, 39, 511, 0, 512], ["-", 8, 196, 0, 503, 49, 200, 51, 492, 141, 22], ["+", 8, 196, 0, 503, 49, 200, 51, 492, 141, 22], ["-", 0, 195, 8, 196, 0, 503, 39, 224, 468, 78], ["+", 0, 195, 8, 196, 0, 503, 39, 224, 468, 78], ["-", 8, 196, 0, 503, 49,...
3
181
#include <algorithm> #include <iostream> using namespace std; int main(void) { int N, M; cin >> N >> M; int A[N]; int check = 0; int ans = 0; for (int i = 0; i < N; i++) { cin >> A[i]; check += A[i]; } check = check / (4 * M); sort(A, A + N, greater<int>()); for (int i = 0; i < M; i++) { ...
#include <algorithm> #include <iostream> using namespace std; int main(void) { int N, M; cin >> N >> M; int A[N]; double check = 0; int ans = 0; for (int i = 0; i < N; i++) { cin >> A[i]; check += A[i]; } check = check / (4 * M); sort(A, A + N, greater<int>()); for (int i = 0; i < M; i++) ...
[["-", 0, 30, 0, 14, 8, 9, 0, 43, 39, 40], ["+", 0, 30, 0, 14, 8, 9, 0, 43, 39, 40]]
1
153
#include <bits/stdc++.h> #define ll long long #define oo 1000000010 using namespace std; int main() { ios_base::sync_with_stdio(false); cin.tie(nullptr); cout.tie(nullptr); int n; double m; cin >> n >> m; int a[n + 1]; double sum = 0; for (int i = 0; i < n; i++) { cin >> a[i]; sum += a[i]; ...
#include <bits/stdc++.h> #define ll long long #define oo 1000000010 using namespace std; int main() { ios_base::sync_with_stdio(false); cin.tie(nullptr); cout.tie(nullptr); int n; double m; cin >> n >> m; int a[n + 1]; double sum = 0; for (int i = 0; i < n; i++) { cin >> a[i]; sum += a[i]; ...
[["-", 8, 9, 0, 57, 15, 339, 51, 16, 17, 47], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 17, 20]]
1
165
N,M = gets.split.map(&:to_i); A = gets.split.map(&:to_i); min = A.inject(&:+) / (4.0 * M); puts A.count{|x| x >= min} > M ? "Yes" : "No"
N,M = gets.split.map(&:to_i); A = gets.split.map(&:to_i); min = A.inject(&:+) / (4.0 * M); puts A.count{|x| x >= min} >= M ? "Yes" : "No"
[["-", 0, 652, 3, 4, 0, 754, 15, 738, 17, 47], ["+", 0, 652, 3, 4, 0, 754, 15, 738, 17, 20]]
4
64
// Popular Vote #include <bits/stdc++.h> #define ll long long using namespace std; int main() { int N, M, sum = 0; string Ans = "Yes"; cin >> N >> M; int arr[N]; for (int i = 0; i < N; i++) { cin >> arr[i]; sum = sum + arr[i]; } sort(arr, arr + N, greater<int>()); for (int i = 0; i < M; i++) {...
// Popular Vote #include <bits/stdc++.h> #define ll long long using namespace std; int main() { int N, M; double sum = 0; string Ans = "Yes"; cin >> N >> M; int arr[N]; for (int i = 0; i < N; i++) { cin >> arr[i]; sum = sum + arr[i]; } sort(arr, arr + N, greater<int>()); 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], ["+", 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
138
#include <bits/stdc++.h> using namespace std; #define rep(i, n) for (int i = 0; i < (int)(n); i++) int main() { int N, M, all = 0, count = 0; cin >> N >> M; vector<int> Ai(N); rep(i, N) { cin >> Ai.at(i); all += Ai.at(i); } rep(i, N) { if (Ai.at(i) >= all / (4 * M)) { count++; } ...
#include <bits/stdc++.h> using namespace std; #define rep(i, n) for (int i = 0; i < (int)(n); i++) int main() { int N, M, count = 0; float all = 0; cin >> N >> M; vector<int> Ai(N); rep(i, N) { cin >> Ai.at(i); all += Ai.at(i); } rep(i, N) { if (Ai.at(i) >= all / (4 * M)) { count++; ...
[["-", 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())) A.sort(reverse=True) if A[m] >= (sum(A) / (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, 206, 206, 657, 17, 33], ["+", 0, 57, 15, 666, 0, 206, 206, 657, 12, 612]]
5
74
N,M=map(int,input().split()) a=list(map(int,input().split())) s=sum(a) k=0 for x in a: if x>=s//(M*4):k+=1 if k>=M: print("Yes") else: print("No")
N,M=map(int,input().split()) a=list(map(int,input().split())) s=sum(a) k=0 for x in a: if x>=s/(M*4):k+=1 if k>=M: print("Yes") else: print("No")
[["-", 8, 196, 0, 57, 15, 666, 0, 657, 17, 676], ["+", 8, 196, 0, 57, 15, 666, 0, 657, 17, 85]]
5
80
#include <iostream> using namespace std; int main(void) { uint16_t N, M; uint16_t x, count = 0; uint64_t sum = 0; cin >> N; cin >> M; uint16_t num[N]; for (int i = 0; i < N; i++) { cin >> x; num[i] = x; sum += num[i]; } for (int j = 0; j < N; j++) { if ((4 * M) * num[j] > sum) { ...
#include <iostream> using namespace std; int main(void) { uint16_t N, M; uint16_t x, count = 0; uint64_t sum = 0; cin >> N; cin >> M; uint16_t num[N]; for (int i = 0; i < N; i++) { cin >> x; num[i] = x; sum += num[i]; } for (int j = 0; j < N; j++) { if ((4 * M) * num[j] >= sum) {...
[["-", 8, 9, 0, 57, 15, 339, 51, 16, 17, 47], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 17, 20]]
1
140
#include <algorithm> #include <iostream> #include <vector> using namespace std; int main() { int N, M; cin >> N; cin >> M; vector<int> A(N); int total = 0; for (int i = 0; i < N; i++) { int a; cin >> a; A[i] = a; total += a; } int count = count_if(A.begin(), A.end(), [&total, &M](int i...
#include <algorithm> #include <iostream> #include <vector> using namespace std; int main() { int N, M; cin >> N; cin >> M; vector<int> A(N); int total = 0; for (int i = 0; i < N; i++) { int a; cin >> a; A[i] = a; total += a; } int count = count_if(A.begin(), A.end(), [&total, &M](int i...
[["+", 0, 37, 0, 23, 0, 16, 31, 74, 0, 24], ["+", 0, 23, 0, 16, 31, 74, 39, 77, 39, 40], ["+", 0, 37, 0, 23, 0, 16, 31, 74, 0, 25], ["+", 0, 16, 12, 16, 31, 16, 31, 74, 0, 24], ["+", 12, 16, 31, 16, 31, 74, 39, 77, 39, 40], ["+", 0, 16, 12, 16, 31, 16, 31, 74, 0, 25]]
1
140
import java.util.*; import java.util.stream.*; public class Main { public static void main(String[] args) throws Exception { Scanner sc = new Scanner(System.in); int N = sc.nextInt(); int M = sc.nextInt(); int items[] = new int[N]; for (int i = 0; i < N; i++) { items[i] = sc.nextInt(); ...
import java.util.*; import java.util.stream.*; public class Main { public static void main(String[] args) throws Exception { Scanner sc = new Scanner(System.in); int N = sc.nextInt(); int M = sc.nextInt(); int items[] = new int[N]; for (int i = 0; i < N; i++) { items[i] = sc.nextInt(); ...
[["-", 0, 195, 8, 196, 0, 503, 39, 506, 0, 507], ["+", 0, 195, 8, 196, 0, 503, 39, 511, 0, 512], ["+", 0, 503, 49, 200, 51, 16, 31, 16, 31, 515], ["+", 0, 503, 49, 200, 51, 16, 31, 16, 17, 48]]
3
190
/* * Project: AtCoder Beginners Contest 161 B - Popular Vote * Author: toms74209200 <https://github.com/toms74209200> * * Created on 2020/04/04 * Copyright (c) 2020 toms74209200 * * This software is released under the MIT License. * http://opensource.org/licenses/mit-license.php */ #include <algorithm> #includ...
/* * Project: AtCoder Beginners Contest 161 B - Popular Vote * Author: toms74209200 <https://github.com/toms74209200> * * Created on 2020/04/04 * Copyright (c) 2020 toms74209200 * * This software is released under the MIT License. * http://opensource.org/licenses/mit-license.php */ #include <algorithm> #includ...
[["-", 0, 30, 0, 14, 8, 9, 0, 43, 39, 40], ["+", 0, 30, 0, 14, 8, 9, 0, 43, 39, 40]]
1
164
n, m = map(int, input().split()) P = sorted(list(map(int, input().split()))) lmt = sum(P) / (4*m) if lmt < P[-1*m]: print('Yes') else: print('No')
#!/usr/bin/env python3 n, m = map(int, input().split()) P = sorted(list(map(int, input().split()))) lmt = sum(P) / (4*m) if lmt <= P[-1*m]: print('Yes') else: print('No')
[["-", 36, 36, 0, 656, 0, 57, 15, 666, 667, 18], ["+", 36, 36, 0, 656, 0, 57, 15, 666, 667, 19]]
5
73
N, M = [int(i) for i in input().split()] A = [int(i) for i in input().split()] total = sum(A) print('Yes' if len(1 for a in A if a * 4 * M >= total) >= M else 'No')
N, M = [int(i) for i in input().split()] A = [int(i) for i in input().split()] total = sum(A) print('Yes' if len([1 for a in A if a * 4 * M >= total]) >= M else 'No')
[["+", 0, 666, 0, 652, 3, 4, 0, 658, 0, 70], ["+", 0, 666, 0, 652, 3, 4, 0, 658, 0, 73]]
5
73
#include <bits/stdc++.h> using namespace std; int main() { int n, m; cin >> n >> m; vector<int> a(n); for (int i = 0; i < n; i++) cin >> a[i]; sort(a.begin(), a.end()); reverse(a.begin(), a.end()); int x = 0; for (int i = 0; i < n; i++) x += a[i]; bool ans = true; for (int i = 0; i < m; i++...
#include <bits/stdc++.h> using namespace std; int main() { int n, m; cin >> n >> m; vector<int> a(n); for (int i = 0; i < n; i++) cin >> a[i]; sort(a.begin(), a.end()); reverse(a.begin(), a.end()); int x = 0; for (int i = 0; i < n; i++) x += a[i]; bool ans = true; for (int i = 0; i < m; i++)...
[["-", 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], ["+", 0, 57, 15, 339, 51, 16, 31, 16, 17, 48], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 17, 18], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 12, 22]]
1
170
#include <algorithm> #include <iostream> #include <map> #include <math.h> #include <queue> #include <set> #include <vector> using namespace std; typedef long long ll; int main() { int N, M, A; cin >> N >> M; vector<int> vec; int sum = 0; for (auto i = 0; i < N; i++) { cin >> A; vec.push_back(A); ...
#include <algorithm> #include <iostream> #include <map> #include <math.h> #include <queue> #include <set> #include <vector> using namespace std; typedef long long ll; int main() { double N, M, A; cin >> N >> M; vector<double> vec; double sum = 0; for (auto i = 0; i < N; i++) { cin >> A; vec.push_bac...
[["-", 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
155
n,m=list(map(int,input().split())) a=list(map(int,input().split())) a.sort(reverse=True) cnt=0 for j in range(n): cnt+=a[j] b=[] for i in range(n): if a[i]>(cnt*(1/(4*m))): b.append(a[i]) if len(b) >= m: print("Yes") else: print("No")
n,m=list(map(int,input().split())) a=list(map(int,input().split())) a.sort(reverse=True) cnt=0 for j in range(n): cnt+=a[j] b=[] for i in range(n): if a[i]>=(cnt*(1/(4*m))): b.append(a[i]) if len(b)>= m: print("Yes") else: print("No")
[["-", 0, 7, 8, 196, 0, 57, 15, 666, 667, 47], ["+", 0, 7, 8, 196, 0, 57, 15, 666, 667, 20]]
5
124
import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.util.Arrays; import java.util.Scanner; public class Main { public static void main(String[] args) throws IOException { Scanner in = new Scanner(new BufferedReader(new InputStreamReader(System.in))); ...
import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.util.Arrays; import java.util.Scanner; public class Main { public static void main(String[] args) throws IOException { Scanner in = new Scanner(new BufferedReader(new InputStreamReader(System.in))); ...
[["-", 0, 195, 8, 196, 0, 503, 39, 506, 0, 507], ["+", 0, 195, 8, 196, 0, 503, 39, 511, 0, 512], ["+", 51, 16, 12, 23, 0, 16, 12, 74, 0, 24], ["+", 12, 23, 0, 16, 12, 74, 39, 511, 0, 512], ["+", 51, 16, 12, 23, 0, 16, 12, 74, 0, 25]]
3
201
#include <stdio.h> #include <string.h> #define lop(i, n) for (i = 0; i < n; i++) int main() { int N, M, i, sum = 0, cnt = 0; int A[1000]; scanf("%d %d", &N, &M); lop(i, N) { scanf("%d", &A[i]); sum += A[i]; } float rin = sum / (4 * M); lop(i, N) { if (rin <= (float)A[i]) cnt++; } ...
#include <stdio.h> #include <string.h> #define lop(i, n) for (i = 0; i < n; i++) int main() { int N, M, i, sum = 0, cnt = 0; int A[1000]; scanf("%d %d", &N, &M); lop(i, N) { scanf("%d", &A[i]); sum += A[i]; } float rin = sum / (4.0 * M); lop(i, N) { if (rin <= A[i]) cnt++; } if ...
[["-", 49, 50, 51, 16, 12, 23, 0, 16, 31, 13], ["+", 49, 50, 51, 16, 12, 23, 0, 16, 31, 13], ["-", 0, 57, 15, 23, 0, 16, 12, 74, 0, 24], ["-", 15, 23, 0, 16, 12, 74, 39, 77, 39, 40], ["-", 0, 57, 15, 23, 0, 16, 12, 74, 0, 25]]
0
144
#include <bits/stdc++.h> using namespace std; typedef long long int ll; typedef pair<ll, ll> mp; ll inf = 1e9; int main() { ll n, m; cin >> n >> m; vector<ll> a(n); for (int i = 0; i < n; i++) cin >> a[i]; double sum = 0; ll cnt = 0; for (int i = 0; i < n; i++) sum += a[i]; for (int i = 0; i < ...
#include <bits/stdc++.h> using namespace std; typedef long long int ll; typedef pair<ll, ll> mp; ll inf = 1e9; int main() { ll n, m; cin >> n >> m; vector<ll> a(n); for (int i = 0; i < n; i++) cin >> a[i]; double sum = 0; ll cnt = 0; for (int i = 0; i < n; i++) sum += a[i]; for (int i = 0; i < ...
[["-", 8, 9, 0, 57, 15, 339, 51, 16, 17, 47], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 17, 20]]
1
166
#define rep(i, n) for (int i = 0; i < n; i++) #include <bits/stdc++.h> using namespace std; int main() { int N, M, tot = 0, c = 0; cin >> N >> M; vector<int> A(N); rep(i, N) { cin >> A.at(i); tot += A.at(i); } sort(A.begin(), A.end()); reverse(A.begin(), A.end()); rep(i, M) { if (A.at(i...
#define rep(i, n) for (int i = 0; i < n; i++) #include <bits/stdc++.h> using namespace std; int main() { int N, M, c = 0; double tot = 0; cin >> N >> M; vector<int> A(N); rep(i, N) { cin >> A.at(i); tot += A.at(i); } sort(A.begin(), A.end()); reverse(A.begin(), A.end()); rep(i, M) { i...
[["-", 0, 14, 8, 9, 0, 43, 49, 50, 49, 22], ["+", 0, 14, 8, 9, 0, 43, 49, 50, 49, 22], ["-", 0, 30, 0, 14, 8, 9, 0, 43, 0, 21], ["+", 0, 30, 0, 14, 8, 9, 0, 43, 0, 35], ["+", 0, 30, 0, 14, 8, 9, 0, 43, 39, 40]]
1
155
N, M = list(map(int, input().split())) A = list(map(int, input().split())) A_sum =sum(A) ans = 0 for i in range(N): if A[i] >= int(A_sum/(4*M)): ans += 1 if ans >= M: print('Yes') else: print('No')
N, M = list(map(int, input().split())) A = list(map(int, input().split())) A_sum =sum(A) ans = 0 for i in range(N): if A[i] >= A_sum/(4*M): ans += 1 if ans >= M: print('Yes') else: print('No')
[["-", 8, 196, 0, 57, 15, 666, 0, 652, 63, 22], ["-", 0, 57, 15, 666, 0, 652, 3, 4, 0, 24], ["-", 0, 652, 3, 4, 0, 657, 12, 23, 0, 25]]
5
92
n, m = map(int, input().split()) a = list(map(int, input().split())) a.sort(reverse=True) vote = sum(a) if a[m-1] > vote*1/(4*m): print('Yes') else: print('No')
n, m = map(int, input().split()) a = list(map(int, input().split())) a.sort(reverse=True) vote = sum(a) if a[m-1] >= vote*1/(4*m): print('Yes') else: print('No')
[["-", 36, 36, 0, 656, 0, 57, 15, 666, 667, 47], ["+", 36, 36, 0, 656, 0, 57, 15, 666, 667, 20]]
5
79
N, M = [int(x) for x in input().split()] A = [int(x) for x in input().split()] point = sum(A) / (4*M) count = 0 for a in A: if a > point: count += 1 print("Yes" if count >= M else "No")
N, M = [int(x) for x in input().split()] A = [int(x) for x in input().split()] point = sum(A) / (4*M) count = 0 for a in A: if a >= point: count += 1 print("Yes" if count >= M else "No")
[["-", 0, 7, 8, 196, 0, 57, 15, 666, 667, 47], ["+", 0, 7, 8, 196, 0, 57, 15, 666, 667, 20]]
5
80
#include <bits/stdc++.h> #define rep(i, n) for (i = 0; i < (n); ++i) using namespace std; typedef long long ll; typedef pair<int, int> P; #define MOD 1000000007 int main() { ll N, i, M, tot = 0; vector<ll> A(100); string ans = "Yes"; cin >> N >> M; rep(i, N) { cin >> A[i]; tot += A[i]; } sort(A.b...
#include <bits/stdc++.h> #define rep(i, n) for (i = 0; i < (n); ++i) using namespace std; typedef long long ll; typedef pair<int, int> P; #define MOD 1000000007 int main() { ll N, i, M; double tot = 0; vector<ll> A(100); string ans = "Yes"; cin >> N >> M; rep(i, N) { cin >> A[i]; tot += A[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]]
1
156
#include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < (int)(n); ++i) using namespace std; typedef long long int int64; typedef unsigned long long uint64; int main() { int n, m; cin >> n >> m; vector<int> a(n); rep(i, n) cin >> a[i]; int sumVote = 0; rep(i, n) sumVote += a[i]; int counter = 0; ...
#include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < (int)(n); ++i) using namespace std; typedef long long int int64; typedef unsigned long long uint64; int main() { int n, m; cin >> n >> m; vector<int> a(n); rep(i, n) cin >> a[i]; int sumVote = 0; rep(i, n) sumVote += a[i]; int counter = 0; ...
[["-", 51, 16, 12, 16, 31, 74, 39, 77, 39, 40], ["+", 51, 16, 12, 16, 31, 74, 39, 77, 39, 40]]
1
135
n,b= map(int, input().split()) a= list(map(int, input().split())) new_list = sorted(a, reverse=True) sums = sum(a) #print(new_list[b-1]) if new_list[b-1] > sums/(b*4): print("Yes") else: print("No")
n,b= map(int, input().split()) a= list(map(int, input().split())) new_list = sorted(a, reverse=True) sums = sum(a) if new_list[b-1] >= sums/(b*4): 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
80
#include <iostream> using namespace std; typedef long long ll; int main() { ll n, m; cin >> n >> m; ll a[n], b = 0, ans = 0; for (int i = 0; i < n; i++) { cin >> a[i]; b += a[i]; } for (int i = 0; i < n; i++) { if (a[i] >= b / (4 * m)) { ans++; }; } if (ans >= m) { cout << "Yes...
#include <iostream> using namespace std; typedef long long ll; int main() { ll n, m; cin >> n >> m; ll a[n], ans = 0; double b = 0; for (int i = 0; i < n; i++) { cin >> a[i]; b += a[i]; } for (int i = 0; i < n; i++) { if (a[i] >= b / (4 * m)) { ans++; }; } if (ans >= m) { cou...
[["-", 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
136
#include <bits/stdc++.h> using namespace std; typedef long long ll; typedef long double ld; typedef pair<ll, ll> l_l; typedef pair<int, int> i_i; typedef vector<ll> vl; typedef vector<int> vi; typedef vector<char> vec; typedef vector<bool> veb; typedef vector<string> ves; typedef vector<vector<ll>> vvl; typedef vector<...
#include <bits/stdc++.h> using namespace std; typedef long long ll; typedef long double ld; typedef pair<ll, ll> l_l; typedef pair<int, int> i_i; typedef vector<ll> vl; typedef vector<int> vi; typedef vector<char> vec; typedef vector<bool> veb; typedef vector<string> ves; typedef vector<vector<ll>> vvl; typedef vector<...
[["-", 0, 30, 0, 14, 8, 9, 0, 43, 39, 78], ["+", 0, 30, 0, 14, 8, 9, 0, 43, 39, 40]]
1
444
import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner kbd = new Scanner(System.in); int n = kbd.nextInt(); int m = kbd.nextInt(); int[] A = new int[n]; for (int i = 0; i < n; i++) { A[i] = kbd.nextInt(); } long s = 0; for (int i = 0; i < n...
import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner kbd = new Scanner(System.in); int n = kbd.nextInt(); double m = kbd.nextInt(); int[] A = new int[n]; for (int i = 0; i < n; i++) { A[i] = kbd.nextInt(); } double s = 0; for (int i = 0; ...
[["-", 0, 195, 8, 196, 0, 503, 39, 506, 0, 507], ["+", 0, 195, 8, 196, 0, 503, 39, 511, 0, 512], ["-", 0, 195, 8, 196, 0, 503, 39, 506, 0, 96]]
3
203
NM = [int(_) for _ in input().split()] N = NM[0] M = NM[1] A = [int(_) for _ in input().split()] def solve(N, M, A): d = int(sum(A) / (4 * M)) a = [i for i in A if i>=d ] if len(a) >= M: return "Yes" else: return "No" print(solve(N, M, A))
NM = [int(_) for _ in input().split()] N = NM[0] M = NM[1] A = [int(_) for _ in input().split()] def solve(N, M, A): d = sum(A) / (4 * M) a = [i for i in A if i>=d ] if len(a) >= M: return "Yes" else: return "No" print(solve(N, M, A))
[["-", 8, 196, 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
115
nmlist = list(map(int, input().split())) svote = list(map(int, input().split())) allvote = sum(svote) maxvote = max(svote) svote.sort(reverse=True) n0 = nmlist[1] - 1 n1 = svote[n0] / allvote n2 = 1 / (4 * nmlist[1]) if n1 > n2: print("Yes") else: print("No")
nmlist = list(map(int, input().split())) svote = list(map(int, input().split())) allvote = sum(svote) maxvote = max(svote) svote.sort(reverse=True) n0 = nmlist[1] - 1 n1 = svote[n0] / allvote n2 = 1 / (4 * nmlist[1]) if n1 >= n2: 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
101
import java.util.ArrayList; import java.util.Collections; import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner scan = new Scanner(System.in); ArrayList<Integer> list = new ArrayList<Integer>(); int n = scan.nextInt(); int m = scan.nextInt(); int sum = ...
import java.util.ArrayList; import java.util.Collections; import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner scan = new Scanner(System.in); ArrayList<Integer> list = new ArrayList<Integer>(); int n = scan.nextInt(); int m = scan.nextInt(); int sum = ...
[["+", 0, 503, 49, 200, 51, 16, 31, 16, 31, 515], ["+", 0, 503, 49, 200, 51, 16, 31, 16, 17, 48]]
3
217
#include <iostream> int main() { int N, M, A[1000], C = 0; std::cin >> N >> M; for (int i = 0; i < N; i++) { std::cin >> A[i]; C += A[i]; } double F = double(C / (4 * M)); int Ans = 0; for (int i = 0; i < N; i++) { if (A[i] >= F) Ans++; } if (Ans < M) std::cout << "No" << std::en...
#include <iostream> int main() { int N, M, A[1000], C = 0; std::cin >> N >> M; for (int i = 0; i < N; i++) { std::cin >> A[i]; C += A[i]; } double F = (double)C / (4 * M); int Ans = 0; for (int i = 0; i < N; i++) { if (A[i] >= F) Ans++; } if (Ans < M) std::cout << "No" << std::en...
[["-", 8, 9, 0, 43, 49, 50, 51, 2, 63, 40], ["+", 49, 50, 51, 16, 31, 74, 39, 77, 39, 40], ["+", 0, 43, 49, 50, 51, 16, 31, 74, 0, 25], ["-", 51, 2, 3, 4, 0, 16, 12, 23, 0, 25]]
1
143
N,M = (int(y) for y in input().split()) A = list(map(int, input().split())) X = int(sum(A)/(4*M)) B = [i for i in A if i >= X] if len(B) >= M: print("Yes") else: print("No")
import math N,M = (int(y) for y in input().split()) A = list(map(int, input().split())) X = math.ceil(sum(A)/(4*M)) B = [i for i in A if i >= X] if len(B) >= M: print("Yes") else: print("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
87
# coding: utf-8 # Your code here! N,M = map(int, input().split()) #print(M) S = list(map(int,input().split())) S.sort(reverse=True) #print(S) L = len(S) SUM = sum(S) #print(SUM) #print(L) #print(S[M-1]) if S[M-1] / SUM > 1/(4*M): print("Yes") else: print("No")
# coding: utf-8 # Your code here! N,M = map(int, input().split()) #print(M) S = list(map(int,input().split())) S.sort(reverse=True) #print(S) L = len(S) SUM = sum(S) #print(SUM) #print(L) #print(S[M-1]) if S[M-1] / SUM >= 1/(4*M): print("Yes") else: print("No")
[["-", 36, 36, 0, 656, 0, 57, 15, 666, 667, 47], ["+", 36, 36, 0, 656, 0, 57, 15, 666, 667, 20]]
5
92
#include <cmath> #include <cstdio> #include <iostream> using namespace std; int main() { int sum = 0; int M = 0; int n, m; cin >> n >> m; int a[n]; for (int i = 0; i < n; i++) { cin >> a[i]; sum += a[i]; } float t = (float)(1 / ((float)4 * m)) * sum; // divison lession for (int i = 0; i <...
#include <cmath> #include <cstdio> #include <iostream> using namespace std; int main() { int sum = 0; int M = 0; int n, m; cin >> n >> m; int a[n]; for (int i = 0; i < n; i++) { cin >> a[i]; sum += a[i]; } float t = (float)(1 / ((float)4 * m)) * sum; // divison lession for (int i = 0; i <...
[["-", 0, 57, 15, 339, 51, 16, 31, 74, 0, 24], ["-", 15, 339, 51, 16, 31, 74, 39, 77, 39, 40], ["-", 0, 57, 15, 339, 51, 16, 31, 74, 0, 25]]
1
159
N, M= map(int, input().split()) C = map(int, input().split()) A = list(C) B = [] for i in range(len(A)): if A[i] > sum(A)/4/M: B.append(1) else: B.append(0) if sum(B) >= M: print('Yes') else: print('No')
N, M= map(int, input().split()) C = map(int, input().split()) A = list(C) #if N < M: # print('No') #if M == 0: # print('No') B = [] for i in range(len(A)): if A[i] >= sum(A)/4/M: B.append(1) else: B.append(0) if sum(B) >= M: print('Yes') else: print('No')
[["-", 0, 7, 8, 196, 0, 57, 15, 666, 667, 47], ["+", 0, 7, 8, 196, 0, 57, 15, 666, 667, 20]]
5
102
import sys input = lambda: sys.stdin.readline().rstrip() yes = lambda boolean: print('Yes') if boolean else print('No') input_ints = lambda: list(map(int, input().split())) N, M = input_ints() A = input_ints() A.sort(reverse=1) yes(A[M-1]*4*M>sum(A))
import sys input = lambda: sys.stdin.readline().rstrip() yes = lambda boolean: print('Yes') if boolean else print('No') input_ints = lambda: list(map(int, input().split())) N, M = input_ints() A = input_ints() A.sort(reverse=1) yes(A[M-1]*4*M>=sum(A))
[["-", 0, 1, 0, 652, 3, 4, 0, 666, 667, 47], ["+", 0, 1, 0, 652, 3, 4, 0, 666, 667, 20]]
5
94
# -*- coding: utf-8 -*- ''' ''' import numpy as np N, M = map(int, input().split()) a = list(map(int, input().split())) a = np.array(a) s = int(a.sum()) level = 1 / (4 * M) # print(a) # print(level) cnt = (a > level * s).sum() if cnt >= M: print('Yes') else: print('No')
# -*- coding: utf-8 -*- ''' ''' import numpy as np N, M = map(int, input().split()) a = list(map(int, input().split())) a = np.array(a) s = int(a.sum()) level = 1 / (4 * M) # print(a) # print(level) cnt = (a >= level * s).sum() if cnt >= M: print('Yes') else: print('No')
[["-", 12, 652, 63, 319, 500, 23, 0, 666, 667, 47], ["+", 12, 652, 63, 319, 500, 23, 0, 666, 667, 20]]
5
102
num, choice = map(int, input().split()) tmp = input().split() product_list = [int(s) for s in tmp] product_list.sort() sum = 0 for i in range(num): sum += product_list[i] if product_list[choice-1] >= sum/(choice*4): print("Yes") else: print("No")
num, choice = map(int, input().split()) tmp = input().split() product_list = [int(s) for s in tmp] product_list.sort(reverse=True) sum = 0 for i in range(num): sum += product_list[i] if product_list[choice-1] >= sum/(choice*4): print("Yes") else: print("No")
[["+", 0, 1, 0, 652, 3, 4, 0, 653, 141, 22], ["+", 0, 1, 0, 652, 3, 4, 0, 653, 0, 32], ["+", 0, 1, 0, 652, 3, 4, 0, 653, 51, 146]]
5
89
#include <stdio.h> int main(void) { int n, m, i, a[101], c = 0, sum = 0; scanf("%d %d", &n, &m); for (i = 1; i <= n; i++) { scanf("%d", &a[i]); sum += a[i]; } for (i = 1; i <= m; i++) { if (4 * m * a[i] >= sum) c++; } if (c == m) { printf("Yes\n"); } else { printf("No\n"); ...
#include <stdio.h> int main(void) { int n, m, i, a[101], c = 0, sum = 0; scanf("%d %d", &n, &m); for (i = 1; i <= n; i++) { scanf("%d", &a[i]); sum += a[i]; } for (i = 1; i <= n; i++) { if (4 * m * a[i] >= sum) c++; } if (c >= m) { printf("Yes\n"); } else { printf("No\n"); ...
[["-", 0, 14, 8, 9, 0, 7, 15, 16, 12, 22], ["+", 0, 14, 8, 9, 0, 7, 15, 16, 12, 22], ["-", 8, 9, 0, 57, 15, 23, 0, 16, 17, 60], ["+", 8, 9, 0, 57, 15, 23, 0, 16, 17, 20]]
0
138
#include <stdio.h> int main() { int n, m; scanf("%d %d", &n, &m); int arr[n]; int sum = 0; for (int i = 0; i < n; i++) { scanf("%d", &arr[i]); sum += arr[i]; } double min = (double)sum / (4 * m); int count = 0; for (int i = 0; i < n; i++) { if (arr[i] > min) count++; if (count =...
#include <stdio.h> int main() { int n, m; scanf("%d %d", &n, &m); int arr[n]; int sum = 0; for (int i = 0; i < n; i++) { scanf("%d", &arr[i]); sum += arr[i]; } double min = (double)sum / (4 * m); int count = 0; for (int i = 0; i < n; i++) { if (arr[i] >= min) count++; if (count ...
[["-", 8, 9, 0, 57, 15, 23, 0, 16, 17, 47], ["+", 8, 9, 0, 57, 15, 23, 0, 16, 17, 20]]
0
149
#include <bits/stdc++.h> using namespace std; int main() { int N, M; cin >> N >> M; vector<int> A(N); int sum_vote = 0; for (int i = 0; i < N; i++) { cin >> A.at(i); sum_vote += A.at(i); } sort(A.begin(), A.end(), greater<int>()); int flag = 0; for (int i = 0; i < M; i++) { if ((double)A...
#include <bits/stdc++.h> using namespace std; int main() { int N, M; cin >> N >> M; vector<int> A(N); int sum_vote = 0; for (int i = 0; i < N; i++) { cin >> A.at(i); sum_vote += A.at(i); } sort(A.begin(), A.end(), greater<int>()); int flag = 0; for (int i = 0; i < M; i++) { if ((double)A....
[["+", 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
173
def main(): N, M = [int(x) for x in input().split()] A = [int(x) for x in input().split()] import heapq bests = heapq.nlargest(M, A) # print(bests) if bests[-1] >= sum(A)//(4*M): print("Yes") else: print("No") if __name__ == '__main__': main()
def main(): N, M = [int(x) for x in input().split()] A = [int(x) for x in input().split()] import heapq bests = heapq.nlargest(M, A) # print(bests) if bests[-1] >= sum(A)/(4*M): print("Yes") else: print("No") if __name__ == '__main__': main()
[["-", 8, 196, 0, 57, 15, 666, 0, 657, 17, 676], ["+", 8, 196, 0, 57, 15, 666, 0, 657, 17, 85]]
5
98
N, M = map(int, input().split(' ')) lis1 = map(int, input().split(' ')) S = sum(lis1) thresh = S / (4 * M) lis2 = sorted(lis1) if lis2[-M] < thresh: print('No') else: print('Yes')
N, M = map(int, input().split(' ')) lis1 = list(map(int, input().split(' '))) S = sum(lis1) thresh = S / (4 * M) lis2 = sorted(lis1) if lis2[-M] < thresh: print('No') else: print('Yes')
[["+", 0, 656, 0, 1, 0, 662, 12, 652, 63, 22], ["+", 0, 1, 0, 662, 12, 652, 3, 4, 0, 24], ["+", 0, 652, 3, 4, 0, 652, 3, 4, 0, 25]]
5
80
package main import "fmt" func main() { // N 商品数 // M 選択数 // Ai その商品の票数 var N, M int fmt.Scan(&N, &M) a := make([]int, N) for i := 0; i < N; i++ { fmt.Scan(&a[i]) } sum := 0 for _, aa := range a { sum += aa } //fmt.Println(sum) b := (4 * M) //fmt.Println(b) // 分数にしないと //w := sum / b w := float64(...
package main import "fmt" func main() { // N 商品数 // M 選択数 // Ai その商品の票数 var N, M int fmt.Scan(&N, &M) a := make([]int, N) for i := 0; i < N; i++ { fmt.Scan(&a[i]) } sum := 0 for _, aa := range a { sum += aa } //fmt.Println(sum) b := (4 * M) //fmt.Println(b) // 分数にしないと //w := sum / b w := float64(...
[["-", 0, 7, 8, 196, 0, 57, 15, 16, 17, 47], ["+", 0, 7, 8, 196, 0, 57, 15, 16, 17, 20], ["+", 8, 196, 0, 57, 15, 16, 12, 2, 63, 22], ["+", 0, 57, 15, 16, 12, 2, 3, 4, 0, 24], ["+", 0, 57, 15, 16, 12, 2, 3, 4, 0, 25]]
7
170
n ,m = map(int, input().split()) a = list(map(int, input().split())) a.sort() total = 0 for i in a: total += i ok = 0 for i in range(1, m + 1): if a[-i] > total / (4 * m): ok += 1 if ok != m: print("No") else: print("Yes")
n ,m = map(int, input().split()) a = list(map(int, input().split())) a.sort() total = 0 for i in a: total += i ok = 0 for i in range(1, m + 1): if a[-i] >= total / (4 * m): ok += 1 if ok != m: print("No") else: print("Yes")
[["-", 0, 7, 8, 196, 0, 57, 15, 666, 667, 47], ["+", 0, 7, 8, 196, 0, 57, 15, 666, 667, 20]]
5
101
#include <iostream> using namespace std; int main() { int n, m; cin >> n >> m; int arr[n], sum = 0, count = 0; for (int i = 0; i < n; i++) { cin >> arr[i]; sum += arr[i]; } int k = 4 * m; for (int i = 0; i < n; i++) { if (arr[i] >= sum / k) count++; } if (count >= m) cout << "Yes...
#include <iostream> using namespace std; int main() { int n, m; cin >> n >> m; float arr[n], sum = 0; int count = 0; for (int i = 0; i < n; i++) { cin >> arr[i]; sum += arr[i]; } float k = 4 * m; for (int i = 0; i < n; i++) { if (arr[i] >= sum / k) count++; } if (count >= m) co...
[["-", 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
123
N, M=map(int, input().split()) A=list(map(int, input().split())) A_sort=sorted(A)[::-1] if A_sort[M-1]/sum(A) >= 1/4*M: print("Yes") else: print("No")
N, M=map(int, input().split()) A=list(map(int, input().split())) A_sort=sorted(A)[::-1] if A_sort[M-1]/sum(A) >= 1/(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
78
n,m=map(int,input().split()) a=list(map(int,input().split())) count=0 b=sum(a) for i in range(n): if a[i]>=b//(4*m): count=count+1 if count>=m: print("Yes") else: print("No")
n,m=map(int,input().split()) a=list(map(int,input().split())) count=0 b=sum(a) for i in range(n): if a[i]>=b/(4*m): count=count+1 if count>=m: print("Yes") else: print("No")
[["-", 8, 196, 0, 57, 15, 666, 0, 657, 17, 676], ["+", 8, 196, 0, 57, 15, 666, 0, 657, 17, 85]]
5
88
#include <algorithm> #include <iostream> #include <string> #include <vector> typedef long long int ll; using namespace std; int main() { ll N, M; cin >> N >> M; vector<ll> A(N); for (ll i = 0; i < N; i++) { cin >> A.at(i); } ll cnt = 0; ll sum = 0; for (ll i = 0; i < N; i++) { sum += A.at(i)...
#include <algorithm> #include <iostream> #include <string> #include <vector> typedef long long int ll; using namespace std; int main() { ll N, M; cin >> N >> M; vector<ll> A(N); for (ll i = 0; i < N; i++) { cin >> A.at(i); } ll cnt = 0; ll sum = 0; for (ll i = 0; i < N; i++) { sum += A.at(i)...
[["-", 8, 9, 0, 57, 15, 339, 51, 16, 17, 47], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 17, 20]]
1
178
#include <bits/stdc++.h> using namespace std; typedef long long ll; ll findTrailingZeros(ll n) { ll cnt = 0; for (ll i = 5; n / i >= 1; i *= 5) cnt += n / i; return cnt; } int32_t main() { ios_base::sync_with_stdio(0); cin.tie(NULL); cout.tie(NULL); ll t; t = 1; while (t--) { ll n, m; cin...
#include <bits/stdc++.h> using namespace std; typedef long long ll; ll findTrailingZeros(ll n) { ll cnt = 0; for (ll i = 5; n / i >= 1; i *= 5) cnt += n / i; return cnt; } int32_t main() { ios_base::sync_with_stdio(0); cin.tie(NULL); cout.tie(NULL); ll t; t = 1; while (t--) { ll n, m; cin...
[["-", 8, 9, 0, 52, 8, 9, 0, 43, 39, 78], ["+", 8, 9, 0, 52, 8, 9, 0, 43, 39, 40]]
1
203
n, m = map(int, input().split()) # n, m = map(int, "4 1".split()) # inputText2 = "5 4 2 1" inputText2 = input() input2List = list(map(int,inputText2.split())) sortList = sorted(input2List, reverse=True) # print(sortList) #380 19 1000 total = sum(sortList) # print(total) h = (1/4*m) * total # print(h) flg = False for i ...
n, m = map(int, input().split()) # n, m = map(int, "12 3".split()) # inputText2 = "4 56 78 901 2 345 67 890 123 45 6 789" inputText2 = input() input2List = list(map(int,inputText2.split())) sortList = sorted(input2List, reverse=True) # print(sortList) #380 19 1000 total = sum(sortList) # print(total) h = (1/(4*m)) * to...
[["+", 12, 657, 31, 23, 0, 657, 12, 23, 0, 24], ["+", 0, 1, 0, 662, 12, 657, 31, 23, 0, 25], ["+", 8, 196, 0, 57, 64, 196, 0, 93, 0, 94]]
5
107
#include <bits/stdc++.h> using namespace std; using int64 = long long; const int mod = 1e9 + 7; // const int mod = 998244353; const int64 infll = (1LL << 62) - 1; const int inf = (1 << 30) - 1; struct IoSetup { IoSetup() { cin.tie(nullptr); ios::sync_with_stdio(false); cout << fixed << setprecision(10...
#include <bits/stdc++.h> using namespace std; using int64 = long long; const int mod = 1e9 + 7; // const int mod = 998244353; const int64 infll = (1LL << 62) - 1; const int inf = (1 << 30) - 1; struct IoSetup { IoSetup() { cin.tie(nullptr); ios::sync_with_stdio(false); cout << fixed << setprecision(10...
[["-", 8, 9, 0, 1, 0, 11, 12, 16, 17, 47], ["+", 8, 9, 0, 1, 0, 11, 12, 16, 17, 20]]
1
721
#include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < (n); ++i) using namespace std; using ll = long long; int main() { int n, m; cin >> n >> m; vector<int> data(n); for (int i = 0; i < n; i++) { cin >> data[i]; } ll bote_sum = accumulate(data.begin(), data.end(), 0LL); ll border = bote_sum...
#include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < (n); ++i) using namespace std; using ll = long long; int main() { int n, m; cin >> n >> m; vector<int> data(n); for (int i = 0; i < n; i++) { cin >> data[i]; } int bote_sum = accumulate(data.begin(), data.end(), 0); double border = bote_...
[["-", 0, 30, 0, 14, 8, 9, 0, 43, 39, 78], ["+", 0, 30, 0, 14, 8, 9, 0, 43, 39, 40], ["-", 0, 43, 49, 50, 51, 2, 3, 4, 0, 13], ["+", 0, 43, 49, 50, 51, 2, 3, 4, 0, 13], ["-", 49, 50, 51, 16, 12, 23, 0, 16, 31, 13], ["+", 49, 50, 51, 16, 12, 23, 0, 16, 31, 13]]
1
189
#include <stdio.h> #include <stdlib.h> int cmp(const void *a, const void *b) { return *(int *)a - *(int *)b; } int main() { int n, m, i, sum = 0, t, k, z = 0; int a[101]; scanf("%d %d", &n, &m); for (i = 0; i < n; i++) { scanf("%d", &a[i]); sum = sum + a[i]; } qsort(a, n, sizeof(a[0]), cmp); for (...
#include <stdio.h> #include <stdlib.h> int cmp(const void *a, const void *b) { return *(int *)a - *(int *)b; } int main() { int n, m, i, sum = 0, t, k, z = 0; int a[101]; scanf("%d %d", &n, &m); for (i = 0; i < n; i++) { scanf("%d", &a[i]); sum = sum + a[i]; } qsort(a, n, sizeof(a[0]), cmp); for (...
[["-", 0, 14, 8, 9, 0, 7, 15, 16, 17, 20], ["+", 0, 14, 8, 9, 0, 7, 15, 16, 17, 47]]
1
198
#include <algorithm> #include <iostream> using namespace std; int main() { int N; int M; cin >> N >> M; 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]; } sort(A, A + N, std::greater<>()); bool success = true; for (int i ...
#include <algorithm> #include <iostream> using namespace std; int main() { int N; double M; cin >> N >> M; int A[N]; for (int i = 0; i < N; i++) { cin >> A[i]; } double sum = 0; for (int i = 0; i < N; i++) { sum += A[i]; } sort(A, A + N, std::greater<>()); bool success = true; for (...
[["-", 0, 30, 0, 14, 8, 9, 0, 43, 39, 40], ["+", 0, 30, 0, 14, 8, 9, 0, 43, 39, 40]]
1
170
N,M=map(int,input().split()) A=[input().split() for i in range(1)] all=0 for i in range(N): all+=int(A[0][i]) FLAG=int(1/(4*M)*all) flag=0 for i in range(N): if FLAG<=int(A[0][i]): flag+=1 if flag>=M: print('Yes') else: print('No')
N,M=map(int,input().split()) A=[input().split() for i in range(1)] all=0 for i in range(N): all+=int(A[0][i]) FLAG=1/(4*M)*all flag=0 for i in range(N): if FLAG<=int(A[0][i]): flag+=1 if flag>=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, 1, 0, 662, 12, 652, 3, 4, 0, 25]]
5
118
#include <bits/stdc++.h> using namespace std; int N, M; vector<int> a; int main() { cin >> N >> M; a.resize(N); int sum = 0; for (int i = 0; i < N; i++) { cin >> a[i]; sum += a[i]; } sort(a.begin(), a.end()); reverse(a.begin(), a.end()); string ans; if (a[M - 1] >= sum / (4 * M)) ans = "...
#include <bits/stdc++.h> using namespace std; int N, M; vector<int> a; int main() { cin >> N >> M; a.resize(N); int sum = 0; for (int i = 0; i < N; i++) { cin >> a[i]; sum += a[i]; } sort(a.begin(), a.end()); reverse(a.begin(), a.end()); string ans; if ((double)a[M - 1] >= (double)sum / (4 *...
[["+", 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 <algorithm> #include <iostream> #include <vector> using namespace std; int main() { int N, M; int ans = 0; vector<int> v; cin >> N >> M; for (int i = 0; i < N; i++) { int A; cin >> A; ans = ans + A; v.push_back(A); } double t = double((double(ans) / 4) / M); sort(v.begin(), v.e...
#include <algorithm> #include <iostream> #include <vector> using namespace std; int main() { int N, M; int ans = 0; vector<int> v; cin >> N >> M; for (int i = 0; i < N; i++) { int A; cin >> A; ans = ans + A; v.push_back(A); } double t = double((double(ans) / 4) / M); sort(v.begin(), v.e...
[["-", 0, 14, 8, 9, 0, 1, 0, 16, 31, 22], ["-", 0, 14, 8, 9, 0, 1, 0, 16, 17, 151], ["-", 0, 14, 8, 9, 0, 1, 0, 16, 12, 22], ["-", 0, 30, 0, 14, 8, 9, 0, 1, 0, 35]]
1
143
#include <bits/stdc++.h> using namespace std; int desc(const void *a, const void *b) { return *(int *)b - *(int *)a; } int A[101]; int main() { int N, M, i; int sum; scanf("%d %d", &N, &M); for (i = 0; i < N; i++) scanf("%d", &A[i]); sum = 0; for (i = 0; i < N; i++) sum += A[i]; qsort(A, sizeo...
#include <bits/stdc++.h> using namespace std; int desc(const void *a, const void *b) { return *(int *)b - *(int *)a; } int A[101]; int main() { int N, M, i; int sum; scanf("%d %d", &N, &M); for (i = 0; i < N; i++) scanf("%d", &A[i]); sum = 0; for (i = 0; i < N; i++) sum += A[i]; qsort(A, sizeo...
[["+", 31, 16, 31, 69, 341, 342, 0, 16, 17, 33], ["+", 31, 16, 31, 69, 341, 342, 0, 16, 12, 13]]
1
177
#include <bits/stdc++.h> using namespace std; int main() { int n, m; cin >> n >> m; vector<int> a(n); int s = 0; for (int i = 0; i < n; i++) { cin >> a.at(i); s += a.at(i); } sort(a.begin(), a.end()); if (a.at(n - m) * 4 * m > s) { cout << "Yes" << endl; } else { cout << "No" << endl;...
#include <bits/stdc++.h> using namespace std; int main() { int n, m; cin >> n >> m; vector<int> a(n); int s = 0; for (int i = 0; i < n; i++) { cin >> a.at(i); s += a.at(i); } sort(a.begin(), a.end()); if (a.at(n - m) * 4 * m >= s) { cout << "Yes" << endl; } else { cout << "No" << endl...
[["-", 8, 9, 0, 57, 15, 339, 51, 16, 17, 47], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 17, 20]]
1
124
#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 db double #define el "\n" #define ld long double #define rep(i, n) for (long long i = 0; i < n; i++) #define rev(i, n) for (long long i =...
#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 db double #define el "\n" #define ld long double #define rep(i, n) for (long long i = 0; i < n; i++) #define rev(i, n) for (long long 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
338
def resolve(): N, M = map(int, input().split()) A = sorted(map(int, input().split()), reverse=True) ok_line = sum(A)/(4*M) cnt = 0 for a in A: if ok_line < a: cnt += 1 ans = True if M <= cnt else False return print("Yes" if ans else "No") if __name__ == "__main__": ...
def resolve(): N, M = map(int, input().split()) A = sorted(map(int, input().split()), reverse=True) ok_line = sum(A)/(4*M) cnt = 0 for a in A: if not (a < ok_line): cnt += 1 ans = True if M <= cnt else False return print("Yes" if ans else "No") if __name__ == "__main__"...
[["-", 0, 7, 8, 196, 0, 57, 15, 666, 0, 22], ["-", 0, 7, 8, 196, 0, 57, 15, 666, 667, 18], ["+", 0, 7, 8, 196, 0, 57, 15, 681, 0, 372], ["+", 8, 196, 0, 57, 15, 681, 28, 23, 0, 24], ["+", 0, 57, 15, 681, 28, 23, 0, 666, 667, 18], ["+", 0, 57, 15, 681, 28, 23, 0, 666, 0, 22], ["+", 8, 196, 0, 57, 15, 681, 28, 23, 0, 25]...
5
102
#include <algorithm> #include <cmath> #include <functional> #include <iomanip> #include <iostream> #include <queue> #include <set> #include <stdio.h> #include <string> #include <vector> #define rep(i, n) for (int i = 0; i < (int)n; i++) // n回繰り返す using namespace std; using ll = long long; using P = pair<int, int>; usin...
#include <algorithm> #include <cmath> #include <functional> #include <iomanip> #include <iostream> #include <queue> #include <set> #include <stdio.h> #include <string> #include <vector> #define rep(i, n) for (int i = 0; i < (int)n; i++) // n回繰り返す using namespace std; using ll = long long; using P = pair<int, int>; usin...
[["-", 0, 30, 0, 14, 8, 9, 0, 43, 0, 21], ["+", 0, 30, 0, 14, 8, 9, 0, 43, 0, 35], ["+", 0, 30, 0, 14, 8, 9, 0, 43, 39, 40], ["+", 0, 1, 0, 11, 12, 16, 12, 74, 0, 24], ["+", 0, 11, 12, 16, 12, 74, 39, 77, 39, 40], ["+", 0, 1, 0, 11, 12, 16, 12, 74, 0, 25]]
1
174
#include <bits/stdc++.h> using namespace std; int main(void) { int n, m; int sum = 0; int flag = 0; cin >> n >> m; vector<int> a(n); for (int i = 0; i < n; i++) { int tem; cin >> tem; a[i] = tem; sum = sum + tem; } sort(a.begin(), a.end()); reverse(a.begin(), a.end()); for (int...
#include <bits/stdc++.h> using namespace std; int main(void) { int n, m; double sum = 0; int flag = 0; cin >> n >> m; vector<int> a(n); for (int i = 0; i < n; i++) { int tem; cin >> tem; a[i] = tem; sum = sum + tem; } sort(a.begin(), a.end()); reverse(a.begin(), a.end()); for (...
[["-", 0, 30, 0, 14, 8, 9, 0, 43, 39, 40], ["+", 0, 30, 0, 14, 8, 9, 0, 43, 39, 40]]
1
193
#include <bits/stdc++.h> using namespace std; const int mod = 1000000007; #define ll long long int cmp(int a, int b) { return a > b; } int main() { int n, m, s = 0; cin >> n >> m; int a[105]; for (int i = 0; i < n; i++) { cin >> a[i]; s += a[i]; } sort(a, a + n, cmp); int f = 0; int g = s / 4 / ...
#include <bits/stdc++.h> using namespace std; const int mod = 1000000007; #define ll long long int cmp(int a, int b) { return a > b; } int main() { int n, m, s = 0; cin >> n >> m; int a[105]; for (int i = 0; i < n; i++) { cin >> a[i]; s += a[i]; } sort(a, a + n, cmp); int f = 0; double g = 1.0 *...
[["-", 0, 30, 0, 14, 8, 9, 0, 43, 39, 40], ["+", 0, 30, 0, 14, 8, 9, 0, 43, 39, 40], ["+", 49, 50, 51, 16, 31, 16, 31, 16, 31, 13], ["+", 49, 50, 51, 16, 31, 16, 31, 16, 17, 48], ["-", 0, 14, 8, 9, 0, 7, 15, 16, 12, 22], ["+", 0, 14, 8, 9, 0, 7, 15, 16, 12, 22]]
1
173
#include <bits/stdc++.h> #include <iostream> using namespace std; #define ll long long int #define mp(a, b) make_pair(a, b) #define pb(a) push_back(a) int main() { ll n, m; cin >> n >> m; ll a[n], i, r, c = 0, s = 0; for (i = 0; i < n; i++) { cin >> a[i]; s += a[i]; } sort(a, a + n); r = ceil(doub...
#include <bits/stdc++.h> #include <iostream> using namespace std; #define ll long long int #define mp(a, b) make_pair(a, b) #define pb(a) push_back(a) int main() { ll n, m; cin >> n >> m; ll a[n], i, r, c = 0, s = 0; for (i = 0; i < n; i++) { cin >> a[i]; s += a[i]; } sort(a, a + n); r = ceil(doub...
[["-", 0, 57, 15, 339, 51, 16, 12, 16, 17, 19], ["+", 0, 57, 15, 339, 51, 16, 12, 16, 17, 18]]
1
181
/* Name: Author: xiaruize Date: */ #include <bits/stdc++.h> using namespace std; #define ull unsigned long long #define MOD 1000000007 #define ALL(a) (a).begin(), (a).end() #define forn(i, n) for (int i = 0; i < int(n); i++) #define ll long long #define form(i, j, n) for (int i = int(j); i <= i...
/* Name: Author: xiaruize Date: */ #include <bits/stdc++.h> using namespace std; #define ull unsigned long long #define MOD 1000000007 #define ALL(a) (a).begin(), (a).end() #define forn(i, n) for (int i = 0; i < int(n); i++) #define ll long long #define form(i, j, n) for (int i = int(j); i <= i...
[["-", 0, 30, 0, 14, 8, 9, 0, 43, 39, 40], ["+", 0, 30, 0, 14, 8, 9, 0, 43, 39, 40], ["+", 0, 57, 15, 339, 51, 16, 31, 74, 0, 24], ["+", 15, 339, 51, 16, 31, 74, 39, 77, 39, 40], ["+", 0, 57, 15, 339, 51, 16, 31, 74, 0, 25]]
1
311
#include <bits/stdc++.h> using namespace std; int main() { int N, M; int goukei = 0; cin >> N; cin >> M; vector<int> vec(100); for (int i = 0; i < N; i++) { cin >> vec.at(i); goukei += vec.at(i); } // cout << goukei << endl; sort(vec.begin(), vec.end()); reverse(vec.begin(), vec.end()); ...
#include <bits/stdc++.h> using namespace std; int main() { int N, M; double goukei = 0; cin >> N; cin >> M; vector<int> vec(100); for (int i = 0; i < N; i++) { cin >> vec.at(i); goukei += vec.at(i); } // cout << goukei << endl; sort(vec.begin(), vec.end()); reverse(vec.begin(), vec.end());...
[["-", 0, 30, 0, 14, 8, 9, 0, 43, 39, 40], ["+", 0, 30, 0, 14, 8, 9, 0, 43, 39, 40]]
1
150
#include <math.h> #include <stdio.h> #include <stdlib.h> int main() { float n, m, count = 0; // scanf("%f %f "&sum,&m); // sum=117;m=3; int arr[10000], sum = 0; scanf("%f %f", &n, &m); for (int i = 0; i <= n - 1; i++) { scanf("%i", &arr[i]); sum += arr[i]; } float k = (sum / (4 * m)); int k1 =...
#include <math.h> #include <stdio.h> #include <stdlib.h> int main() { float n, m, count = 0; // scanf("%f %f "&sum,&m); // sum=117;m=3; int arr[10000], sum = 0; scanf("%f %f", &n, &m); for (int i = 0; i <= n - 1; i++) { scanf("%i", &arr[i]); sum += arr[i]; } float k = (sum / (4 * m)); int k1 =...
[["-", 8, 9, 0, 43, 49, 50, 51, 2, 63, 22], ["+", 8, 9, 0, 43, 49, 50, 51, 2, 63, 22]]
0
168
#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.at(i); sum += A.at(i); } sort(A.begin(), A.end(), std::greater<int>()); if (A.at(M - 1) < sum * 1 / (4...
#include <algorithm> #include <iostream> #include <vector> using namespace std; int main() { double N, M; cin >> N >> M; vector<double> A(N); double sum = 0; for (int i = 0; i < N; i++) { cin >> A.at(i); sum += A.at(i); } sort(A.begin(), A.end(), std::greater<int>()); if (A.at(M - 1) < (su...
[["-", 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, 57, 15, 339, 51, 16, 12, 23, 0, 24], ["+", 51, 16, 12, 23, 0, 16, 12, 23, 0, 25]]
1
144
import java.util.*; public class Main { public static void main(String args[]) { Scanner in = new Scanner(System.in); int N = in.nextInt(); int M = in.nextInt(); int A[] = new int[N]; int i; long p = 0, m = 0; for (i = 0; i < N; i++) { A[i] = in.nextInt(); p = p + A[i]; } ...
import java.util.*; public class Main { public static void main(String args[]) { Scanner in = new Scanner(System.in); int N = in.nextInt(); int M = in.nextInt(); int A[] = new int[N]; int i; long p = 0, m = 0; for (i = 0; i < N; i++) { A[i] = in.nextInt(); p = p + A[i]; } ...
[["-", 0, 503, 49, 200, 51, 74, 51, 492, 141, 22], ["+", 0, 503, 49, 200, 51, 74, 51, 492, 141, 22]]
3
190
#include <iostream> using namespace std; int main() { int n, m; float a[100], sum = 0; cin >> n >> m; for (int i = 0; i < n; i++) { cin >> a[i]; sum += a[i]; } int count = 0; for (int i = 0; i < n; i++) { if (a[i] > sum / (4 * m)) count++; } if (count >= m) cout << "Yes"; else...
#include <iostream> using namespace std; int main() { int n, m; float a[100], sum = 0; cin >> n >> m; for (int i = 0; i < n; i++) { cin >> a[i]; sum += a[i]; } int count = 0; for (int i = 0; i < n; i++) { if (a[i] >= sum / (4 * m)) count++; } if (count >= m) cout << "Yes"; els...
[["-", 8, 9, 0, 57, 15, 339, 51, 16, 17, 47], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 17, 20]]
1
124
N,M = map(int,input().split()) L= [int(x) for x in input().split()] L.sort(reverse=True) for x in range(M): if float(L[x]) < sum(L) // (4*M): print("No") exit() print("Yes")
N,M = map(int,input().split()) L= [int(x) for x in input().split()] L.sort(reverse=True) for x in range(M): if float(L[x]) < sum(L) / (4*M): print("No") exit() print("Yes")
[["-", 8, 196, 0, 57, 15, 666, 0, 657, 17, 676], ["+", 8, 196, 0, 57, 15, 666, 0, 657, 17, 85]]
5
85
#include <algorithm> #include <cctype> #include <cmath> #include <cstdio> #include <cstdlib> #include <cstring> #include <ctime> #include <iomanip> #include <iostream> #include <map> #include <queue> #include <set> #include <sstream> #include <stack> #include <string> #include <utility> #include <vector> using namespa...
#include <algorithm> #include <cctype> #include <cmath> #include <cstdio> #include <cstdlib> #include <cstring> #include <ctime> #include <iomanip> #include <iostream> #include <map> #include <queue> #include <set> #include <sstream> #include <stack> #include <string> #include <utility> #include <vector> using namespa...
[["-", 36, 36, 36, 36, 0, 30, 0, 43, 39, 40], ["+", 36, 36, 36, 36, 0, 30, 0, 43, 39, 78], ["-", 0, 30, 0, 14, 8, 9, 0, 43, 39, 40], ["+", 0, 30, 0, 14, 8, 9, 0, 43, 39, 78], ["-", 8, 9, 0, 57, 15, 339, 51, 16, 17, 47], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 17, 20]]
1
260
N,M = map(int,input().split()) A = list(map(int,input().split())) K = 0 L = 0 for i in range(N): K = K + int(A[i]) j = 0 while L < M and j < N: if int(A[j]) >= (K/4*M): L = L + 1 j = j + 1 if L < M: print('No') elif L == M: print('Yes')
N,M = map(int,input().split()) A = list(map(int,input().split())) K = 0 L = 0 for i in range(N): K = K + int(A[i]) j = 0 while L < M and j < N: if int(A[j]) >= (K/(4*M)): L = L + 1 j = j + 1 if L < M: print('No') elif L == M: print('Yes')
[["+", 15, 666, 0, 23, 0, 657, 12, 23, 0, 24], ["+", 15, 666, 0, 23, 0, 657, 12, 23, 0, 25]]
5
119
#include <bits/stdc++.h> using namespace std; int main() { int m, n, cnt = 0, a, b, flag; cin >> n >> m; vector<int> A(n); for (int i = 0; i < n; i++) { cin >> A.at(i); cnt += A.at(i); } a = cnt / (4 * m); b = cnt / (4.0 * m); flag = (a == b); cnt = 0; for (int i = 0; i < n; i++) { if ((...
#include <bits/stdc++.h> using namespace std; int main() { int m, n, cnt = 0, a, flag; double b; cin >> n >> m; vector<int> A(n); for (int i = 0; i < n; i++) { cin >> A.at(i); cnt += A.at(i); } a = cnt / (4 * m); b = cnt / (4.0 * m); flag = (a == b); cnt = 0; for (int i = 0; i < n; i++) { ...
[["-", 0, 30, 0, 14, 8, 9, 0, 43, 49, 22], ["-", 0, 30, 0, 14, 8, 9, 0, 43, 0, 21], ["+", 0, 30, 0, 14, 8, 9, 0, 43, 0, 35], ["+", 0, 30, 0, 14, 8, 9, 0, 43, 39, 40], ["+", 0, 30, 0, 14, 8, 9, 0, 43, 49, 22]]
1
182
#include <bits/stdc++.h> using namespace std; int main() { int n, m; cin >> n >> m; vector<int> a(n); int sum = 0; for (int i = 0; i < n; ++i) { cin >> a[i]; sum += a[i]; } int tmp = sum / (4 * m); int cnt = 0; for (int i = 0; i < n; ++i) { if (a[i] >= tmp) { cnt++; } } if (c...
#include <bits/stdc++.h> using namespace std; int main() { int n; float m; cin >> n >> m; vector<int> a(n); int sum = 0; for (int i = 0; i < n; ++i) { cin >> a[i]; sum += a[i]; } float tmp = sum / (4 * m); int cnt = 0; for (int i = 0; i < n; ++i) { if (a[i] >= tmp) { cnt++; } ...
[["-", 0, 30, 0, 14, 8, 9, 0, 43, 0, 21], ["+", 0, 30, 0, 14, 8, 9, 0, 43, 0, 35], ["+", 0, 30, 0, 14, 8, 9, 0, 43, 39, 40], ["-", 0, 30, 0, 14, 8, 9, 0, 43, 39, 40]]
1
140
N, M = map(int, input().split()) A = list(map(int, input().split())) ans = 0 total = 0 for i in range(len(A)): total += A[i] A = sorted(A, reverse=True) for i in range(M): if(A[i] >= total/4*M): ans = 1 else: ans = 0 if(ans == 1): print("Yes") else: print("No")
N, M = map(int, input().split()) A = list(map(int, input().split())) ans = 0 total = 0 for i in range(len(A)): total += A[i] A = sorted(A, reverse=True) for i in range(M): if(A[i] >= total/(4*M)): ans += 1 else: ans += 0 if(M == ans): print("Yes") else: print("No")
[["+", 15, 23, 0, 666, 0, 657, 12, 23, 0, 24], ["+", 15, 23, 0, 666, 0, 657, 12, 23, 0, 25], ["-", 0, 57, 64, 196, 0, 1, 0, 662, 0, 32], ["+", 0, 57, 64, 196, 0, 1, 0, 677, 17, 107], ["-", 75, 76, 8, 196, 0, 1, 0, 662, 0, 32], ["+", 75, 76, 8, 196, 0, 1, 0, 677, 17, 107], ["-", 0, 656, 0, 57, 15, 23, 0, 666, 0, 22], ["...
5
117
#include <stdio.h> int main(void) { int N, i, count = 0; int M, sig = 0; double lim; scanf("%d %d", &N, &M); int A[N]; for (i = 0; i < N; i++) { scanf("%d", &A[i]); sig = sig + A[i]; } lim = (double)sig / 4 / M; for (i = 0; i < N; i++) { if ((double)A[i] > lim) { count++; } } ...
#include <stdio.h> int main(void) { int N, i, count = 0; int M, sig = 0; double lim; scanf("%d %d", &N, &M); int A[N]; for (i = 0; i < N; i++) { scanf("%d", &A[i]); sig = sig + A[i]; } lim = (double)sig / 4 / M; for (i = 0; i < N; i++) { if ((double)A[i] >= lim) { count++; } }...
[["-", 8, 9, 0, 57, 15, 23, 0, 16, 17, 47], ["+", 8, 9, 0, 57, 15, 23, 0, 16, 17, 20]]
0
157
#!/usr/bin/env python3 def main(): N,M = map(int, input().split()) votes = [int(s) for s in input().split()] votes_sum = sum(votes) border_line = votes_sum / (4*M) result = 'Yes' votes.sort(reverse=True) for i in range(M): if votes[i] <= border_line: result = 'No' ...
#!/usr/bin/env python3 def main(): N,M = map(int, input().split()) votes = [int(s) for s in input().split()] votes_sum = sum(votes) border_line = votes_sum / (4*M) result = 'Yes' votes.sort(reverse=True) for i in range(M): if votes[i] < border_line: result = 'No' ...
[["-", 0, 7, 8, 196, 0, 57, 15, 666, 667, 19], ["+", 0, 7, 8, 196, 0, 57, 15, 666, 667, 18]]
5
104
#include <stdio.h> #include <stdlib.h> int comp(const void *a, const void *b) { return (*((int *)b) - *((int *)a)); } int main(int argc, char *argv[]) { int n, m; int a[101]; int t1 = 0; int t2 = 0; scanf("%d %d", &n, &m); for (int i = 0; i < n; i++) scanf("%d", &a[i]); qsort(a, n, sizeof(int), co...
#include <stdio.h> #include <stdlib.h> int comp(const void *a, const void *b) { return (*((int *)b) - *((int *)a)); } int main(int argc, char *argv[]) { int n, m; int a[101]; int t1 = 0; int t2 = 0; scanf("%d %d", &n, &m); for (int i = 0; i < n; i++) scanf("%d", &a[i]); qsort(a, n, sizeof(int), co...
[["-", 15, 23, 0, 16, 12, 16, 31, 16, 12, 13], ["+", 15, 23, 0, 16, 12, 16, 31, 16, 12, 13]]
0
222
#include <cstdio> #include <iostream> using namespace std; int n, m, a[1015]; long long sum = 0; int num; int main() { cin >> n >> m; for (int i = 1; i <= n; ++i) { cin >> a[i]; sum += a[i]; } double ans = sum * 1.0 / ((double)m * 4.0); for (int i = 1; i <= n; ++i) { if (a[i] > ans) num++; ...
#include <cstdio> #include <iostream> using namespace std; long long n, m, a[1015]; long long sum = 0; int num; int main() { cin >> n >> m; for (int i = 1; i <= n; ++i) { cin >> a[i]; sum += a[i]; } double ans = sum * 1.0 / ((double)m * 4.0); for (int i = 1; i <= n; ++i) { if (a[i] >= ans) n...
[["-", 36, 36, 36, 36, 0, 30, 0, 43, 39, 40], ["+", 36, 36, 0, 30, 0, 43, 39, 86, 0, 96], ["-", 8, 9, 0, 57, 15, 339, 51, 16, 17, 47], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 17, 20]]
1
139
#include <bits/stdc++.h> #include <math.h> #include <stdio.h> using namespace std; using vi = vector<int>; using vvi = vector<vector<int>>; using ll = long long int; int main() { ll N, M; cin >> N >> M; vector<int> vec(N); ll sum = 0; for (int i = 0; i < N; i++) { ll p; cin >> p; sum += p; ve...
#include <bits/stdc++.h> #include <math.h> #include <stdio.h> using namespace std; using vi = vector<int>; using vvi = vector<vector<int>>; using ll = long long int; int main() { ll N, M; cin >> N >> M; vector<int> vec(N); ll sum = 0; for (int i = 0; i < N; i++) { ll p; cin >> p; sum += p; ve...
[["-", 51, 16, 12, 16, 12, 23, 0, 16, 12, 22], ["+", 51, 16, 12, 16, 12, 23, 0, 16, 12, 22]]
1
191
#include <iostream> #include <vector> using namespace std; int main() { int n, m; int famous = 0; double judge = 0; cin >> n >> m; vector<int> a(n); for (int i = 0; i < n; i++) { cin >> a[i]; judge += a[i]; } judge = judge / (4 * m); for (int j = 0; j < n; j++) { if (a[j] > judge) { ...
#include <iostream> #include <vector> using namespace std; int main() { int n, m; int famous = 0; double judge = 0; cin >> n >> m; vector<int> a(n); for (int i = 0; i < n; i++) { cin >> a[i]; judge += a[i]; } judge = judge / (4 * m); for (int j = 0; j < n; j++) { if (a[j] >= judge) { ...
[["-", 8, 9, 0, 57, 15, 339, 51, 16, 17, 47], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 17, 20]]
1
146
n,m = input().split(" ") n=int(n) m=int(m) arr = list(map(int,input().split(" "))) x = sum(arr) frac = x//(m*4) ans=0 for i in range(len(arr)): if(arr[i]>=frac): ans+=1 if(ans>=m): print("Yes") else: print("No")
n,m = input().split(" ") n=int(n) m=int(m) arr = list(map(int,input().split(" "))) x = sum(arr) frac = x/(m*4) ans=0 for i in range(len(arr)): if(arr[i]>=frac): ans+=1 if(ans>=m): print("Yes") else: print("No")
[["-", 0, 656, 0, 1, 0, 662, 12, 657, 17, 676], ["+", 0, 656, 0, 1, 0, 662, 12, 657, 17, 85]]
5
109
import sys a = list(map(int,input().split())) b = list(map(int,input().split())) N = a[0] M = a[1] count = 0 b_sum = sum(b) c = sorted(b,reverse = True) for i in range(0,N-1): if c[i] >= (b_sum/(4*M)): count+=1 else: break if count >= M: print('Yes') else: print('No')
import sys a = list(map(int,input().split())) b = list(map(int,input().split())) N = a[0] M = a[1] count = 0 b_sum = sum(b) c = sorted(b,reverse = True) for i in range(0,N): if c[i] >= (b_sum/(4*M)): count+=1 else: break if count >= 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
120
#include <stdio.h> int main(void) { int N, M, i, p, s; int a[1000]; float t; p = 0; s = 0; scanf("%d %d", &N, &M); for (i = 0; i < N; i++) { scanf("%d", &a[i]); s += a[i]; } t = s / (4 * M); for (i = 0; i < N; i++) { if (a[i] >= t) p++; } if (p >= M) printf("Yes"); else ...
#include <stdio.h> int main(void) { int N, M, i, p; int a[1000]; float s, t; p = 0; s = 0; scanf("%d %d", &N, &M); for (i = 0; i < N; i++) { scanf("%d", &a[i]); s += a[i]; } t = s / (4 * M); for (i = 0; i < N; i++) { if (a[i] >= t) p++; } if (p >= M) printf("Yes"); else ...
[["-", 0, 30, 0, 14, 8, 9, 0, 43, 0, 21], ["-", 0, 30, 0, 14, 8, 9, 0, 43, 49, 22], ["+", 0, 30, 0, 14, 8, 9, 0, 43, 49, 22], ["+", 0, 30, 0, 14, 8, 9, 0, 43, 0, 21]]
0
146
N, M = map(int, input().split()) A = list(map(int, input().split())) # [1, 2, 3, 4] になる sum = sum(A) vote = sum/(4*M) judge = 0 def check(M,A,N,judge,vote): while 1: num = A.pop(A.index(max(A))) if num > vote: judge+=1 else: return 'No' if judge == M: ...
N, M = map(int, input().split()) A = list(map(int, input().split())) # [1, 2, 3, 4] になる vote = sum(A)/(4*M) judge = 0 def check(M,A,N,judge,vote): while 1: num = A.pop(A.index(max(A))) if num >= vote: judge+=1 else: return 'No' if judge == M: re...
[["-", 36, 36, 0, 656, 0, 1, 0, 662, 31, 22], ["+", 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, 662, 12, 657, 31, 22], ["-", 0, 52, 8, 196, 0, 57, 15, 666, 667, 47], ["+", 0, 52, 8, 196, 0, 57, 15, 666, 667, 20]]
5
123
N,M = map(int,input().split()) A = list(map(int,input().split())) ans = "Yes" sum_M = sum(A) an = 0 for i in range(M): if A[i] >= sum_M/(4*M): an += 1 if an<M: ans = "No" print(ans)
N,M = map(int,input().split()) A = list(map(int,input().split())) ans = "Yes" sum_M = sum(A) an = 0 for i in range(len(A)): if A[i] >= sum_M/(4*M): an += 1 if an<M: ans = "No" print(ans)
[["-", 0, 656, 0, 7, 12, 652, 3, 4, 0, 22], ["+", 0, 7, 12, 652, 3, 4, 0, 652, 63, 22], ["+", 12, 652, 3, 4, 0, 652, 3, 4, 0, 24], ["+", 12, 652, 3, 4, 0, 652, 3, 4, 0, 22], ["+", 12, 652, 3, 4, 0, 652, 3, 4, 0, 25]]
5
86