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 <cmath> #include <iomanip> #include <iostream> #include <map> #include <numeric> #include <queue> #include <set> #include <sstream> #include <stack> #include <string> #include <vector> typedef unsigned long long ull; typedef long long ll; typedef long double ld; using namespace std; const ...
#include <algorithm> #include <cmath> #include <iomanip> #include <iostream> #include <map> #include <numeric> #include <queue> #include <set> #include <sstream> #include <stack> #include <string> #include <vector> typedef unsigned long long ull; typedef long long ll; typedef long double ld; using namespace std; const ...
[["-", 8, 9, 0, 57, 15, 339, 51, 16, 17, 47], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 17, 20], ["+", 0, 30, 0, 14, 8, 9, 0, 37, 0, 38], ["+", 0, 30, 0, 14, 8, 9, 0, 37, 0, 13], ["+", 0, 30, 0, 14, 8, 9, 0, 37, 0, 35]]
1
304
n, m = map(int, input().split()) a = list(map(int, input().split())) num = sum(a) cnt = 0 for i in range(n): if a[i] < num//(4*m): continue else: cnt += 1 if cnt >= m: print("Yes") else: print("No")
n, m = map(int, input().split()) a = list(map(int, input().split())) num = sum(a) cnt = 0 for i in range(n): if a[i] < num/(4*m): continue else: cnt += 1 if cnt >= 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
89
n, m = map(int, input().split()) a = sorted(map(int, input().split()))[::-1] i = 0 for j in range(n): i = i + a[j] x = i / (4 * m) print("Yes" if a[m] >= x else "No")
n, m = map(int, input().split()) a = sorted(map(int, input().split()))[::-1] i = 0 for j in range(n): i = i + a[j] x = i / (4 * m) print("Yes" if a[m - 1] >= x else "No")
[["+", 0, 41, 0, 666, 0, 206, 206, 657, 17, 33], ["+", 0, 41, 0, 666, 0, 206, 206, 657, 12, 612]]
5
84
#include <stdio.h> int main(void) { int n, m; scanf("%d %d", &n, &m); double a[n]; int h = 0; double s = 0; int i; for (i = 0; i < n; i++) { scanf("%f", &a[i]); s = s + a[i]; } for (i = 0; i < n; i++) { if (a[i] >= s / (4 * m)) { h++; } } if (h >= m) { printf("Yes"); } ...
#include <stdio.h> int main(void) { int n, m; scanf("%d %d", &n, &m); long double a[n]; int h = 0; double s = 0; int i; for (i = 0; i < n; i++) { scanf("%Lf", &a[i]); s = s + a[i]; } for (i = 0; i < n; i++) { if (a[i] >= s / (4 * m)) { h++; } } if (h >= m) { printf("Yes"...
[["+", 0, 14, 8, 9, 0, 43, 39, 86, 0, 96], ["-", 0, 1, 0, 2, 3, 4, 0, 5, 0, 6], ["+", 0, 1, 0, 2, 3, 4, 0, 5, 0, 6]]
0
146
import math n,m = map(int, input().split()) A = list(map(int, input().split())) line = math.floor(sum(A) / (4 * m)) cnt = 0 for a in A: if a >= line: cnt += 1 if cnt >= m: print('Yes') break else: print('No')
from decimal import Decimal n,m = map(int, input().split()) A = list(map(int, input().split())) line = Decimal(sum(A) / (4 * m)) cnt = 0 for a in A: if a >= line: cnt += 1 if cnt >= m: print('Yes') break else: print('No')
[["+", 36, 36, 36, 36, 0, 656, 0, 686, 0, 314], ["+", 36, 36, 0, 656, 0, 686, 687, 673, 0, 22], ["-", 36, 36, 0, 656, 0, 596, 141, 673, 0, 22], ["+", 36, 36, 0, 656, 0, 686, 141, 673, 0, 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, ...
5
88
n, m = map(int, input().split()) a = sorted(map(int, input().split()), reverse = True) total = sum(a) cnt = 0 for i in a: if i * 4 * m > total: cnt += 1 else: break if cnt >= m: print("Yes") else: print("No")
n, m = map(int, input().split()) a = sorted(map(int, input().split()), reverse = True) total = sum(a) cnt = 0 for i in a: if i * 4 * m >= total: cnt += 1 else: break if cnt >= 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
85
def main(): n,m = map(int, input().split()) a = list(map(int,input().strip().split())) t = sum(a) c = 0 for aa in a: if aa >= int(t / (4*m)): c += 1 if c >= m: print("Yes") return else: print("No") return main()
def main(): n,m = map(int, input().split()) a = list(map(int,input().strip().split())) t = sum(a) c = 0 for aa in a: if aa >= t / (4*m): c += 1 if c >= m: print("Yes") return else: print("No") return main()
[["-", 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
97
N,M = map(int,input().split()) A = list(map(int,input().split())) a = sum(A)*(1/(4*M)) cnt = 0 for i in range(N): if A[i] > a: cnt += 1 if cnt >= M: print("Yes") else: print("No")
N,M = map(int,input().split()) A = list(map(int,input().split())) a = sum(A)*(1/(4*M)) cnt = 0 for i in range(N): if A[i] >= a: cnt += 1 if cnt >= M: print("Yes") else: print("No")
[["-", 0, 7, 8, 196, 0, 57, 15, 666, 667, 47], ["+", 0, 7, 8, 196, 0, 57, 15, 666, 667, 20]]
5
90
#include <bits/stdc++.h> using namespace std; int main() { int n, m; cin >> n >> m; vector<int> a(n); int total = 0; for (int i = 0; i < n; i++) { cin >> a.at(i); total += a.at(i); } int ans = 0; sort(a.begin(), a.end()); reverse(a.begin(), a.end()); if (a.at(m - 1) * 4 * m > total) ...
#include <bits/stdc++.h> using namespace std; int main() { int n, m; cin >> n >> m; vector<int> a(n); int total = 0; 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()); if (a.at(m - 1) * 4 * m >= total) cout << "Yes" ...
[["-", 0, 30, 0, 14, 8, 9, 0, 43, 39, 40], ["-", 0, 14, 8, 9, 0, 43, 49, 50, 49, 22], ["-", 0, 14, 8, 9, 0, 43, 49, 50, 0, 32], ["-", 0, 14, 8, 9, 0, 43, 49, 50, 51, 13], ["-", 0, 30, 0, 14, 8, 9, 0, 43, 0, 35], ["-", 8, 9, 0, 57, 15, 339, 51, 16, 17, 47], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 17, 20]]
1
143
n,m = map(int,input().split()) a = list(map(int,input().split())) if len([i for i in a if i >= sum(a)/(4*m)]) > m: print("Yes") else: print("No")
n,m = map(int,input().split()) a = list(map(int,input().split())) if len([i for i in a if i >= sum(a)/(4*m)]) >= 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
74
n,m=map(int,input().split()) a=list(map(int,input().split())) limit=sum(a)/(4*m) c=0 for aa in a: if aa >=limit: c+=1 else: pass if c>=m: print('No') else: print('Yes')
n,m=map(int,input().split()) a=list(map(int,input().split())) limit=sum(a)/(4*m) c=0 for aa in a: if aa >=limit: c+=1 else: pass if c>=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
83
#include <stdio.h> int main() { int n, m, vote = 0, count = 0, a[100]; scanf("%d %d", &n, &m); for (int i = 0; i < n; i++) { scanf("%d", &a[i]); } for (int i = 0; i < n; i++) { vote = vote + a[i]; } for (int i = 0; i < n; i++) { if (a[i] >= vote / (4 * m)) { count = count + 1; } } ...
#include <stdio.h> int main() { int n, m, vote = 0, count = 0, a[100]; scanf("%d %d", &n, &m); for (int i = 0; i < n; i++) { scanf("%d", &a[i]); } for (int i = 0; i < n; i++) { vote = vote + a[i]; } for (int i = 0; i < n; i++) { if (a[i] >= vote / (4.0 * m)) { count = count + 1; } ...
[["-", 0, 16, 12, 16, 12, 23, 0, 16, 31, 13], ["+", 0, 16, 12, 16, 12, 23, 0, 16, 31, 13]]
0
162
x,y=gets.split.map!(&:to_i) s=gets.split.map!(&:to_i) s=s.sort.reverse max=s.sum if s[y-1]>=(max/(4*y)) puts "Yes" else puts "No" end
x,y=gets.split.map!(&:to_f) s=gets.split.map!(&:to_i) s=s.sort.reverse max=s.sum if s[y-1]>=(max/(4*y)) puts "Yes" else puts "No" end
[["-", 0, 662, 12, 652, 3, 4, 0, 752, 0, 753], ["+", 0, 662, 12, 652, 3, 4, 0, 752, 0, 753]]
4
63
x,y=gets.split.map!(&:to_i) s=gets.split.map!(&:to_i) s=s.sort.reverse max=s.sum if s[y-1]>=(max/(4*y)) puts "Yes" else puts "No" end
x,y=gets.split.map!(&:to_f) s=gets.split.map!(&:to_i) s=s.sort.reverse max=s.sum if s[y-1]>=(max/(4*y)).to_f puts "Yes" else puts "No" end
[["-", 0, 662, 12, 652, 3, 4, 0, 752, 0, 753], ["+", 0, 662, 12, 652, 3, 4, 0, 752, 0, 753], ["+", 0, 493, 0, 121, 15, 738, 12, 652, 17, 131], ["+", 0, 493, 0, 121, 15, 738, 12, 652, 735, 22]]
4
63
#include <bits/stdc++.h> #define rep(i, cc, n) for (int i = cc; i <= n; ++i) using namespace std; int main() { int N, M; cin >> N >> M; int sum = 0; vector<int> A(N); rep(i, 0, N - 1) { cin >> A[i]; sum += A[i]; } sort(begin(A), end(A), greater<int>()); int required = sum / 4 / M; bool ok ...
#include <bits/stdc++.h> #define rep(i, cc, n) for (int i = cc; i <= n; ++i) using namespace std; int main() { int N, M; cin >> N >> M; int sum = 0; vector<int> A(N); rep(i, 0, N - 1) { cin >> A[i]; sum += A[i]; } sort(begin(A), end(A), greater<int>()); double required = sum / 4.0 / M; boo...
[["-", 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, 16, 12, 13], ["+", 0, 43, 49, 50, 51, 16, 31, 16, 12, 13]]
1
151
#include <algorithm> #include <cmath> #include <iomanip> #include <iostream> #include <vector> using namespace std; using ll = long long; int main() { int n, m; cin >> n >> m; int count = 0; vector<int> a(n); for (int i = 0; i < n; i++) { cin >> a.at(i); count += a.at(i); } sort(a.rbegin(), a.re...
#include <algorithm> #include <cmath> #include <iomanip> #include <iostream> #include <vector> using namespace std; using ll = long long; int main() { double n, m; cin >> n >> m; double count = 0; vector<int> a(n); for (int i = 0; i < n; i++) { cin >> a.at(i); count += a.at(i); } sort(a.rbegin()...
[["-", 0, 30, 0, 14, 8, 9, 0, 43, 39, 40], ["+", 0, 30, 0, 14, 8, 9, 0, 43, 39, 40]]
1
169
n,m=map(int,input().split()) a=list(map(int,input().split())) a_sum=sum(a) count=0 for i in a: if i>=a_sum/4*m: count+=1 if count>=m: print("Yes") else: print("No")
n,m=map(int,input().split()) a=list(map(int,input().split())) a_sum=sum(a) count=0 for i in a: if i>=a_sum/(4*m): count+=1 if count>=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
#include <stdio.h> int main(void) { int N, M; int i; int A[1010]; int s = 0; scanf("%d %d", &N, &M); for (i = 0; i < N; i++) { scanf("%d", &A[i]); s = s + A[i]; } double S = s / 4.0 / M; int j = 0; for (i = 0; i < N; i++) { if (A[i] >= S) { j = j + 1; } } if (j > M) { ...
#include <stdio.h> int main(void) { int N, M; int i; int A[1010]; int s = 0; scanf("%d %d", &N, &M); for (i = 0; i < N; i++) { scanf("%d", &A[i]); s = s + A[i]; } double S = s / 4.0 / M; int j = 0; for (i = 0; i < N; i++) { if (A[i] >= S) { j = j + 1; } } if (j >= M) { ...
[["-", 8, 9, 0, 57, 15, 23, 0, 16, 17, 47], ["+", 8, 9, 0, 57, 15, 23, 0, 16, 17, 20]]
0
154
# ABC161 # B Popular Vote N, M = map(int, input().split()) # N種類 M個選ぶ a = sorted(list(map(int, input().split())),reverse=True) x = sum(a) q = x / 4 * M b =[] for i in range(M): b.append(a[i]) b = sorted(b) for j in b: if j < q: print('No') exit() print('Yes')
# ABC161 # B Popular Vote N, M = map(int, input().split()) # N種類 M個選ぶ a = sorted(list(map(int, input().split())),reverse=True) x = sum(a) q = x / (4 * M) b =[] for i in range(M): b.append(a[i]) b = sorted(b) for j in b: if j < q: print('No') exit() print('Yes')
[["+", 0, 1, 0, 662, 12, 657, 12, 23, 0, 24], ["+", 0, 1, 0, 662, 12, 657, 12, 23, 0, 25]]
5
108
N,M = gets.strip.split.map(&:to_i) vote = gets.strip.split.map(&:to_i) S = vote.sum sum = 0 (0..N-1).each do |i| vote[i] >= (S.to_f)/(4*M) sum += 1 end if sum >= M then puts "Yes" else puts "No" end
N,M = gets.strip.split.map(&:to_i) vote = gets.strip.split.map(&:to_i) S = vote.sum sum = 0 (0..N-1).each do |i| if vote[i] >= (S.to_f)/(4*M) then sum += 1 end end if sum >= M then puts "Yes" else puts "No" end
[["+", 0, 652, 196, 737, 8, 736, 0, 121, 0, 121], ["+", 196, 737, 8, 736, 0, 121, 64, 749, 0, 749], ["+", 0, 652, 196, 737, 8, 736, 0, 121, 0, 444]]
4
84
#include <bits/stdc++.h> using namespace std; #define rep(i, n) for (int i = 0; i < (int)(n); i++) #define _GLIBCXX_DEBUG #define INF 1e8 typedef long long int ll; const double PI = acos(-1); using Graph = vector<vector<int>>; int main() { int n, m; cin >> n >> m; vector<int> a(n); rep(i, n) { cin >> a[i]; } ...
#include <bits/stdc++.h> using namespace std; #define rep(i, n) for (int i = 0; i < (int)(n); i++) #define _GLIBCXX_DEBUG #define INF 1e8 typedef long long int ll; const double PI = acos(-1); using Graph = vector<vector<int>>; int main() { int n, m; cin >> n >> m; vector<int> a(n); rep(i, n) { cin >> a[i]; } ...
[["+", 0, 43, 49, 50, 51, 16, 31, 2, 63, 40], ["+", 49, 50, 51, 16, 31, 2, 3, 4, 0, 24], ["+", 49, 50, 51, 16, 31, 2, 3, 4, 0, 25]]
1
165
N, M = [int(i) for i in input().split(' ')] A = [int(i) for i in input().split(' ')] th = sum(A) / (4 * M) print('Yes' if len([a for a in A if a >= th]) >= N else 'No')
N, M = [int(i) for i in input().split(' ')] A = [int(i) for i in input().split(' ')] th = sum(A) / (4 * M) print('Yes' if len([a for a in A if a >= th]) >= M else 'No')
[["-", 0, 652, 3, 4, 0, 41, 0, 666, 0, 22], ["+", 0, 652, 3, 4, 0, 41, 0, 666, 0, 22]]
5
83
#include <stdio.h> int main(void) { int n, m, i; 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++) { if (a[i] > sum / 4 * m) count++; } if (count >= m) printf("Yes"); else p...
#include <stdio.h> int main(void) { int n, m, i; 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++) { if (a[i] * 4 * m >= sum) count++; } if (count >= m) printf("Yes"); else ...
[["-", 8, 9, 0, 57, 15, 23, 0, 16, 17, 47], ["-", 15, 23, 0, 16, 12, 16, 31, 16, 31, 22], ["-", 15, 23, 0, 16, 12, 16, 31, 16, 17, 85], ["+", 15, 23, 0, 16, 31, 16, 31, 16, 17, 48], ["+", 8, 9, 0, 57, 15, 23, 0, 16, 17, 20], ["+", 8, 9, 0, 57, 15, 23, 0, 16, 12, 22]]
0
134
#include <bits/stdc++.h> using namespace std; typedef long long lol; //マクロ // forループ関係 //引数は、(ループ内変数,動く範囲)か(ループ内変数,始めの数,終わりの数)、のどちらか // Dがついてないものはループ変数は1ずつインクリメントされ、Dがついてるものはループ変数は1ずつデクリメントされる #define REP(i, n) for (lol i = 0; i < lol(n); i++) #define REPD(i, n) for (lol i = n - 1; i >= 0; i--) #define FOR(i, a, b) fo...
#include <bits/stdc++.h> using namespace std; typedef long long lol; //マクロ // forループ関係 //引数は、(ループ内変数,動く範囲)か(ループ内変数,始めの数,終わりの数)、のどちらか // Dがついてないものはループ変数は1ずつインクリメントされ、Dがついてるものはループ変数は1ずつデクリメントされる #define REP(i, n) for (lol i = 0; i < lol(n); i++) #define REPD(i, n) for (lol i = n - 1; i >= 0; i--) #define FOR(i, a, b) fo...
[["+", 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, 14, 8, 9, 0, 57, 15, 339, 0, 24], ["+", 15, 339, 51, 16, 31, 74, 39, 77, 39, 40], ["+", 0, 57, 15, 339, 51, 16, 31, 74, 0, 25]]
1
307
n,k = map(int,input().split()) A = list(map(int,input().split())) allvote=0 allvote=sum(A) # print( allvote ) c=0 for a in A: if a>=allvote/(4*k) : c+=1 if c>=k : ans = "Yes" else: ans = "No" print(ans,allvote,c)
n,k = map(int,input().split()) A = list(map(int,input().split())) allvote=0 allvote=sum(A) # print( allvote ) c=0 for a in A: if a>=allvote/(4*k) : c+=1 if c>=k : ans = "Yes" else: ans = "No" print(ans)
[["-", 0, 656, 0, 1, 0, 652, 3, 4, 0, 21], ["-", 0, 656, 0, 1, 0, 652, 3, 4, 0, 22]]
5
90
#include <stdio.h> int main() { int n, m; scanf("%d%d", &n, &m); int a[n]; int big; int sum = 0; for (int i = 0; i < n; i++) scanf("%d", &a[i]); for (int i = 0; i < n; i++) { sum = sum + a[i]; } // printf("%d\n",sum); for (int i = 0; i < n; i++) { for (int j = i + 1; j < n; j++) { ...
#include <stdio.h> int main() { int n, m; scanf("%d%d", &n, &m); int a[n]; int big; int sum = 0; for (int i = 0; i < n; i++) scanf("%d", &a[i]); for (int i = 0; i < n; i++) { sum = sum + a[i]; } // printf("%d sum\n",sum); for (int i = 0; i < n; i++) { for (int j = i + 1; j < n; j++) {...
[["-", 8, 9, 0, 57, 15, 23, 0, 16, 17, 18], ["-", 0, 57, 15, 23, 0, 16, 12, 16, 31, 22], ["-", 0, 57, 15, 23, 0, 16, 12, 16, 17, 85], ["-", 15, 23, 0, 16, 12, 16, 12, 23, 0, 24], ["+", 15, 23, 0, 16, 31, 16, 31, 16, 17, 48], ["-", 15, 23, 0, 16, 12, 16, 12, 23, 0, 25], ["+", 8, 9, 0, 57, 15, 23, 0, 16, 17, 18], ["+", 8...
0
234
import java.util.Scanner; import java.util.stream.Stream; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int[] line = Stream.of(sc.nextLine().split(" ", 0)) .mapToInt(Integer::parseInt) .toArray(); int[] line2 ...
import java.util.Scanner; import java.util.stream.Stream; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int[] line = Stream.of(sc.nextLine().split(" ", 0)) .mapToInt(Integer::parseInt) .toArray(); int[] line2 ...
[["+", 49, 200, 51, 16, 12, 74, 39, 511, 0, 512], ["+", 0, 503, 49, 200, 51, 16, 12, 74, 0, 25], ["+", 49, 200, 51, 16, 12, 74, 51, 23, 0, 24], ["-", 8, 196, 0, 57, 15, 15, 0, 16, 17, 47], ["+", 8, 196, 0, 57, 15, 15, 0, 16, 17, 20]]
3
221
N, M = list(map(lambda x: int(x), input().split(" "))) A = list(map(lambda y: int(y), input().split(" "))) A.sort() print("Yes") if 0.25 * sum(A) / M <= A[M - 1] else print("No")
N, M = list(map(lambda x: int(x), input().split(" "))) A = list(map(lambda y: int(y), input().split(" "))) A.sort(reverse=True) print("Yes") if 0.25 * sum(A) / M <= A[M - 1] 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
88
#include <bits/stdc++.h> #include <string> using namespace std; int main() { int64_t n, m, a = 0, b = 0; cin >> n >> m; vector<int> vec(n); string ans = "No"; for (int i = 0; i < n; i++) { cin >> vec.at(i); a = a + vec.at(i); } a = a / (4 * m); sort(vec.begin(), vec.end()); reverse(vec.begi...
#include <bits/stdc++.h> #include <string> using namespace std; int main() { int64_t n, m; double a = 0; cin >> n >> m; vector<int> vec(n); string ans = "No"; for (int i = 0; i < n; i++) { cin >> vec.at(i); a = a + vec.at(i); } a = a / (4 * m); sort(vec.begin(), vec.end()); reverse(vec.be...
[["-", 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, 0, 32], ["-", 0, 14, 8, 9, 0, 43, 49, 50, 51, 13], ["-", 0, 14, 8, 9, 0, 43, 49, 50, 49, 22]]
1
150
#include <bits/stdc++.h> #define rep(i, n) for (long long i = 0; i < n; i++) #define Rep(i, n) for (long long i = 1; i < n; i++) #define ll long long #include <cmath> #include <iomanip> #include <iostream> #include <math.h> #include <numeric> #include <queue> #include <set> #include <vector> using namespace std; #defi...
#include <bits/stdc++.h> #define rep(i, n) for (long long i = 0; i < n; i++) #define Rep(i, n) for (long long i = 1; i < n; i++) #define ll long long #include <cmath> #include <iomanip> #include <iostream> #include <math.h> #include <numeric> #include <queue> #include <set> #include <vector> using namespace std; #defi...
[["-", 51, 16, 31, 16, 12, 23, 0, 16, 31, 13], ["+", 51, 16, 31, 16, 12, 23, 0, 16, 31, 13]]
1
151
#include <bits/stdc++.h> using namespace std; int main() { int64_t n, m; int64_t sum = 0; bool t = true; cin >> n >> m; int a[n]; for (int i = 0; i < n; i++) { cin >> a[i]; sum += a[i]; } sort(a, a + n, greater<int>()); for (int i = 0; i < m; i++) { if (a[i] < (double)sum / (4 * m)) { ...
#include <bits/stdc++.h> using namespace std; int main() { int64_t n, m; int64_t sum = 0; bool t = true; cin >> n >> m; int a[n]; for (int i = 0; i < n; i++) { cin >> a[i]; sum += a[i]; } sort(a, a + n, greater<int>()); for (int i = 0; i < m; i++) { if (a[i] < (double)sum / (4 * m)) { ...
[["+", 8, 9, 0, 57, 64, 9, 0, 93, 0, 94], ["+", 8, 9, 0, 57, 64, 9, 0, 93, 0, 35]]
1
145
#include <algorithm> #include <bits/stdc++.h> #include <iostream> #include <vector> using namespace std; int main() { int N, M, S; cin >> N >> M; S = 0; vector<int> A(N); for (int i = 0; i < N; i++) { cin >> A[i]; S = S + A[i]; } sort(A.begin(), A.end()); reverse(A.begin(), A.end()); if (4 * ...
#include <algorithm> #include <bits/stdc++.h> #include <iostream> #include <vector> using namespace std; int main() { int N, M, S; cin >> N >> M; S = 0; vector<int> A(N); for (int i = 0; i < N; i++) { cin >> A[i]; S = S + A[i]; } sort(A.begin(), A.end()); reverse(A.begin(), A.end()); if (4 * ...
[["-", 8, 9, 0, 57, 15, 339, 51, 16, 12, 22], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 12, 22]]
1
142
#include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < (n); ++i) using namespace std; using ll = long long; using P = pair<int, int>; ll x = 1e9 + 7; int main() { int n, m; cin >> n >> m; priority_queue<int> pr; int sum = 0; rep(i, n) { int a; cin >> a; sum += a; pr.push(a); } re...
#include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < (n); ++i) using namespace std; using ll = long long; using P = pair<int, int>; ll x = 1e9 + 7; int main() { int n, m; cin >> n >> m; priority_queue<int> pr; int sum = 0; rep(i, n) { int a; cin >> a; sum += a; pr.push(a); } re...
[["+", 15, 339, 51, 16, 12, 16, 31, 74, 0, 24], ["+", 51, 16, 12, 16, 31, 74, 39, 77, 39, 40], ["+", 15, 339, 51, 16, 12, 16, 31, 74, 0, 25]]
1
145
input = gets.split(" ") m = input[1].to_i arr_tokuhyousuu = gets.split(" ").map(&:to_i) soutouhyousuu = arr_tokuhyousuu.sum cnt_select = 0 arr_tokuhyousuu.each do |tokuhyousuu| if tokuhyousuu >= soutouhyousuu/(4*m) cnt_select += 1 end end if cnt_select >= m puts "Yes" else puts "No" end
input = gets.split(" ") m = input[1].to_i arr_tokuhyousuu = gets.split(" ").map(&:to_i) soutouhyousuu = arr_tokuhyousuu.sum cnt_select = 0 arr_tokuhyousuu.each do |tokuhyousuu| if tokuhyousuu >= soutouhyousuu*1.0/(4*m) cnt_select += 1 end end if cnt_select >= m puts "Yes" else puts "No" end
[["+", 0, 121, 15, 738, 12, 738, 31, 738, 17, 48], ["+", 0, 121, 15, 738, 12, 738, 31, 738, 12, 531]]
4
78
// AtCoder.cpp : このファイルには 'main' // 関数が含まれています。プログラム実行の開始と終了がそこで行われます。 // // AtCoder.cpp : このファイルには 'main' // 関数が含まれています。プログラム実行の開始と終了がそこで行われます。 // #define _USE_MATH_DEFINES #include <math.h> //#include<cmath> #include <algorithm> #include <array> #include <assert.h> #include <bitset> #include <chrono> #include <cm...
// AtCoder.cpp : このファイルには 'main' // 関数が含まれています。プログラム実行の開始と終了がそこで行われます。 // // AtCoder.cpp : このファイルには 'main' // 関数が含まれています。プログラム実行の開始と終了がそこで行われます。 // #define _USE_MATH_DEFINES #include <math.h> //#include<cmath> #include <algorithm> #include <array> #include <assert.h> #include <bitset> #include <chrono> #include <cm...
[["+", 15, 339, 51, 16, 12, 16, 12, 23, 0, 24], ["+", 15, 339, 51, 16, 12, 16, 12, 23, 0, 25]]
1
433
import sys N,M = map(int, sys.stdin.readline().strip().split()) A = list(map(int, sys.stdin.readline().strip().split())) votes_M = sorted(A, reverse=True)[M-1] votes = sum(A) if votes_M >= (votes // (M * 4)): print('Yes') else: print('No')
import sys N,M = map(int, sys.stdin.readline().strip().split()) A = list(map(int, sys.stdin.readline().strip().split())) votes_M = sorted(A, reverse=True)[M-1] votes = sum(A) if votes_M >= (votes / (M * 4)): print('Yes') else: print('No')
[["-", 0, 57, 15, 666, 0, 23, 0, 657, 17, 676], ["+", 0, 57, 15, 666, 0, 23, 0, 657, 17, 85]]
5
99
#include <stdio.h> int main(void) { int N, M, i; int sum, count = 0; int data[100]; scanf("%d %d", &N, &M); for (i = 0; i < N; i++) { scanf("%d", &data[i]); sum += data[i]; } sum = sum / (4 * M); for (i = 0; i < N; i++) { if (sum <= data[i]) { count += 1; } } if (M <= count)...
#include <stdio.h> int main(void) { int N, M, i; double sum = 0; int count = 0; int data[100]; scanf("%d %d", &N, &M); for (i = 0; i < N; i++) { scanf("%d", &data[i]); sum += data[i]; } sum = sum / (4 * M); for (i = 0; i < N; i++) { if (sum <= data[i]) { count += 1; } } i...
[["-", 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, 14, 8, 9, 0, 43, 49, 50, 0, 32], ["+", 0, 14, 8, 9, 0, 43, 49, 50, 51, 13], ["+", 0, 30, 0, 14, 8, 9, 0, 43, 0, 35]]
0
147
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[] A = new int[N]; int sum = 0; for (int i = 0; i < N; i++) { A[i] = sc.nextInt(); sum += A[i]; } int coun...
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[] A = new int[N]; int sum = 0; for (int i = 0; i < N; i++) { A[i] = sc.nextInt(); sum += A[i]; } int coun...
[["-", 8, 196, 0, 57, 15, 15, 0, 16, 17, 47], ["+", 8, 196, 0, 57, 15, 15, 0, 16, 17, 20]]
3
175
import sys n, m = list(map(int, input().split())) a = list(map(int, input().split())) s = sum(a) a.sort(reverse=True) border = int(s / (4 * m)) ans = True for i in range(m): if (a[i] > border): pass else: ans = False break if (ans): print("Yes") else: print("No")
import sys import math n, m = list(map(int, input().split())) a = list(map(int, input().split())) s = sum(a) a.sort(reverse=True) border = s / (4 * m) ans = True for i in range(m): if (a[i] >= border): pass else: ans = False break if (ans): 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, 3, 4, 0, 24], ["-", 0, 1, 0, 662, 12, 652, 3, 4, 0, 25], ["-", 8, 196, 0, 57, 15, 23, 0, 666, 667, 47], ["+", 8, 196, 0, 57, 15, 23, 0, 666, 667, 20]...
5
111
i1 = input() i1 = i1.split() types = int(i1[0]) select = int(i1[1]) i2 = input() i2 = [int(n) for n in i2.split()] i2.sort(reverse=True) summary = sum(i2) threshold = summary / (types * 4) if i2[select-1] >= threshold : print("Yes") else: print("No")
i1 = input() i1 = i1.split() types = int(i1[0]) select = int(i1[1]) i2 = input() i2 = [int(n) for n in i2.split()] i2.sort(reverse=True) summary = sum(i2) threshold = summary / (select * 4) #print("i2=", i2) #print("summary=", summary) #print("threshold=", threshold) if i2[select-1] < threshold : print("No") els...
[["-", 0, 662, 12, 657, 12, 23, 0, 657, 31, 22], ["+", 0, 662, 12, 657, 12, 23, 0, 657, 31, 22], ["-", 36, 36, 0, 656, 0, 57, 15, 666, 667, 20], ["+", 36, 36, 0, 656, 0, 57, 15, 666, 667, 18], ["-", 0, 1, 0, 652, 3, 4, 0, 557, 0, 6], ["+", 0, 1, 0, 652, 3, 4, 0, 557, 0, 6]]
5
98
#include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < (n); ++i) using namespace std; using ll = long long; using P = pair<int, int>; const int INF = 1001001001; 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); ...
#include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < (n); ++i) using namespace std; using ll = long long; using P = pair<int, int>; const int INF = 1001001001; int main() { double N, M; cin >> N >> M; vector<int> a(N); double sum = 0; for (int i = 0; i < N; i++) { cin >> a.at(i); sum += a.at...
[["-", 0, 30, 0, 14, 8, 9, 0, 43, 39, 40], ["+", 0, 30, 0, 14, 8, 9, 0, 43, 39, 40]]
1
186
#include <bits/stdc++.h> using namespace std; typedef pair<int, int> P; #define ll long long #define ld long double #define rep(i, n) for (int i = 0; i < (int)(n); i++) #define PI 3.14159265358979323846 #define sz(x) ((int)(x).size()) #define chmin(x, y) x = min(x, y) #define chmax(x, y) x = max(x, y) #define all(x) (...
#include <bits/stdc++.h> using namespace std; typedef pair<int, int> P; #define ll long long #define ld long double #define rep(i, n) for (int i = 0; i < (int)(n); i++) #define PI 3.14159265358979323846 #define sz(x) ((int)(x).size()) #define chmin(x, y) x = min(x, y) #define chmax(x, y) x = max(x, y) #define all(x) (...
[["-", 8, 9, 0, 57, 15, 339, 51, 16, 17, 47], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 17, 20]]
1
193
#include <bits/stdc++.h> typedef long long ll; using namespace std; #define repr(i, a, b) for (int i = a; i < b; i++) #define rep(i, n) for (int i = 0; i < n; i++) #define invrepr(i, a, b) for (int i = b - 1; i >= a; i--) #define invrep(i, n) invrepr(i, 0, n) #define repitr(itr, a) for (auto itr = a.begin(); itr != a.e...
#include <bits/stdc++.h> typedef long long ll; using namespace std; #define repr(i, a, b) for (int i = a; i < b; i++) #define rep(i, n) for (int i = 0; i < n; i++) #define invrepr(i, a, b) for (int i = b - 1; i >= a; i--) #define invrep(i, n) invrepr(i, 0, n) #define repitr(itr, a) for (auto itr = a.begin(); itr != a.e...
[["-", 8, 9, 0, 57, 15, 339, 51, 16, 17, 47], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 17, 20]]
1
194
#include <bits/stdc++.h> using namespace std; using ll = long long; 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]; } sort(a.rbegin(), a.rend()); for (int i = 0; i < m; i++) { if (a[i] < sum / (4 * m)) { cout ...
#include <bits/stdc++.h> using namespace std; using ll = long long; 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]; } sort(a.rbegin(), a.rend()); for (int i = 0; i < m; i++) { if (a[i] * 4 * m < sum) { cout <<...
[["-", 8, 9, 0, 57, 15, 339, 51, 16, 17, 18], ["-", 0, 57, 15, 339, 51, 16, 12, 16, 31, 22], ["-", 0, 57, 15, 339, 51, 16, 12, 16, 17, 85], ["-", 15, 339, 51, 16, 12, 16, 12, 23, 0, 24], ["+", 15, 339, 51, 16, 31, 16, 31, 16, 17, 48], ["-", 15, 339, 51, 16, 12, 16, 12, 23, 0, 25], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 17...
1
140
N,M = map(int,input().split()) A = sorted(list(map(int,input().split())),reverse=True) if A[M-1]>=sum(A)/M: print("Yes") else: print("No")
N,M = map(int,input().split()) A = sorted(list(map(int,input().split())),reverse=True) if A[M-1]>=sum(A)/(4*M): print("Yes") else: print("No")
[["+", 0, 57, 15, 666, 0, 657, 12, 23, 0, 24], ["+", 15, 666, 0, 657, 12, 23, 0, 657, 31, 612], ["+", 15, 666, 0, 657, 12, 23, 0, 657, 17, 48], ["+", 0, 57, 15, 666, 0, 657, 12, 23, 0, 25]]
5
69
#include <stdio.h> int main() { int n, m; scanf("%d %d", &n, &m); int a[n]; int sum = 0; 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] >= sum / 4 / m) { count++; } } if (count >= m) { printf("Yes"); ...
#include <stdio.h> int main() { int n, m; scanf("%d %d", &n, &m); int a[n]; double sum = 0; 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] >= sum / 4 / m) { count++; } } if (count >= m) { printf("Yes"...
[["-", 0, 30, 0, 14, 8, 9, 0, 43, 39, 40], ["+", 0, 30, 0, 14, 8, 9, 0, 43, 39, 40]]
0
140
#include <bits/stdc++.h> using namespace std; int main() { int n, m, sum = 0; cin >> n >> m; vector<int> a(n); for (auto &i : a) cin >> i, sum += i; sort(a.rbegin(), a.rend()); for (int i = 0; i <= m; i++) { if (a[i] * 4 * m < sum) { cout << "No" << endl; return 0; } } cout << "...
#include <bits/stdc++.h> using namespace std; int main() { int n, m, sum = 0; cin >> n >> m; vector<int> a(n); for (auto &i : a) cin >> i, sum += i; sort(a.rbegin(), a.rend()); for (int i = 0; i < m; i++) { if (a[i] * 4 * m < sum) { cout << "No" << endl; return 0; } } cout << "Y...
[["-", 0, 14, 8, 9, 0, 7, 15, 16, 17, 19], ["+", 0, 14, 8, 9, 0, 7, 15, 16, 17, 18]]
1
120
#include <cctype> #include <cerrno> #include <cfloat> #include <ciso646> #include <climits> #include <clocale> #include <cmath> #include <csetjmp> #include <csignal> #include <cstdarg> #include <cstddef> #include <cstdio> #include <cstdlib> #include <cstring> #include <ctime> #include <algorithm> #include <bitset> #in...
#include <cctype> #include <cerrno> #include <cfloat> #include <ciso646> #include <climits> #include <clocale> #include <cmath> #include <csetjmp> #include <csignal> #include <cstdarg> #include <cstddef> #include <cstdio> #include <cstdlib> #include <cstring> #include <ctime> #include <algorithm> #include <bitset> #in...
[["-", 8, 9, 0, 57, 15, 339, 51, 16, 17, 20], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 17, 47]]
1
298
#include <bits/stdc++.h> using namespace std; #define ll long long #define REP(i, m, n) for (int i = (int)(m); i < (int)(n); i++) #define rep(i, n) REP(i, 0, n) #define RREP(i, m, n) for (int i = (int)(m); i >= (int)(n); i--) #define rrep(i, n) RREP(i, n - 1, 0) #define REPL(i, m, n) for (ll i = (ll)(m); i < (ll)(n); i...
#include <bits/stdc++.h> using namespace std; #define ll long long #define REP(i, m, n) for (int i = (int)(m); i < (int)(n); i++) #define rep(i, n) REP(i, 0, n) #define RREP(i, m, n) for (int i = (int)(m); i >= (int)(n); i--) #define rrep(i, n) RREP(i, n - 1, 0) #define REPL(i, m, n) for (ll i = (ll)(m); i < (ll)(n); i...
[["+", 15, 339, 51, 16, 12, 16, 31, 16, 31, 13], ["+", 15, 339, 51, 16, 12, 16, 31, 16, 17, 48]]
1
203
#include <bits/stdc++.h> using namespace std; #define rep(i, n) for (int i = 0; i < n; ++i) #define ALL(a) (a).begin(), (a).end() template <class T> inline bool chmin(T &a, T b) { if (a > b) { a = b; return true; } return false; } template <class T> inline bool chmax(T &a, T b) { if (a < b) { a = ...
#include <bits/stdc++.h> using namespace std; #define rep(i, n) for (int i = 0; i < n; ++i) #define ALL(a) (a).begin(), (a).end() template <class T> inline bool chmin(T &a, T b) { if (a > b) { a = b; return true; } return false; } template <class T> inline bool chmax(T &a, T b) { if (a < b) { a = ...
[["-", 8, 9, 0, 57, 15, 339, 51, 16, 17, 19], ["-", 0, 57, 15, 339, 51, 16, 12, 2, 63, 22], ["-", 15, 339, 51, 16, 12, 2, 3, 4, 0, 24], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 17, 18], ["-", 12, 2, 3, 4, 0, 16, 12, 23, 0, 25]]
1
1,377
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(); System.out.println(); int A[] = new int[N]; int cnt = 0; int total = 0; for (int i = 0; i < N; i++) { A[i] = sc.nextIn...
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(); System.out.println(); int A[] = new int[N]; int cnt = 0; int total = 0; for (int i = 0; i < N; i++) { A[i] = sc.nextIn...
[["+", 15, 15, 0, 16, 12, 16, 31, 74, 0, 24], ["+", 0, 16, 12, 16, 31, 74, 39, 511, 0, 531], ["+", 15, 15, 0, 16, 12, 16, 31, 74, 0, 25], ["-", 8, 196, 0, 57, 15, 15, 0, 16, 17, 47], ["+", 8, 196, 0, 57, 15, 15, 0, 16, 17, 20]]
3
185
#include <stdio.h> int main() { int n, m; int sum = 0; int count = 0; scanf("%d%d", &n, &m); int a[n]; for (int i = 0; i < n - 1; i++) { scanf("%d ", &a[i]); sum += a[i]; } for (int i = 0; i < n; i++) { if (a[i] * 4 * m >= sum) count++; } if (count >= m) { printf("Yes\n"); }...
#include <stdio.h> int main() { int n, m; int sum = 0; int count = 0; scanf("%d%d", &n, &m); int a[n]; for (int i = 0; i < n; i++) { scanf("%d ", &a[i]); sum += a[i]; } for (int i = 0; i < n; i++) { if (a[i] * 4 * m >= sum) count++; } if (count >= m) { printf("Yes\n"); } els...
[["-", 8, 9, 0, 7, 15, 16, 12, 16, 17, 33], ["-", 8, 9, 0, 7, 15, 16, 12, 16, 12, 13]]
0
142
#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 total = 0; for (int i = 0; i < n; i++) { total += A[i]; } int canSelect = 0; for (int i = 0; i < n; i++) { if (A[i] * 4 * m >= t...
#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 total = 0; for (int i = 0; i < n; i++) { total += A[i]; } int canSelect = 0; for (int i = 0; i < n; i++) { if (A[i] * 4 * m >= t...
[["-", 0, 1, 0, 16, 31, 16, 12, 5, 0, 6], ["+", 0, 1, 0, 16, 31, 16, 12, 5, 0, 6]]
1
153
import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int n = sc.nextInt(), m = sc.nextInt(), vn = 0, cnt = 0, p[] = new int[n]; for (int i = 0; i < n; i++) { p[i] = sc.nextInt(); vn += p[i]; } double b = vn / ...
import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int n = sc.nextInt(), m = sc.nextInt(), vn = 0, cnt = 0, p[] = new int[n]; for (int i = 0; i < n; i++) { p[i] = sc.nextInt(); vn += p[i]; } double b = vn / ...
[["-", 8, 196, 0, 57, 15, 15, 0, 16, 17, 18], ["+", 8, 196, 0, 57, 15, 15, 0, 16, 17, 19]]
3
160
#include <bits/stdc++.h> using namespace std; typedef long long ll; typedef pair<int, int> P; #define rep(i, n) for (int i = 0; i < (int)(n); ++i) #define REP(i, m, n) for (ll i = (ll)(m); i < (ll)(n); ++i) #define F first #define S second const double PI = acos(-1); // fixed<<setprecision(11)<< int main() { int n, ...
#include <bits/stdc++.h> using namespace std; typedef long long ll; typedef pair<int, int> P; #define rep(i, n) for (int i = 0; i < (int)(n); ++i) #define REP(i, m, n) for (ll i = (ll)(m); i < (ll)(n); ++i) #define F first #define S second const double PI = acos(-1); // fixed<<setprecision(11)<< int main() { int n, ...
[["-", 49, 50, 51, 16, 31, 23, 0, 16, 12, 13], ["+", 31, 23, 0, 16, 31, 16, 12, 16, 31, 13], ["+", 31, 23, 0, 16, 31, 16, 12, 16, 17, 48], ["+", 31, 23, 0, 16, 31, 16, 12, 16, 12, 22], ["+", 49, 50, 51, 16, 31, 23, 0, 16, 17, 33], ["+", 49, 50, 51, 16, 31, 23, 0, 16, 12, 13]]
1
182
#include <stdio.h> int main() { int n, m; scanf("%d %d", &n, &m); int a[n]; int sum = 0; int count = 0; for (int i = 0; i < n; i++) { scanf("%d", &a[i]); sum += a[i]; } double x = sum / (4 * m); for (int i = 0; i < n; i++) { if (a[i] >= x) { count++; } } if (count >= m) { ...
#include <stdio.h> int main() { int n, m; scanf("%d %d", &n, &m); int a[n]; int sum = 0; int count = 0; for (int i = 0; i < n; i++) { scanf("%d", &a[i]); sum += a[i]; } double x = sum / (4.0 * m); for (int i = 0; i < n; i++) { if (a[i] >= x) { count++; } } if (count >= m) {...
[["-", 49, 50, 51, 16, 12, 23, 0, 16, 31, 13], ["+", 49, 50, 51, 16, 12, 23, 0, 16, 31, 13]]
0
149
#include <bits/stdc++.h> using namespace std; int main() { int n, m, sum = 0, count = 0; cin >> n >> m; vector<int> a(n); for (int i = 0; i < n; i++) { cin >> a.at(i); sum += a.at(i); } for (int k = 0; k < n; k++) { if (sum < 4 * m * a.at(k)) count++; } if (count >= m) cout << "Y...
#include <bits/stdc++.h> using namespace std; int main() { int n, m, sum = 0, count = 0; cin >> n >> m; vector<int> a(n); for (int i = 0; i < n; i++) { cin >> a.at(i); sum += a.at(i); } for (int k = 0; k < n; k++) { if (sum <= 4 * m * a.at(k)) count++; } if (count >= m) cout << "...
[["-", 8, 9, 0, 57, 15, 339, 51, 16, 17, 18], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 17, 19]]
1
131
import java.util.*; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int n = sc.nextInt(); int m = sc.nextInt(); int[] a = new int[n]; float sum = 0; int count = 0; 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[] args) { Scanner sc = new Scanner(System.in); int n = sc.nextInt(); int m = sc.nextInt(); int[] a = new int[n]; float sum = 0; int count = 0; for (int i = 0; i < n; i++) { a[i] = sc.nextInt(); sum += a[i]; ...
[["-", 8, 196, 0, 57, 64, 196, 0, 57, 0, 95], ["-", 0, 57, 64, 196, 0, 57, 75, 196, 0, 45], ["+", 0, 7, 8, 196, 0, 57, 64, 196, 0, 46], ["+", 0, 195, 8, 196, 0, 7, 8, 196, 0, 46], ["-", 0, 57, 64, 196, 0, 57, 75, 196, 0, 46], ["-", 0, 7, 8, 196, 0, 57, 64, 196, 0, 46], ["-", 0, 195, 8, 196, 0, 7, 8, 196, 0, 46]]
3
179
N, M = map(int, input().split()) A = list(map(int, input().split())) A.sort(reverse=True) if A[M] < 1/(4*M)*sum(A): print("No") else: print("Yes")
N, M = map(int, input().split()) A = list(map(int, input().split())) A.sort(reverse=True) if A[M-1] < 1/(4*M)*sum(A): print("No") else: print("Yes")
[["+", 0, 57, 15, 666, 0, 206, 206, 657, 17, 33], ["+", 0, 57, 15, 666, 0, 206, 206, 657, 12, 612]]
5
74
#include <bits/stdc++.h> using namespace std; int main() { int n, m; cin >> n >> m; vector<int> a(n); int vote = 0; int cnt = 0; for (int i = 0; i < n; i++) { cin >> a.at(i); vote += a.at(i); } vote = vote / (4 * m); for (int i = 0; i < n; i++) { if (a.at(i) >= vote) { cnt++; ...
#include <bits/stdc++.h> using namespace std; int main() { int n, m; cin >> n >> m; vector<int> a(n); double vote = 0; int cnt = 0; for (int i = 0; i < n; i++) { cin >> a.at(i); vote += a.at(i); } vote = vote / (4 * m); for (int i = 0; i < n; i++) { if (a.at(i) >= vote) { cnt++; ...
[["-", 0, 30, 0, 14, 8, 9, 0, 43, 39, 40], ["+", 0, 30, 0, 14, 8, 9, 0, 43, 39, 40]]
1
141
#include <iostream> using namespace std; typedef long long ll; int main() { ll n, m; cin >> n >> m; // n: 4 m:1 ll ai; double s = 0.; int A[n]; for (ll i = 0; i < n; i++) { // i 3 cin >> ai; // ai 1 A[i] = ai; // A: [5,4,2,1] s += ai; // 12.0 ...
#include <iostream> using namespace std; typedef long long ll; int main() { ll n, m; cin >> n >> m; // n: 4 m:1 ll ai; double s = 0.; int A[n]; for (ll i = 0; i < n; i++) { // i 3 cin >> ai; // ai 1 A[i] = ai; // A: [5,4,2,1] s += ai; // 12.0 ...
[["-", 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
147
#include <iostream> using namespace std; int main() { int n, m, a[110]; cin >> n >> m; int sum = 0; for (int i = 0; i < n; i++) { cin >> a[i]; sum += a[i]; } int count = 0; int cond = sum / (4 * m); for (int i = 0; i < n; i++) { if (a[i] >= cond) count++; } if (count >= m) ...
#include <iostream> using namespace std; int main() { int n, m, a[110]; cin >> n >> m; float sum = 0; for (int i = 0; i < n; i++) { cin >> a[i]; sum += a[i]; } int count = 0; float cond = sum / (4 * m); for (int i = 0; i < n; i++) { if (a[i] >= cond) count++; } if (count >= m) ...
[["-", 0, 30, 0, 14, 8, 9, 0, 43, 39, 40], ["+", 0, 30, 0, 14, 8, 9, 0, 43, 39, 40]]
1
130
#include <bits/stdc++.h> using namespace std; #define ll long long int main() { int n, m; cin >> n >> m; int arr[n]; int tot = 0; for (int i = 0; i < n; i++) { cin >> arr[i]; tot += arr[i]; } tot /= (4 * m); sort(arr, arr + n, greater<int>()); for (int i = 0; i < n; i++) { if (arr[i] < tot...
#include <bits/stdc++.h> using namespace std; #define ll long long int main() { int n, m; cin >> n >> m; int arr[n]; float tot = 0; for (int i = 0; i < n; i++) { cin >> arr[i]; tot += arr[i]; } tot /= (4 * m); sort(arr, arr + n, greater<int>()); for (int i = 0; i < n; i++) { if (arr[i] < t...
[["-", 0, 30, 0, 14, 8, 9, 0, 43, 39, 40], ["+", 0, 30, 0, 14, 8, 9, 0, 43, 39, 40]]
1
156
#include <stdio.h> int main() { int N, M; int A[100]; scanf("%d %d", &N, &M); for (int i = 0; i < N; i++) scanf("%d", &A[i]); int total = 0; for (int i = 0; i < N; i++) total = total + A[i]; int count = 0; for (int i = 0; i < N; i++) { if (A[i] >= total / (4 * M)) count = count + 1...
#include <stdio.h> int main() { int N, M; int A[100]; scanf("%d %d", &N, &M); for (int i = 0; i < N; i++) scanf("%d", &A[i]); int total = 0; for (int i = 0; i < N; i++) total = total + A[i]; int count = 0; for (int i = 0; i < N; i++) { if (A[i] >= total / (4.0 * M)) count = count +...
[["-", 0, 16, 12, 16, 12, 23, 0, 16, 31, 13], ["+", 0, 16, 12, 16, 12, 23, 0, 16, 31, 13]]
0
155
#include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < (int)(n); i++) using namespace std; using ll = long long; using P = pair<int, int>; int main() { int n, m, total = 0; cin >> n >> m; vector<int> a(n); rep(i, n) { cin >> a[i]; total += a[i]; } sort(a.rbegin(), a.rend()); cout << (a[m ...
#include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < (int)(n); i++) using namespace std; using ll = long long; using P = pair<int, int>; int main() { int n, m; double total = 0; cin >> n >> m; vector<int> a(n); rep(i, n) { cin >> a[i]; total += a[i]; } sort(a.rbegin(), a.rend()); cout...
[["-", 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
127
#include <algorithm> #include <array> #include <bitset> #include <climits> #include <cmath> #include <cstdio> #include <cstdlib> #include <cstring> #include <ctime> #include <deque> #include <forward_list> #include <iomanip> #include <iostream> #include <iterator> #include <list> #include <map> #include <queue> #includ...
#include <algorithm> #include <array> #include <bitset> #include <climits> #include <cmath> #include <cstdio> #include <cstdlib> #include <cstring> #include <ctime> #include <deque> #include <forward_list> #include <iomanip> #include <iostream> #include <iterator> #include <list> #include <map> #include <queue> #includ...
[["-", 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, 39, 40], ["-", 0, 1, 0, 11, 12, 23, 0, 16, 17, 20], ["+", 0, 11, 12, 23, 0, 16, 31, 16, 17, 33], ["+", 0, 1, 0, 11, 12, 23, 0, 16, 17, 20], ["+", 0, 1, 0, 11, 12, 23, 0, 16, 12, 13]]
1
259
n,m = map(int,input().split()) x = list(map(int,input().split())) x.sort(reverse = True) sumx = sum(x) limit = int(sumx/4/m) if x[m-1]>=limit: print("Yes") else: print("No")
n,m = map(int,input().split()) x = list(map(int,input().split())) x.sort(reverse = True) sumx = sum(x) limit = sumx/4/m #print(limit) if x[m-1]>=limit: 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
81
#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]; } bool ans = false; double check = sum / (4 * m); sort(a.begin(), a.end()); reverse(a.begin(), a.end()); int cnt = 0...
#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]; } bool ans = false; double check = double(sum) / (4 * double(m)); sort(a.begin(), a.end()); reverse(a.begin(), a.end()...
[["+", 0, 43, 49, 50, 51, 16, 31, 2, 63, 40], ["+", 49, 50, 51, 16, 31, 2, 3, 4, 0, 24], ["+", 49, 50, 51, 16, 31, 2, 3, 4, 0, 25], ["+", 51, 16, 12, 23, 0, 16, 12, 2, 63, 40], ["+", 12, 23, 0, 16, 12, 2, 3, 4, 0, 24], ["+", 12, 23, 0, 16, 12, 2, 3, 4, 0, 25]]
1
175
n, m = map(int, input().split()) a = list(map(int, input().split())) b = sum(a) / 4 ans = 0 for i in range(n): if a[i] >= b: ans += 1 if ans >= m: print('Yes') else: print('No')
n, m = map(int, input().split()) a = list(map(int, input().split())) b = sum(a) / (4 * m) ans = 0 for i in range(n): if a[i] >= b: ans += 1 if ans >= m: print('Yes') else: print('No')
[["+", 0, 1, 0, 662, 12, 657, 12, 23, 0, 24], ["+", 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
82
#define rep(i, n) for (int i = 0; i < (n); i++) #include <bits/stdc++.h> using namespace std; using ll = long long; using P = pair<int, int>; const int MOD = 1000000007; // MAX int 2,147,483,647 // MAX O(n) 10^18 int main() { int N, M; cin >> N >> M; vector<int> A(N); rep(i, N) cin >> A.at(i); sort(A.begin(...
#define rep(i, n) for (int i = 0; i < (n); i++) #include <bits/stdc++.h> using namespace std; using ll = long long; using P = pair<int, int>; const int MOD = 1000000007; // MAX int 2,147,483,647 // MAX O(n) 10^18 int main() { int N, M; cin >> N >> M; vector<int> A(N); rep(i, N) cin >> A.at(i); sort(A.begin(...
[["+", 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]]
1
176
n,m=map(int,input().split()) I=list(map(int,input().split())) num=0 for i in range(n): if I[i]>=(1/(4*m)): num+=1 if num>=m: print("Yes") else: print("No")
n,m=map(int,input().split()) I=list(map(int,input().split())) num=0 for i in range(n): if I[i]>=(sum(I)/(4*m)): num+=1 if num>=m: print("Yes") else: print("No")
[["-", 0, 57, 15, 666, 0, 23, 0, 657, 31, 612], ["+", 15, 666, 0, 23, 0, 657, 31, 652, 63, 22], ["+", 0, 23, 0, 657, 31, 652, 3, 4, 0, 24], ["+", 0, 23, 0, 657, 31, 652, 3, 4, 0, 22], ["+", 0, 23, 0, 657, 31, 652, 3, 4, 0, 25]]
5
82
import java.util.Scanner; /** * Main */ public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int N = sc.nextInt(); int M = sc.nextInt(); int[] A = new int[N]; int total = 0; for (int i = 0; i < N; i++) { A[i] = sc.nextInt(); total +...
import java.util.Scanner; /** * Main */ public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int N = sc.nextInt(); int M = sc.nextInt(); int[] A = new int[N]; int total = 0; for (int i = 0; i < N; i++) { A[i] = sc.nextInt(); total +...
[["-", 8, 196, 0, 57, 15, 15, 0, 16, 17, 47], ["+", 8, 196, 0, 57, 15, 15, 0, 16, 17, 20]]
3
201
import java.util.ArrayList; import java.util.Collections; import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); ArrayList<Integer> list = new ArrayList<>(); int n = Integer.parseInt(sc.next()); int m = Integer.parseInt(sc.next());...
import java.util.ArrayList; import java.util.Collections; import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); ArrayList<Integer> list = new ArrayList<>(); int n = Integer.parseInt(sc.next()); int m = Integer.parseInt(sc.next());...
[["-", 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, 17, 85], ["-", 0, 503, 49, 200, 51, 16, 31, 16, 12, 499], ["+", 0, 503, 49, 200, 51, 16, 12, 23, 0, 24], ["+", 49, 200, 51, 16, 12, 23, 0, 16, 31, 515], ["+", 49, 200, 51, 16, 12, 23, ...
3
227
n,m=map(int,input().split()) A=list(map(int,input().split())) print("NYoe s"[m<=len([i for i in A if i>sum(A)/(4*m)])::2])
n,m=map(int,input().split()) A=list(map(int,input().split())) print("NYoe s"[m<=len([i for i in A if i>=sum(A)/(4*m)])::2])
[["-", 3, 4, 0, 658, 0, 678, 0, 666, 667, 47], ["+", 3, 4, 0, 658, 0, 678, 0, 666, 667, 20]]
5
69
inputValues = [int(i) for i in input().split()] n = inputValues[0] m = inputValues[1] votes = [int(i) for i in input().split()] total = sum(votes) cnt = 0 for i in votes: if i >= total*(1/(4*m)): cnt += 1 print(i) if cnt >= m: print("Yes") else: print("No")
inputValues = [int(i) for i in input().split()] n = inputValues[0] m = inputValues[1] votes = [int(i) for i in input().split()] total = sum(votes) cnt = 0 for i in votes: if i >= total*(1/(4*m)): cnt += 1 # print(i) if cnt >= m: print("Yes") else: print("No")
[["-", 0, 57, 64, 196, 0, 1, 0, 652, 63, 22], ["-", 64, 196, 0, 1, 0, 652, 3, 4, 0, 24], ["-", 64, 196, 0, 1, 0, 652, 3, 4, 0, 22], ["-", 64, 196, 0, 1, 0, 652, 3, 4, 0, 25]]
5
103
import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int n = sc.nextInt(); int m = sc.nextInt(); int[] a = new int[n]; int all = 0; for (int i = 0; i < n; i++) { a[i] = sc.nextInt(); all += a[i]; } int...
import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int n = sc.nextInt(); int m = sc.nextInt(); int[] a = new int[n]; int all = 0; for (int i = 0; i < n; i++) { a[i] = sc.nextInt(); all += a[i]; } int...
[["+", 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
177
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[] list = new int[N]; int all = 0; for (int i = 0; i < N; i++) { list[i] = sc.nextInt(); all += list[i]; } ...
import java.util.*; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int N = sc.nextInt(); int M = sc.nextInt(); int[] list = new int[N]; int all = 0; for (int i = 0; i < N; i++) { list[i] = sc.nextInt(); all += list[i]; } ...
[["-", 15, 15, 0, 16, 12, 16, 31, 16, 12, 499], ["+", 15, 15, 0, 16, 12, 16, 31, 16, 12, 515]]
3
176
const input = require("fs").readFileSync("/dev/stdin", "utf8") const lines = input.split('\n') const [N, M] = lines[0].split(' ').map(Number) const A = lines[1].split(' ').map(Number) const sum = A.reduce((a, b) => a + b) const div = sum / (M * 4) let count = 0 A.forEach(a => {count += a > div ? 1 : 0}) console.log...
const input = require("fs").readFileSync("/dev/stdin", "utf8") const lines = input.split('\n') const [N, M] = lines[0].split(' ').map(Number) const A = lines[1].split(' ').map(Number) const sum = A.reduce((a, b) => a + b) const div = sum / (M * 4) let count = 0 A.forEach(a => {count += a >= div ? 1 : 0}) console.lo...
[["-", 0, 1, 0, 564, 12, 510, 15, 16, 17, 47], ["+", 0, 1, 0, 564, 12, 510, 15, 16, 17, 20]]
2
138
N,M = map(int,input().split()) A = list(map(int,input().split())) A = sorted(A, reverse=True) 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 = sorted(A, reverse=True) if A[M-1]<(sum(A)/(4*M)): print("No") else: print("Yes")
[["-", 15, 666, 0, 23, 0, 657, 31, 652, 63, 22], ["+", 15, 666, 0, 23, 0, 657, 31, 652, 63, 22]]
5
78
n,m=map(int,input().split()) a=list(map(int,input().split())) cnt=0 for i in a: if (s/(4*m))<=i: cnt+=1 if cnt==m: print("Yes") if cnt<m: print("No")
n,m=map(int,input().split()) a=list(map(int,input().split())) cnt=0 for i in a: if (sum(a)/(4*m))<=i: cnt+=1 if cnt==m: print("Yes") if cnt<m: print("No")
[["-", 0, 57, 15, 666, 0, 23, 0, 657, 31, 22], ["+", 15, 666, 0, 23, 0, 657, 31, 652, 63, 22], ["+", 0, 23, 0, 657, 31, 652, 3, 4, 0, 24], ["+", 0, 23, 0, 657, 31, 652, 3, 4, 0, 22], ["+", 0, 23, 0, 657, 31, 652, 3, 4, 0, 25]]
5
79
#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[i]; total += A[i]; } sort(A.begin(), A.end()); reverse(A.begin(), A.end()); int limit = total / (4 * M); for (int i = 0; i < M; i++) ...
#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[i]; total += A[i]; } sort(A.begin(), A.end()); reverse(A.begin(), A.end()); double limit = (double)total / (4.0 * M); for (int i = 0;...
[["-", 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], ["-", 49, 50, 51, 16, 12, 23, 0, 16, 31, 13], ["+", 49, 50, 51, 16, 12, 23, 0, 16, 31, 13]]
1
154
# -*- coding: utf-8 -*- N, M = map(int, input().split()) A = list(map(int, input().split())) total = sum(A) count = 0 for a in A: if a >= total / (4*M): count += 1 if a >= M: print('Yes') else: print('No')
# -*- coding: utf-8 -*- N, M = map(int, input().split()) A = list(map(int, input().split())) total = sum(A) count = 0 for a in A: if a >= total / (4*M): count += 1 if count >= M: print('Yes') else: print('No')
[["-", 36, 36, 0, 656, 0, 57, 15, 666, 0, 22], ["+", 36, 36, 0, 656, 0, 57, 15, 666, 0, 22]]
5
81
#include <bits/stdc++.h> using namespace std; using ll = long long; int main() { int N, M; cin >> N >> M; int count = 0; vector<int> A(N); int sum = 0; for (int i = 0; i < N; i++) { cin >> A[i]; sum += A[i]; } for (int i = 0; i < N; i++) { if (A[i] * 4 * M > sum) { count++; } ...
#include <bits/stdc++.h> using namespace std; using ll = long long; int main() { int N, M; cin >> N >> M; int count = 0; vector<int> A(N); int sum = 0; for (int i = 0; i < N; i++) { cin >> A[i]; sum += A[i]; } for (int i = 0; i < N; i++) { if (A[i] * 4 * M >= sum) { count++; } ...
[["-", 8, 9, 0, 57, 15, 339, 51, 16, 17, 47], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 17, 20]]
1
142
package main import ( "bufio" "fmt" "log" "os" "strconv" ) func main() { scanner := bufio.NewScanner(os.Stdin) scanner.Split(bufio.ScanWords) scanner.Scan() N, err := strconv.Atoi(scanner.Text()) if err != nil { log.Fatal(err) } scanner.Scan() M, err := strconv.Atoi(scanner.Text()) if err != nil { ...
package main import ( "bufio" "fmt" "log" "os" "strconv" ) func main() { scanner := bufio.NewScanner(os.Stdin) scanner.Split(bufio.ScanWords) scanner.Scan() N, err := strconv.Atoi(scanner.Text()) if err != nil { log.Fatal(err) } scanner.Scan() M, err := strconv.Atoi(scanner.Text()) if err != nil { ...
[["+", 8, 196, 0, 57, 15, 16, 31, 16, 17, 48], ["+", 8, 196, 0, 57, 15, 16, 31, 16, 12, 22]]
7
260
#include <bits/stdc++.h> using namespace std; int main() { int N, M; cin >> N >> M; int A[N]; int total = 0; for (int i = 0; i < N; i++) { cin >> A[i]; total += A[i]; } sort(A, A + N, greater<>()); if (A[M - 1] >= total / (4 * M)) cout << "Yes" << endl; else cout << "No" << endl; ...
#include <bits/stdc++.h> using namespace std; int main() { int N, M; cin >> N >> M; int A[N]; int total = 0; for (int i = 0; i < N; i++) { cin >> A[i]; total += A[i]; } sort(A, A + N, greater<>()); if (A[M - 1] >= (double)total / (4 * M)) cout << "Yes" << endl; else cout << "No" <<...
[["+", 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
116
#include <algorithm> #include <functional> #include <stdio.h> using namespace std; typedef long long llong; #define MAX 1001 const llong mod = 1000000000 + 7; int main() { int N, M, border = 0; int A[MAX]; int flag; scanf("%d%d", &N, &M); for (int i = 0; i < N; i++) { scanf("%d", &A[i]); border +...
#include <algorithm> #include <functional> #include <stdio.h> using namespace std; typedef long long llong; #define MAX 1001 const llong mod = 1000000000 + 7; int main() { int N, M; double border = 0; int A[MAX]; int flag; scanf("%d%d", &N, &M); for (int i = 0; i < N; i++) { scanf("%d", &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
176
#include <bits/stdc++.h> using namespace std; #define rep(i, n) for (int i = 0; i < (n); i++) int main() { int n, m; cin >> n >> m; vector<int> a(n); rep(i, n) { cin >> a[i]; } int sum = 0; rep(i, n) { sum += a[i]; } int cnt = 0; sum = (sum + 3) / (4 * m); rep(i, n) { if (a[i] >= sum) cnt...
#include <bits/stdc++.h> using namespace std; #define rep(i, n) for (int i = 0; i < (n); i++) int main() { int n, m; cin >> n >> m; vector<int> a(n); rep(i, n) { cin >> a[i]; } int sum = 0; rep(i, n) { sum += a[i]; } int cnt = 0; sum = (sum + 4 * m - 1) / (4 * m); rep(i, n) { if (a[i] >= sum) ...
[["-", 0, 11, 12, 16, 31, 23, 0, 16, 12, 13], ["+", 31, 23, 0, 16, 31, 16, 12, 16, 31, 13], ["+", 31, 23, 0, 16, 31, 16, 12, 16, 17, 48], ["+", 31, 23, 0, 16, 31, 16, 12, 16, 12, 22], ["+", 0, 11, 12, 16, 31, 23, 0, 16, 17, 33], ["+", 0, 11, 12, 16, 31, 23, 0, 16, 12, 13]]
1
140
#include <bits/stdc++.h> using namespace std; int votes[105]; int main() { int n, m; cin >> n >> m; int total = 0; for (int i = 0; i < n; i++) { cin >> votes[i]; total += votes[i]; } int count = 0; int coef = total / (4 * m); for (int i = 0; i < n; i++) { if (votes[i] >= coef) count++;...
#include <bits/stdc++.h> using namespace std; int votes[105]; int main() { int n, m; cin >> n >> m; int total = 0; for (int i = 0; i < n; i++) { cin >> votes[i]; total += votes[i]; } int count = 0; int coef = ceil((float)total / (4 * m)); for (int i = 0; i < n; i++) { if (votes[i] >= coef) ...
[["+", 8, 9, 0, 43, 49, 50, 51, 2, 63, 22], ["+", 0, 43, 49, 50, 51, 2, 3, 4, 0, 24], ["+", 51, 2, 3, 4, 0, 16, 31, 74, 0, 24], ["+", 3, 4, 0, 16, 31, 74, 39, 77, 39, 40], ["+", 51, 2, 3, 4, 0, 16, 31, 74, 0, 25], ["+", 51, 2, 3, 4, 0, 16, 12, 23, 0, 25]]
1
137
#include <bits/stdc++.h> using namespace std; int main() { int n; int k; cin >> n >> k; int a[n]; int sum = 0; for (int i = 0; i < n; i++) { cin >> a[i]; sum = sum + a[i]; } double c = (1 / (4 * k)) * sum; int count = 0; for (int i = 0; i < n; i++) { if (a[i] >= c) count++; } i...
#include <bits/stdc++.h> using namespace std; int main() { int n; int k; cin >> n >> k; int a[n]; int sum = 0; for (int i = 0; i < n; i++) { cin >> a[i]; sum = sum + a[i]; } double c = ((double)1 / (4 * k)) * sum; int count = 0; for (int i = 0; i < n; i++) { if (a[i] >= c) count++;...
[["+", 51, 16, 31, 23, 0, 16, 31, 74, 0, 24], ["+", 31, 23, 0, 16, 31, 74, 39, 77, 39, 40], ["+", 51, 16, 31, 23, 0, 16, 31, 74, 0, 25]]
1
142
/* @uthor: Varun Mishra "varun21999" -> Codechef, Codeforce, Hackerrank, Hackerearth; */ //#include<boost/multiprecision/cpp_int.hpp> // using boost::multiprecision::cpp_int; #include <bits/stdc++.h> #include <ext/pb_ds/assoc_container.hpp> #include <ext/pb_ds/tree_policy.hpp> using namespace __gnu_pbds; using...
/* @uthor: Varun Mishra "varun21999" -> Codechef, Codeforce, Hackerrank, Hackerearth; */ //#include<boost/multiprecision/cpp_int.hpp> // using boost::multiprecision::cpp_int; #include <bits/stdc++.h> #include <ext/pb_ds/assoc_container.hpp> #include <ext/pb_ds/tree_policy.hpp> using namespace __gnu_pbds; using...
[["+", 12, 16, 31, 23, 0, 16, 31, 74, 0, 24], ["-", 15, 339, 51, 16, 12, 74, 51, 23, 0, 24], ["-", 51, 16, 12, 74, 51, 23, 0, 16, 31, 22], ["+", 12, 16, 31, 23, 0, 16, 31, 74, 51, 13], ["+", 0, 57, 15, 339, 51, 16, 12, 16, 17, 48], ["+", 0, 57, 15, 339, 51, 16, 12, 16, 12, 22]]
1
349
n,m = map(int, input().split()) A = list(map(int, input().split())) votes = sum(A) A.sort() if A[m-1] < votes/4*m: print('No') else: print('Yes')
n,m = map(int, input().split()) A = list(map(int, input().split())) votes = sum(A) A.sort(reverse=True) if A[m-1] < votes/(4*m): print('No') else: print('Yes')
[["+", 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], ["+", 0, 57, 15, 666, 0, 657, 12, 23, 0, 24], ["+", 0, 57, 15, 666, 0, 657, 12, 23, 0, 25]]
5
72
#include <algorithm> #include <iostream> #include <string> #include <vector> using namespace std; int main() { int n, m; cin >> n >> m; vector<int> a(n); int total = 0; for (int i = 0; i < n; i++) { cin >> a[i]; total += a[i]; } total /= 4 * m; int count = 0; for (int i = 0; i < n; i++) { ...
#include <algorithm> #include <iostream> #include <string> #include <vector> using namespace std; int main() { int n, m; cin >> n >> m; vector<int> a(n); float total = 0; for (int i = 0; i < n; i++) { cin >> a[i]; total += a[i]; } total /= 4 * m; int count = 0; for (int i = 0; i < n; i++) { ...
[["-", 0, 30, 0, 14, 8, 9, 0, 43, 39, 40], ["+", 0, 30, 0, 14, 8, 9, 0, 43, 39, 40]]
1
138
import bisect,collections,copy,heapq,itertools,math,string import sys def S(): return sys.stdin.readline().rstrip() def M(): return map(int,sys.stdin.readline().rstrip().split()) def I(): return int(sys.stdin.readline().rstrip()) def LI(): return list(map(int,sys.stdin.readline().rstrip().split())) def LS(): return lis...
import bisect,collections,copy,heapq,itertools,math,string import sys def S(): return sys.stdin.readline().rstrip() def M(): return map(int,sys.stdin.readline().rstrip().split()) def I(): return int(sys.stdin.readline().rstrip()) def LI(): return list(map(int,sys.stdin.readline().rstrip().split())) def LS(): return lis...
[["-", 36, 36, 0, 656, 0, 57, 15, 666, 667, 47], ["+", 36, 36, 0, 656, 0, 57, 15, 666, 667, 20]]
5
188
#include <bits/stdc++.h> #define REP(i, n) for (int i = 0; i < n; i++) #define REPR(i, n) for (int i = n; i >= 0; i--) #define FOR(i, m, n) for (int i = m; i < n; i++) #define INF 2e9 #define ALL(v) v.begin(), v.end() using namespace std; typedef long long ll; int main() { int N, M; cin >> N >> M; int ans = 0, su...
#include <bits/stdc++.h> #define REP(i, n) for (int i = 0; i < n; i++) #define REPR(i, n) for (int i = n; i >= 0; i--) #define FOR(i, m, n) for (int i = m; i < n; i++) #define INF 2e9 #define ALL(v) v.begin(), v.end() using namespace std; typedef long long ll; int main() { int N, M; cin >> N >> M; int ans = 0, su...
[["-", 8, 9, 0, 57, 15, 339, 51, 16, 17, 47], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 17, 20]]
1
150
#include <bits/stdc++.h> using namespace std; typedef long long ll; const long long INF = 1LL << 60; ll GCD(ll x, ll y) { if (y == 0) return x; else return GCD(y, x % y); } ll LCM(ll a, ll b) { return a / GCD(a, b) * b; } const int MOD = 1000000007; int main() { int n; double m; cin >> n >> m; i...
#include <bits/stdc++.h> using namespace std; typedef long long ll; const long long INF = 1LL << 60; ll GCD(ll x, ll y) { if (y == 0) return x; else return GCD(y, x % y); } ll LCM(ll a, ll b) { return a / GCD(a, b) * b; } const int MOD = 1000000007; int main() { int n; double m; cin >> n >> m; i...
[["-", 8, 9, 0, 57, 15, 339, 51, 16, 17, 47], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 17, 20]]
1
212
n, m = gets.chomp.split(' ').map(&:to_i) a = gets.chomp.split(' ').map(&:to_i) count = 0 b = a.sum / (4.0 * m) puts b a.each{|i| if(i > b) count += 1 end } if(count < m) puts "No" else puts "Yes" end
n, m = gets.chomp.split(' ').map(&:to_i) a = gets.chomp.split(' ').map(&:to_i) count = 0 b = a.sum / (4.0 * m) a.each{|i| if(i >= b) count += 1 end } if(count < m) puts "No" else puts "Yes" end
[["-", 36, 36, 36, 36, 0, 493, 0, 652, 735, 22], ["-", 36, 36, 0, 493, 0, 652, 3, 4, 0, 22], ["-", 8, 734, 0, 121, 15, 739, 0, 738, 17, 47], ["+", 8, 734, 0, 121, 15, 739, 0, 738, 17, 20]]
4
88
n, m = gets.chomp.split(' ').map(&:to_i) a = gets.chomp.split(' ').map(&:to_i) count = 0 b = a.sum / (4 * m) a.each{|i| if(i > b) count += 1 end } if(count < m) puts "No" else puts "Yes" end
n, m = gets.chomp.split(' ').map(&:to_i) a = gets.chomp.split(' ').map(&:to_i) count = 0 b = a.sum.to_f / (4 * m) a.each{|i| if(i >= b) count += 1 end } if(count < m) puts "No" else puts "Yes" end
[["+", 0, 493, 0, 662, 12, 738, 31, 652, 17, 131], ["+", 0, 493, 0, 662, 12, 738, 31, 652, 735, 22], ["-", 8, 734, 0, 121, 15, 739, 0, 738, 17, 47], ["+", 8, 734, 0, 121, 15, 739, 0, 738, 17, 20]]
4
86
n, m = gets.chomp.split(" ").map(&:to_i) arr = gets.chomp.split(" ").map(&:to_i) arr_sum = arr.sum filtered = arr.select { |a| a >= arr_sum / (4 * m) } if filtered.count >= m puts "Yes" else puts "No" end
n, m = gets.chomp.split(" ").map(&:to_i) arr = gets.chomp.split(" ").map(&:to_i) arr_sum = arr.sum filtered = arr.select { |a| a >= arr_sum.to_f / (4 * m) } if filtered.count >= m puts "Yes" else puts "No" end
[["+", 8, 734, 0, 738, 12, 738, 31, 652, 17, 131], ["+", 8, 734, 0, 738, 12, 738, 31, 652, 735, 22]]
4
78
#include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < (n); ++i) #define printInt(a) printf("%d\n", a) #define printll(a) printf("%lld\n", a) #define scanll(a) scanf("%lld", &a) #define scanInt(a) scanf("%d", &a) #define scan2Int(a, b) scanf("%d %d", &a, &b) #define scan3Int(a, b, c) scanf("%d %d %d", &a, &b, &...
#include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < (n); ++i) #define printInt(a) printf("%d\n", a) #define printll(a) printf("%lld\n", a) #define scanll(a) scanf("%lld", &a) #define scanInt(a) scanf("%d", &a) #define scan2Int(a, b) scanf("%d %d", &a, &b) #define scan3Int(a, b, c) scanf("%d %d %d", &a, &b, &...
[["+", 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]]
1
189
#include <algorithm> #include <iomanip> #include <iostream> #include <map> #include <math.h> #include <queue> #include <stdio.h> #include <stdlib.h> #include <string.h> #include <vector> #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); ...
#include <algorithm> #include <iomanip> #include <iostream> #include <map> #include <math.h> #include <queue> #include <stdio.h> #include <stdlib.h> #include <string.h> #include <vector> #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); ...
[["-", 15, 339, 51, 16, 12, 74, 39, 77, 39, 40], ["-", 0, 57, 15, 339, 51, 16, 12, 74, 0, 25], ["+", 12, 23, 0, 16, 31, 74, 39, 77, 39, 40], ["+", 51, 16, 12, 23, 0, 16, 31, 74, 0, 25]]
1
160