buggy_code
stringlengths
11
625k
fixed_code
stringlengths
17
625k
bug_type
stringlengths
2
4.45k
language
int64
0
8
token_count
int64
5
200k
#include <bits/stdc++.h> using namespace std; int main() { int n, m; cin >> n >> m; int total = 0; int a[n]; for (int i = 0; i < n; i++) { cin >> a[i]; total += a[i]; } int v = 4 * m; double d = (total / v); int ans = 0; for (int i = 0; i < n; i++) { if ((double)a[i] >= d) ans++;...
#include <bits/stdc++.h> using namespace std; int main() { int n, m; cin >> n >> m; double total = 0; double a[n]; for (int i = 0; i < n; i++) { cin >> a[i]; total += a[i]; } double v = 4 * m; double d = (total / v); int ans = 0; for (int i = 0; i < n; i++) { if (a[i] >= d) ans++...
[["-", 0, 30, 0, 14, 8, 9, 0, 43, 39, 40], ["+", 0, 30, 0, 14, 8, 9, 0, 43, 39, 40], ["-", 0, 7, 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
146
n, m = map(int, input().split()) a = list(map(int, input().split())) suma = sum(a) filtera = [i for i in a if i >= 1/(4*m)] if len(filtera) >= m: print("Yes") else: print("No")
n, m = map(int, input().split()) a = list(map(int, input().split())) suma = sum(a) filtera = [i for i in a if i >= suma*1/(4*m)] if len(filtera) >= m: print("Yes") else: print("No")
[["+", 0, 678, 0, 666, 0, 657, 31, 657, 31, 22], ["+", 0, 678, 0, 666, 0, 657, 31, 657, 17, 48]]
5
80
# import sys # import math #sqrt # import decimal # import queue # queue # import bisect # import heapq # priolity-queue # import time # import itertools # import collections # deque # from operator import itemgetter # from fractions import Fraction mod = int(1e9+7) INF = 1<<29 lINF = 1<<35 def main(): n,m = map(...
# import sys # import math #sqrt # import decimal # import queue # queue # import bisect # import heapq # priolity-queue # import time # import itertools # import collections # deque # from operator import itemgetter # from fractions import Fraction mod = int(1e9+7) INF = 1<<29 lINF = 1<<35 def main(): n,m = map(...
[["-", 0, 7, 8, 196, 0, 57, 15, 666, 667, 47], ["+", 0, 7, 8, 196, 0, 57, 15, 666, 667, 20]]
5
136
#include <bits/stdc++.h> using namespace std; using ll = long long; int main() { int N, M; cin >> N >> M; vector<int> A(N); int threshold = 0; for (int i = 0; i < N; i++) { cin >> A[i]; threshold += A[i]; } threshold = threshold / (4 * M); sort(A.rbegin(), A.rend()); bool result = true; ...
#include <bits/stdc++.h> using namespace std; using ll = long long; int main() { int N, M; cin >> N >> M; vector<int> A(N); float threshold = 0; for (int i = 0; i < N; i++) { cin >> A[i]; threshold += A[i]; } threshold = threshold / (4 * M); sort(A.rbegin(), A.rend()); bool result = true;...
[["-", 0, 30, 0, 14, 8, 9, 0, 43, 39, 40], ["+", 0, 30, 0, 14, 8, 9, 0, 43, 39, 40], ["-", 8, 9, 0, 57, 15, 339, 51, 16, 17, 19], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 17, 18]]
1
157
import bisect,collections,copy,itertools,math,numpy,string def I(): return int(input()) def S(): return input() def LI(): return list(map(int,input().split())) def LS(): return list(input().split()) ################################################## N,M = LI() A = LI() kijun = sum(A)//(4*M) count = 0 for x in A: if...
import bisect,collections,copy,itertools,math,numpy,string def I(): return int(input()) def S(): return input() def LI(): return list(map(int,input().split())) def LS(): return list(input().split()) ################################################## N,M = LI() A = LI() kijun = sum(A)/(4*M) count = 0 for x in A: if ...
[["-", 0, 656, 0, 1, 0, 662, 12, 657, 17, 676], ["+", 0, 656, 0, 1, 0, 662, 12, 657, 17, 85]]
5
127
_n, m = gets.split.map(&:to_i) a = gets.split.map(&:to_i) b = a.inject(:+) / ( 4 * m) cnt = 0 a.each do |ai| cnt += 1 unless ai < b end if cnt >= m puts 'Yes' else puts 'No' end
_n, m = gets.split.map(&:to_i) a = gets.split.map(&:to_i) b = a.inject(:+).to_f / (4 * m) cnt = 0 a.each do |ai| cnt += 1 unless ai < b end if cnt >= m puts 'Yes' else puts 'No' end
[["+", 0, 493, 0, 662, 12, 738, 31, 652, 17, 131], ["+", 0, 493, 0, 662, 12, 738, 31, 652, 735, 22]]
4
70
#include <math.h> #include <stdio.h> #include <stdlib.h> #include <string.h> int main(void) { int n, m; scanf("%d %d", &n, &m); int score_sum = 0, score[n]; for (int i = 0; i < n; i++) { scanf(" %d", &score[i]); score_sum += score[i]; } int count = 0; float thr = score_sum / (4 * m); for (int...
#include <math.h> #include <stdio.h> #include <stdlib.h> #include <string.h> int main(void) { int n, m; scanf("%d %d", &n, &m); int score_sum = 0, score[n]; for (int i = 0; i < n; i++) { scanf(" %d", &score[i]); score_sum += score[i]; } int count = 0; float thr = (float)score_sum / (float)(4 * ...
[["+", 0, 43, 49, 50, 51, 16, 31, 74, 0, 24], ["+", 49, 50, 51, 16, 31, 74, 39, 77, 39, 40], ["+", 0, 43, 49, 50, 51, 16, 31, 74, 0, 25], ["+", 0, 43, 49, 50, 51, 16, 12, 74, 0, 24], ["+", 49, 50, 51, 16, 12, 74, 39, 77, 39, 40], ["+", 0, 43, 49, 50, 51, 16, 12, 74, 0, 25]]
0
158
n,m = map(int, input().split()) a = list(map(int, input().split())) a.sort() a.reverse() s=sum(a) if (a[m-1] >= int(s/(4*m))): print("Yes") else: print("No")
import math n,m = map(int, input().split()) a = list(map(int, input().split())) a.sort() a.reverse() s=sum(a) if (a[m-1] >= math.ceil(s/(4*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, 57, 15, 23, 0, 666, 0, 652, 63, 22], ["+", 15, 23, 0, 666, 0, 652, 63, 319, 500, 22], ["+", 15, 23, 0, 666, 0, 652, 63, 319, 0, 131], ["+", 15, 23, 0, 666, 0, 652, 63, 319, 319, 22]]
5
84
#include <bits/stdc++.h> #include <vector> using namespace std; #define rep(i, n) for (int i = 0; i < (int)(n); ++i) int main() { int a, c, d = 0, e = 0; cin >> a >> c; vector<int> b(a); rep(i, a) { cin >> b.at(i); d += b.at(i); } d = d / (4 * c); rep(i, a) { if (b.at(i) >= d) e++; } ...
#include <bits/stdc++.h> #include <vector> using namespace std; #define rep(i, n) for (int i = 0; i < (int)(n); ++i) int main() { double a, c, d = 0, e = 0; cin >> a >> c; vector<int> b(a); rep(i, a) { cin >> b.at(i); d += b.at(i); } d = d / (4 * c); rep(i, a) { if (b.at(i) >= d) e++; ...
[["-", 0, 30, 0, 14, 8, 9, 0, 43, 39, 40], ["+", 0, 30, 0, 14, 8, 9, 0, 43, 39, 40]]
1
127
#include <bits/stdc++.h> using namespace std; #define int long long int #define ld long double #define ff first #define ss second #define mp make_pair #define pb push_back #define si set<int> #define vi vector<int> #define pii pair<int, int> #define vpii vector<pii> #define vpp vector<pair<int, pii>> #define mii map<i...
#include <bits/stdc++.h> using namespace std; #define int long long int #define ld long double #define ff first #define ss second #define mp make_pair #define pb push_back #define si set<int> #define vi vector<int> #define pii pair<int, int> #define vpii vector<pii> #define vpp vector<pair<int, pii>> #define mii map<i...
[["-", 0, 30, 0, 14, 8, 9, 0, 43, 39, 40], ["+", 0, 30, 0, 14, 8, 9, 0, 43, 39, 40]]
1
481
#include <bits/stdc++.h> #define pb push_back #define fst first #define snd second #define fill(a, c) memset(&a, c, sizeof(a)) #define fore(i, x, y) for (ll i = x; i < y; i++) #define FIN \ ios_base::sync_with_stdio(0); ...
#include <bits/stdc++.h> #define pb push_back #define fst first #define snd second #define fill(a, c) memset(&a, c, sizeof(a)) #define fore(i, x, y) for (ll i = x; i < y; i++) #define FIN \ ios_base::sync_with_stdio(0); ...
[["-", 0, 9, 0, 57, 15, 339, 51, 16, 17, 18], ["+", 0, 9, 0, 57, 15, 339, 51, 16, 17, 19]]
1
163
n,m= map(int, input().split()) a=list(map(int,input().split())) l=sum(a)//(4*m) c=0 for i in range(n): if a[i]>=l: c+=1 print("Yes" if c>=m else "No")
n,m= map(int, input().split()) a=list(map(int,input().split())) l=sum(a)/(4*m) c=0 for i in range(n): if a[i]>=l: c+=1 print("Yes" if c>=m else "No")
[["-", 0, 656, 0, 1, 0, 662, 12, 657, 17, 676], ["+", 0, 656, 0, 1, 0, 662, 12, 657, 17, 85]]
5
81
#include <bits/stdc++.h> using namespace std; #define priority_queue pq #define pu push #define loop for (int i = 0; i < n; i++) int32_t main() { int n, m; cin >> n >> m; int ar[n]; loop cin >> ar[i]; int sum = 0; loop sum += ar[i]; int l = (sum) / (4 * m); int flag = 0; for (int i = 0; i < n; i++) ...
#include <bits/stdc++.h> using namespace std; #define priority_queue pq #define pu push #define loop for (int i = 0; i < n; i++) int32_t main() { int n, m; cin >> n >> m; float ar[n]; loop cin >> ar[i]; float sum = 0; loop sum += ar[i]; float l = (sum) / (4 * m); int flag = 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
124
n,m = map(int,input().split()) a = [int(i) for i in input().split()] border = sum(a) / (4*m) a.sort(reverse=True) if a[m-1] > border: print("Yes") else: print("No") #print(border)
n,m = map(int,input().split()) a = [int(i) for i in input().split()] border = sum(a) / (4*m) a.sort(reverse=True) if a[m-1] >= border: print("Yes") else: print("No") #print(border)
[["-", 36, 36, 0, 656, 0, 57, 15, 666, 667, 47], ["+", 36, 36, 0, 656, 0, 57, 15, 666, 667, 20]]
5
79
#include <algorithm> #include <climits> #include <cmath> #include <iostream> #include <map> #include <queue> #include <set> #include <stack> #include <stdio.h> #include <string> #include <vector> using namespace std; typedef long long ll; typedef pair<int, int> P; const ll mod = 1000000007; const int inf = 1e9; cons...
#include <algorithm> #include <climits> #include <cmath> #include <iostream> #include <map> #include <queue> #include <set> #include <stack> #include <stdio.h> #include <string> #include <vector> using namespace std; typedef long long ll; typedef pair<int, int> P; const ll mod = 1000000007; const int inf = 1e9; cons...
[["-", 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]]
1
183
#include <algorithm> #include <bitset> #include <cmath> #include <cstring> #include <iomanip> #include <iostream> #include <map> #include <numeric> #include <queue> #include <regex> #include <string> #include <tuple> #include <vector> using namespace std; template <typename T> bool chmax(T &a, const T b) { if (a <=...
#include <algorithm> #include <bitset> #include <cmath> #include <cstring> #include <iomanip> #include <iostream> #include <map> #include <numeric> #include <queue> #include <regex> #include <string> #include <tuple> #include <vector> using namespace std; template <typename T> bool chmax(T &a, const T b) { if (a <=...
[["-", 8, 9, 0, 57, 15, 339, 51, 16, 17, 47], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 17, 20]]
1
2,152
#include <bits/stdc++.h> using namespace std; typedef long long ll; int main() { ios::sync_with_stdio(0); cin.tie(0); cout.tie(0); int n, m; cin >> n >> m; int arr[200]; int sum = 0; for (int i = 1; i <= n; i++) { cin >> arr[i]; sum += arr[i]; } int q; if (sum / (4 * m) != 0) q = sum ...
#include <bits/stdc++.h> using namespace std; typedef long long ll; int main() { ios::sync_with_stdio(0); cin.tie(0); cout.tie(0); int n, m; cin >> n >> m; int arr[200]; int sum = 0; for (int i = 1; i <= n; i++) { cin >> arr[i]; sum += arr[i]; } int q; if (sum % (4 * m) != 0) q = sum ...
[["-", 0, 57, 15, 339, 51, 16, 31, 16, 17, 85], ["+", 0, 57, 15, 339, 51, 16, 31, 16, 17, 109]]
1
189
#include <algorithm> #include <iostream> using namespace std; int main() { int i, j, m, n, a[100], sum = 0; cin >> n >> m; for (i = 0; i < n; i++) { cin >> a[i]; sum += a[i]; } float x; x = sum / (4 * m); sort(a, a + n); if (a[n - m] >= x) cout << "Yes"; else cout << "No"; }
#include <algorithm> #include <iostream> using namespace std; int main() { int i, j, m, n, a[100], sum = 0; cin >> n >> m; for (i = 0; i < n; i++) { cin >> a[i]; sum += a[i]; } float x; x = 1.0 * sum / (4 * m); sort(a, a + n); if (a[n - m] >= x) cout << "Yes"; else cout << "No"; }
[["+", 0, 1, 0, 11, 12, 16, 31, 16, 31, 13], ["+", 0, 1, 0, 11, 12, 16, 31, 16, 17, 48]]
1
113
#include <iostream> using namespace std; int main() { int N, M; cin >> N >> M; double arr[N]; for (int i = 0; i < N; i++) { cin >> arr[i]; } double total = 0; for (int i = 0; i < N; i++) { total += arr[i]; } int count = 0; for (int i = 0; i < N; i++) { if (count == M) { break; ...
#include <iostream> using namespace std; int main() { int N, M; cin >> N >> M; double arr[N]; for (int i = 0; i < N; i++) { cin >> arr[i]; } double total = 0; for (int i = 0; i < N; i++) { total += arr[i]; } int count = 0; for (int i = 0; i < N; i++) { if (count == M) { break; ...
[["-", 12, 23, 0, 16, 12, 23, 0, 16, 12, 22], ["+", 12, 23, 0, 16, 12, 23, 0, 16, 12, 22]]
1
163
N, M = list(map(int, input().split())) A = list(map(int, input().split())) n_votes = sum(A) print('Yes' if sum(map(lambda x: 4 * M * x > n_votes, A)) >= M else 'No')
N, M = list(map(int, input().split())) A = list(map(int, input().split())) n_votes = sum(A) print('Yes' if sum(map(lambda x: 4 * M * x >= n_votes, A)) >= M else 'No')
[["-", 0, 652, 3, 4, 0, 670, 8, 666, 667, 47], ["+", 0, 652, 3, 4, 0, 670, 8, 666, 667, 20]]
5
73
// NK #include <bits/stdc++.h> using namespace std; #define ii pair<int, int> #define ll long long #define vi vector<int> #define vii vector<ii> #define vll vector<ll> #define pb push_back #define eb emplace_back #define pob pop_back #define psf push_front #define pof pop_front #define mkp make_pair #define mkt make_tu...
// NK #include <bits/stdc++.h> using namespace std; #define ii pair<int, int> #define ll long long #define vi vector<int> #define vii vector<ii> #define vll vector<ll> #define pb push_back #define eb emplace_back #define pob pop_back #define psf push_front #define pof pop_front #define mkp make_pair #define mkt make_tu...
[["+", 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
183
N, M = map(int, input().split()) A = [int(i) for i in input().split()] total = sum(A) ans = sum([1 for a in A if a>=total/(4*M)]) print('Yes' if total >=M else 'No')
N, M = map(int, input().split()) A = [int(i) for i in input().split()] total = sum(A) ans = sum([1 for a in A if a>=total/(4*M)]) print('Yes' if ans >=M else 'No')
[["-", 0, 652, 3, 4, 0, 41, 0, 666, 0, 22], ["+", 0, 652, 3, 4, 0, 41, 0, 666, 0, 22]]
5
76
#include "math.h" #include <algorithm> #include <iomanip> #include <iostream> #include <vector> #define MAX 100000000 int a[MAX]; using namespace std; int main() { int n, m, sum = 0, count = 0; cin >> n >> m; for (int i = 0; i < n; i++) { cin >> a[i]; sum += a[i]; } double sumd = (double)sum / (4.0 ...
#include "math.h" #include <algorithm> #include <iomanip> #include <iostream> #include <vector> #define MAX 100000000 int a[MAX]; using namespace std; int main() { int n, m, sum = 0, count = 0; cin >> n >> m; for (int i = 0; i < n; i++) { cin >> a[i]; sum += a[i]; } double sumd = (double)sum / (4.0 ...
[["-", 8, 9, 0, 57, 15, 339, 51, 16, 17, 47], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 17, 20]]
1
146
#include <bits/stdc++.h> using namespace std; int main() { int n, m; cin >> n >> m; int a[n]; for (int i = 1; i <= n; i++) cin >> a[i]; int sum = 0; for (int i = 1; i <= n; i++) sum = sum + a[i]; int div = sum / (4 * m); int c = 0; for (int i = 1; i <= n; i++) { if (a[i] >= div) c++;...
#include <bits/stdc++.h> using namespace std; int main() { int n, m; cin >> n >> m; int a[n]; for (int i = 1; i <= n; i++) cin >> a[i]; int sum = 0; for (int i = 1; i <= n; i++) sum = sum + a[i]; float div = sum * 1.0 / (4 * m); int c = 0; for (int i = 1; i <= n; i++) { if (a[i] >= div) ...
[["-", 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, 17, 48], ["+", 0, 43, 49, 50, 51, 16, 31, 16, 12, 13]]
1
145
#include <bits/stdc++.h> using namespace std; int main() { int n, m; cin >> n >> m; int sum = 0; int count = 0; vector<int> a(n); for (int i = 0; i < n; i++) { cin >> a.at(i); sum += a.at(i); } for (int i = 0; i < n; i++) { if (sum / (4 * m) <= a.at(i)) { count++; } } if ...
#include <bits/stdc++.h> using namespace std; int main() { int n, m; cin >> n >> m; double sum = 0; int count = 0; vector<int> a(n); for (int i = 0; i < n; i++) { cin >> a.at(i); sum += a.at(i); } for (int i = 0; i < n; i++) { if (sum / (4 * m) <= a.at(i)) { count++; } } ...
[["-", 0, 30, 0, 14, 8, 9, 0, 43, 39, 40], ["+", 0, 30, 0, 14, 8, 9, 0, 43, 39, 40]]
1
141
#include <algorithm> #include <iostream> #include <vector> using namespace std; typedef long long ll; #define rep(i, n) for (int i = 0; i < (n); i++) int main() { ll n, m, sum; sum = 0; cin >> n >> m; ll a[n]; rep(i, n) cin >> a[i]; rep(i, n) sum += a[i]; sort(a, a + n); double border = sum / (4 * m); ...
#include <algorithm> #include <iostream> #include <vector> using namespace std; typedef long long ll; #define rep(i, n) for (int i = 0; i < (n); i++) int main() { ll n, m; double sum = 0; cin >> n >> m; ll a[n]; rep(i, n) cin >> a[i]; rep(i, n) sum += a[i]; sort(a, a + n); double border = sum / (4 * m);...
[["-", 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, 39, 40], ["-", 31, 69, 341, 342, 0, 16, 31, 16, 17, 33], ["-", 31, 69, 341, 342, 0, 16, 31, 16, 12, 13]]
1
133
nums = list(map(int, input().split())) n = nums[0] m = nums[1] a = list(map(int, input().split())) sum = 0 for v in a: sum += v result = [] for s in a: if s >= sum * (1 / (4 * m)): result.append(s) print(result) if len(result) >= m: print("Yes") else: print("No")
nums = list(map(int, input().split())) n = nums[0] m = nums[1] a = list(map(int, input().split())) sum = 0 for v in a: sum += v result = [] for s in a: if s >= sum * (1 / (4 * m)): result.append(s) if len(result) >= m: print("Yes") else: print("No")
[["-", 36, 36, 0, 656, 0, 1, 0, 652, 63, 22], ["-", 0, 656, 0, 1, 0, 652, 3, 4, 0, 24], ["-", 0, 656, 0, 1, 0, 652, 3, 4, 0, 22], ["-", 0, 656, 0, 1, 0, 652, 3, 4, 0, 25]]
5
113
n, m = [0] * 2 a = [] def format_input(filename = None): global n, m global a if filename == None: n, m = list(map(int, input().split())) a = list(map(int, input().split())) elif filename == '__random__': from random import randint as rng n = rng(1, 10**2) m = rng(1, n) a = [rng(1, 10**3) for i in r...
n, m = [0] * 2 a = [] def format_input(filename = None): global n, m global a if filename == None: n, m = list(map(int, input().split())) a = list(map(int, input().split())) elif filename == '__random__': from random import randint as rng n = rng(1, 10**2) m = rng(1, n) a = [rng(1, 10**3) for i in r...
[["+", 0, 57, 15, 666, 0, 657, 31, 23, 0, 24], ["+", 31, 23, 0, 657, 31, 652, 3, 4, 0, 25], ["+", 15, 666, 0, 657, 31, 23, 0, 657, 17, 33], ["+", 15, 666, 0, 657, 31, 23, 0, 657, 12, 612]]
5
205
#include <algorithm> #include <iostream> #include <string> #include <vector> using namespace std; int main() { int n, m; cin >> n >> m; vector<int> v(n); int sum = 0; //総和 for (int i = 0; i < n; i++) { cin >> v[i]; sum += v[i]; } int count = 0; // OKな個数 for (int i = 0; i < n; i++) { if ((sum...
#include <algorithm> #include <iostream> #include <string> #include <vector> using namespace std; int main() { int n, m; cin >> n >> m; vector<int> v(n); int sum = 0; //総和 for (int i = 0; i < n; i++) { cin >> v[i]; sum += v[i]; } int count = 0; // OKな個数 for (int i = 0; i < n; i++) { if ((sum...
[["+", 51, 16, 31, 16, 31, 23, 0, 16, 17, 33], ["+", 51, 16, 31, 16, 31, 23, 0, 16, 12, 13], ["-", 8, 9, 0, 57, 15, 339, 51, 16, 17, 19], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 17, 18]]
1
141
#include <iostream> #include <string> using namespace std; int main() { int n, m, i, count = 0, all = 0; cin >> n >> m; int a[n]; for (i = 0; i < n; i++) { cin >> a[i]; all += a[i]; } for (i = 0; i < n; i++) { if (a[i] >= all / (4 * m)) { count++; } } if (count >= m) { cout <...
#include <iostream> #include <string> using namespace std; int main() { int n, m, i; double count = 0, all = 0; cin >> n >> m; int a[n]; for (i = 0; i < n; i++) { cin >> a[i]; all += a[i]; } for (i = 0; i < n; i++) { if (a[i] >= all / (4 * m)) { count++; } } if (count >= m) { ...
[["-", 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
#include <bits/stdc++.h> #define long long long int using namespace std; int main() { ios_base::sync_with_stdio(false); cin.tie(nullptr); int n, m; cin >> n >> m; vector<long> a(n); for (int i = 0; i < n; ++i) { cin >> a[i]; } vector<long> res; long sum = accumulate(a.begin(), a.end(), 0); l...
#include <bits/stdc++.h> #define long long long int using namespace std; int main() { ios_base::sync_with_stdio(false); cin.tie(nullptr); int n, m; cin >> n >> m; vector<long> a(n); for (int i = 0; i < n; ++i) { cin >> a[i]; } vector<long> res; long sum = accumulate(a.begin(), a.end(), 0); d...
[["-", 0, 14, 8, 9, 0, 43, 39, 86, 0, 96], ["+", 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]]
1
169
#include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < n; i++) typedef long long ll; using namespace std; int main() { int n, m; int sum = 0; cin >> n >> m; int a[n]; rep(i, n) { cin >> a[i]; sum += a[i]; } sort(a, a + n); if (a[n - m] >= sum / (4 * m)) { cout << "Yes" << endl; ...
#include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < n; i++) typedef long long ll; using namespace std; int main() { int n; int m; double sum = 0; cin >> n >> m; double a[n]; rep(i, n) { cin >> a[i]; sum += a[i]; } sort(a, a + n); if (a[n - m] >= sum / (4 * m)) { cout << "Yes...
[["-", 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, 35], ["+", 0, 30, 0, 14, 8, 9, 0, 43, 39, 40], ["-", 0, 30, 0, 14, 8, 9, 0, 43, 39, 40]]
1
116
#include <bits/stdc++.h> using namespace std; int main() { int N, M; cin >> N >> M; vector<int> A(N); for (int i = 0; i < N; i++) cin >> A.at(i); int sum = 0; for (int i = 0; i < N; i++) sum += A.at(i); int cnt = 0; for (int i = 0; i < N; i++) { if (A.at(i) * 4 * M > sum) cnt++; } ...
#include <bits/stdc++.h> using namespace std; int main() { int N, M; cin >> N >> M; vector<int> A(N); for (int i = 0; i < N; i++) cin >> A.at(i); int sum = 0; for (int i = 0; i < N; i++) sum += A.at(i); int cnt = 0; for (int i = 0; i < N; i++) { if (A.at(i) * 4 * M >= sum) cnt++; }...
[["-", 8, 9, 0, 57, 15, 339, 51, 16, 17, 47], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 17, 20]]
1
148
n, m = map(int,input().split()) A = list(map(int,input().split())) total = sum(A) th = total/(4*m) A = sorted(A,reverse=True) ans = 'Yes' for i in range(m): if A[i] > th: continue else: ans = 'No' print(ans)
n, m = map(int,input().split()) A = list(map(int,input().split())) total = sum(A) th = total/(4*m) A = sorted(A,reverse=True) ans = 'Yes' for i in range(m): if A[i] >= th: continue else: ans = 'No' print(ans)
[["-", 0, 7, 8, 196, 0, 57, 15, 666, 667, 47], ["+", 0, 7, 8, 196, 0, 57, 15, 666, 667, 20]]
5
91
#include <algorithm> #include <bits/stdc++.h> #include <cmath> #include <cstdio> #include <iostream> #include <map> #include <string> #include <utility> #include <vector> using namespace std; typedef pair<long long, bool> Pair; const long long INF = 1LL << 60; int main() { long long N, M; long long cnt = 0; l...
#include <algorithm> #include <bits/stdc++.h> #include <cmath> #include <cstdio> #include <iostream> #include <map> #include <string> #include <utility> #include <vector> using namespace std; typedef pair<long long, bool> Pair; const long long INF = 1LL << 60; int main() { long long N, M; long long cnt = 0; l...
[["-", 8, 9, 0, 57, 15, 339, 51, 16, 17, 47], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 17, 20]]
1
171
#include <bits/stdc++.h> #define rep(i, a, n) for (int i = a; i < n; i++) #define repr(i, a, n) for (int i = n - 1; i >= a; i--) using namespace std; using ll = long long; using P = pair<int, int>; int main() { ios::sync_with_stdio(false); cin.tie(0); int n, m, sum_val = 0; cin >> n >> m; vector<int> a(n); ...
#include <bits/stdc++.h> #define rep(i, a, n) for (int i = a; i < n; i++) #define repr(i, a, n) for (int i = n - 1; i >= a; i--) using namespace std; using ll = long long; using P = pair<int, int>; int main() { ios::sync_with_stdio(false); cin.tie(0); double n, m, sum_val = 0; cin >> n >> m; vector<int> a(n...
[["-", 0, 30, 0, 14, 8, 9, 0, 43, 39, 40], ["+", 0, 30, 0, 14, 8, 9, 0, 43, 39, 40], ["-", 51, 16, 12, 16, 12, 23, 0, 16, 31, 13], ["+", 51, 16, 12, 16, 12, 23, 0, 16, 31, 13]]
1
168
#At coder 2020/3/27 C # スペース区切りの整数の入力 N,M= map(int, input().split()) A = list(map(int, input().split())) sumA=sum(A) numM = sum(x>=(sumA*0.25/M) for x in A) if numM>M: ans='Yes' else: ans='No' #print(numM,M) print(ans)
#At coder 2020/3/27 C # スペース区切りの整数の入力 N,M= map(int, input().split()) A = list(map(int, input().split())) sumA=sum(A) numM = sum(x>=(sumA*0.25/M) for x in A) if numM>=M: ans='Yes' else: ans='No' #print(numM,M) print(ans)
[["-", 36, 36, 0, 656, 0, 57, 15, 666, 667, 47], ["+", 36, 36, 0, 656, 0, 57, 15, 666, 667, 20]]
5
81
#include <stdio.h> #include <stdlib.h> #include <string.h> #define MAX 100 int cmpfunc(const void *n1, const void *n2) { if (*(int *)n1 < *(int *)n2) return 1; else if (*(int *)n1 > *(int *)n2) return -1; else return 0; } int main() { int n, m; int a[MAX]; scanf("%d%d", &n, &m); for (int i ...
#include <stdio.h> #include <stdlib.h> #include <string.h> #define MAX 100 int cmpfunc(const void *n1, const void *n2) { if (*(int *)n1 < *(int *)n2) return 1; else if (*(int *)n1 > *(int *)n2) return -1; else return 0; } int main() { int n, m; int a[MAX]; scanf("%d%d", &n, &m); for (int i ...
[["+", 0, 16, 12, 16, 31, 74, 51, 23, 0, 25], ["+", 0, 16, 12, 16, 12, 74, 39, 77, 39, 40], ["+", 15, 23, 0, 16, 12, 16, 12, 74, 0, 25], ["+", 0, 16, 12, 16, 12, 74, 51, 23, 0, 24], ["-", 12, 74, 51, 23, 0, 16, 12, 23, 0, 25]]
0
218
#include <bits/stdc++.h> using namespace std; #define ll long long int int main() { ll n, m, cnt = 0; double sum = 0.0, a; vector<double> v; cin >> n >> m; for (ll i = 1; i <= n; i++) { cin >> a; sum = sum + a; v.push_back(a); } sort(v.begin(), v.end()); double tm = sum / (4.0 * (m * 1.0))...
#include <bits/stdc++.h> using namespace std; #define ll long long int int main() { ll n, m, cnt = 0; double sum = 0.0, a; vector<double> v; cin >> n >> m; for (ll i = 1; i <= n; i++) { cin >> a; sum = sum + a; v.push_back(a); } sort(v.begin(), v.end()); double tm = sum / (4.0 * (m * 1.0))...
[["-", 0, 7, 8, 9, 0, 57, 75, 76, 0, 95], ["-", 8, 9, 0, 57, 75, 76, 0, 9, 0, 45], ["+", 0, 14, 8, 9, 0, 7, 8, 9, 0, 46], ["-", 0, 9, 0, 57, 75, 76, 0, 9, 0, 46], ["-", 0, 57, 75, 76, 0, 9, 0, 93, 0, 94], ["-", 0, 57, 75, 76, 0, 9, 0, 93, 0, 35], ["-", 8, 9, 0, 57, 75, 76, 0, 9, 0, 46]]
1
177
#include <bits/stdc++.h> using namespace std; int main() { int n, m; cin >> n >> m; vector<int> a(n); int tmp, total = 0; for (int i = 0; i < n; ++i) { cin >> tmp; total += tmp; a[i] = tmp; } int s = 0; for (int i = 0; i < n; ++i) { if (a[i] * 4 * m >= total) s++; } if (...
#include <bits/stdc++.h> using namespace std; int main() { int n, m; cin >> n >> m; vector<int> a(n); int tmp, total = 0; for (int i = 0; i < n; ++i) { cin >> tmp; total += tmp; a[i] = tmp; } int s = 0; for (int i = 0; i < n; ++i) { if (a[i] * 4 * m >= total) s++; } if (...
[["-", 75, 76, 0, 1, 0, 16, 12, 5, 0, 6], ["+", 75, 76, 0, 1, 0, 16, 12, 5, 0, 6]]
1
128
// RITIK RAI: //#pragma GCC optimize("O3") /*----------------------------------------------------------------------------------------------------------*/ #include <bits/stdc++.h> using namespace std; #define pb push_back /*------------------------------------------------------------------------------------------------...
// RITIK RAI: //#pragma GCC optimize("O3") /*----------------------------------------------------------------------------------------------------------*/ #include <bits/stdc++.h> using namespace std; #define pb push_back /*------------------------------------------------------------------------------------------------...
[["-", 0, 14, 8, 9, 0, 43, 39, 343, 345, 348], ["-", 0, 14, 8, 9, 0, 43, 39, 343, 0, 349], ["-", 0, 9, 0, 57, 15, 339, 51, 16, 17, 47], ["+", 0, 9, 0, 57, 15, 339, 51, 16, 17, 20]]
1
382
#include <bits/stdc++.h> using namespace std; int main() { int n, m; cin >> n >> m; int a[n]; int sum = 0; for (int i = 0; i < n; i++) { cin >> a[i]; sum += a[i]; } int count = 0; for (int i = 0; i < n; i++) { if (a[i] > (float)sum / float(4 * m)) ++count; } if (count >= m) ...
#include <bits/stdc++.h> using namespace std; int main() { int n, m; cin >> n >> m; int a[n]; int sum = 0; for (int i = 0; i < n; i++) { cin >> a[i]; sum += a[i]; } int count = 0; for (int i = 0; i < n; i++) { if (a[i] >= (float)sum / float(4 * m)) ++count; } if (count >= m) ...
[["-", 8, 9, 0, 57, 15, 339, 51, 16, 17, 47], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 17, 20]]
1
126
#include <bits/stdc++.h> #define ll long long int #define mod 1000000007 #define se second #define fi first #define endl "\n" using namespace std; int main() { ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0); ll n, m; cin >> n >> m; ll arr[n]; ll x, y, z; x = 0; for (int a = 0; a < n; a++) {...
#include <bits/stdc++.h> #define ll long long int #define mod 1000000007 #define se second #define fi first #define endl "\n" using namespace std; int main() { ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0); ll n, m; cin >> n >> m; double arr[n]; double x, y, z; x = 0; for (int a = 0; a < n...
[["-", 0, 30, 0, 14, 8, 9, 0, 43, 39, 78], ["+", 0, 30, 0, 14, 8, 9, 0, 43, 39, 40]]
1
170
#include <bits/stdc++.h> #define mp make_pair #define pr pair<ll, ll> #define MAX 1000000 using namespace std; typedef long long int ll; #define mod 998244353 void sync() { ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL); } int main() { sync(); ll m, n; cin >> n >> m; ll a[n]; ll sum = ...
#include <bits/stdc++.h> #define mp make_pair #define pr pair<ll, ll> #define MAX 1000000 using namespace std; typedef long long int ll; #define mod 998244353 void sync() { ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL); } int main() { sync(); ll m, n; cin >> n >> m; ll a[n]; ll sum = ...
[["+", 3, 4, 0, 16, 12, 23, 0, 16, 17, 72], ["+", 3, 4, 0, 16, 12, 23, 0, 16, 12, 13]]
1
199
'use strict' function main(inp) { inp = inp.trim().split('\n'); // 必要な変数をそれぞれ格納 let NandM = inp[0].split(' ').map(x => x * 1); let N = NandM[0]; let M = NandM[1]; let A = inp[1].split(' ').map(x => x * 1).sort((a, b) => {return b - a}); let ans = "Yes"; // 合計値を調べる let Sum = A.reduce((a, c) => a + c); ...
'use strict' function main(inp) { inp = inp.trim().split('\n'); // 必要な変数をそれぞれ格納 let NandM = inp[0].split(' ').map(x => x * 1); let N = NandM[0]; let M = NandM[1]; let A = inp[1].split(' ').map(x => x * 1).sort((a, b) => {return b - a}); let ans = "Yes"; // 合計値を調べる let Sum = A.reduce((a, c) => a + c); ...
[["-", 8, 556, 0, 57, 15, 23, 0, 16, 17, 19], ["+", 8, 556, 0, 57, 15, 23, 0, 16, 17, 18]]
2
200
#include <bits/stdc++.h> using namespace std; int main(void) { long long int N, M, all, tmp1; long double tmp2; all = 0; cin >> N >> M; long long int A[N]; memset(A, 0, N); for (int i = 0; i < N; i++) { cin >> A[i]; all += A[i]; } for (int i = 0; i < N; i++) { for (int j = N - 1; j > i...
#include <bits/stdc++.h> using namespace std; int main(void) { long long int N, M, all, tmp1; long double tmp2; all = 0; cin >> N >> M; long long int A[N]; memset(A, 0, N); for (int i = 0; i < N; i++) { cin >> A[i]; all += A[i]; } for (int i = 0; i < N; i++) { for (int j = N - 1; j > i...
[["-", 8, 9, 0, 57, 15, 339, 51, 16, 17, 47], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 17, 20]]
1
218
n,m = map(int,input().split()) tmp = input() a = tmp.split() a = list(map(int,a)) limit = sum(a) / (4 * m) count = 0 for i in a: if i > limit: count += 1 if count >= m: print("Yes") else: print("No")
n,m = map(int,input().split()) tmp = input() a = tmp.split() a = list(map(int,a)) limit = sum(a) / (4 * m) count = 0 for i in a: if i >= limit: count += 1 if count >= m: print("Yes") else: print("No")
[["-", 0, 7, 8, 196, 0, 57, 15, 666, 667, 47], ["+", 0, 7, 8, 196, 0, 57, 15, 666, 667, 20]]
5
86
#pragma GCC optimize("Ofast") //インクルード #include <algorithm> //sort,二分探索,など #include <bitset> //固定長bit集合 #include <cmath> //pow,logなど #include <complex> //複素数 #include <deque> //両端アクセスのキュー #include <functional> //sortのgreater #include <iomanip> //setprecision(浮動小数点の出力の誤差) #incl...
#pragma GCC optimize("Ofast") //インクルード #include <algorithm> //sort,二分探索,など #include <bitset> //固定長bit集合 #include <cmath> //pow,logなど #include <complex> //複素数 #include <deque> //両端アクセスのキュー #include <functional> //sortのgreater #include <iomanip> //setprecision(浮動小数点の出力の誤差) #incl...
[["-", 0, 1, 0, 16, 31, 16, 12, 5, 0, 6], ["+", 0, 1, 0, 16, 31, 16, 12, 5, 0, 6]]
1
279
n, m = map(int, input().split()) a = list(map(int, input().split())) a.sort() a.reverse() _sum = sum(a) ans = "Yes" if a[m - 1] > _sum / (4 * m) else "No" print(ans)
n, m = map(int, input().split()) a = list(map(int, input().split())) a.sort() a.reverse() _sum = sum(a) ans = "Yes" if a[m - 1] >= _sum / (4 * m) else "No" print(ans)
[["-", 0, 1, 0, 662, 12, 41, 0, 666, 667, 47], ["+", 0, 1, 0, 662, 12, 41, 0, 666, 667, 20]]
5
77
N,M = list(map(int,input().split())) A = list(map(int,input().split())) list.sort(A,reverse=True) count = 0 Sum = sum(A) for i in range(M): if A[i] > Sum/(4*M): count +=1 if M ==count: print("Yes") else: print("No")
N,M = list(map(int,input().split())) A = list(map(int,input().split())) list.sort(A,reverse=True) count = 0 Sum = sum(A) for i in range(M): if A[i] >= Sum/(4*M): count +=1 if M ==count: 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
99
#include <math.h> #include <stdio.h> #include <stdlib.h> #include <string.h> int ASC(const void *a, const void *b) { return *(int *)b - *(int *)a; //降順 } int main(void) { int n, m, a[1001], vote = 0, ans = 0; double keep; scanf("%d%d", &n, &m); for (int i = 0; i < n; i++) { scanf("%d", &a[i]); vote ...
#include <math.h> #include <stdio.h> #include <stdlib.h> #include <string.h> int ASC(const void *a, const void *b) { return *(int *)b - *(int *)a; //降順 } int main(void) { int n, m, a[1001], vote = 0, ans = 0; double keep; scanf("%d%d", &n, &m); for (int i = 0; i < n; i++) { scanf("%d", &a[i]); vote ...
[["+", 0, 57, 15, 23, 0, 16, 31, 74, 0, 24], ["+", 15, 23, 0, 16, 31, 74, 39, 77, 39, 40], ["+", 0, 57, 15, 23, 0, 16, 31, 74, 0, 25], ["-", 8, 9, 0, 57, 15, 23, 0, 16, 17, 47], ["+", 8, 9, 0, 57, 15, 23, 0, 16, 17, 20]]
0
181
#include <bits/stdc++.h> using namespace std; using Graph = vector<vector<int>>; int main() { int n, m, sum = 0; cin >> n >> m; vector<int> a(n); for (int i = 0; i < n; ++i) { cin >> a[i]; sum += a[i]; } sort(a.begin(), a.end()); if (a[n - m] < sum / (4 * m)) { cout << "No"; } else ...
#include <bits/stdc++.h> using namespace std; using Graph = vector<vector<int>>; int main() { long double n, m, sum = 0; cin >> n >> m; vector<long double> a(n); for (int i = 0; i < n; ++i) { cin >> a[i]; sum += a[i]; } sort(a.begin(), a.end()); if (a[n - m] < sum / (4 * m)) { cout << "No...
[["-", 0, 30, 0, 14, 8, 9, 0, 43, 39, 40], ["+", 0, 14, 8, 9, 0, 43, 39, 86, 0, 96], ["+", 0, 14, 8, 9, 0, 43, 39, 86, 39, 40], ["-", 0, 43, 39, 344, 3, 347, 0, 77, 39, 40], ["+", 39, 344, 3, 347, 0, 77, 39, 86, 0, 96], ["+", 39, 344, 3, 347, 0, 77, 39, 86, 39, 40]]
1
127
#include <bits/stdc++.h> #include <cstring> #include <limits> using namespace std; #define lli long long int #define f first #define s second #define fw(i, start, end) for (lli i = start; i < end; ++i) int main() { ios::sync_with_stdio(false); cin.tie(nullptr); lli n, m; cin >> n >> m; float a[n]; lli s = 0...
#include <bits/stdc++.h> #include <cstring> #include <limits> using namespace std; #define lli long long int #define f first #define s second #define fw(i, start, end) for (lli i = start; i < end; ++i) int main() { ios::sync_with_stdio(false); cin.tie(nullptr); lli n; float m; cin >> n >> m; float a[n]; f...
[["-", 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, 78], ["+", 0, 43, 49, 50, 51, 16, 12, 74, 0, 24], ["+", 49, 50, 51, 16, 12, 74, 39, 77, 39, 40], ["+", 0, 43, 49, 50, 51, 16, 12, 74, 0, 25]]
1
169
#include <iostream> #include <vector> using namespace std; int N, M; vector<int> A; int main() { cin >> N; cin >> M; A = vector<int>(N); int sum = 0; for (int i = 0; i < N; i++) { cin >> A[i]; sum += A[i]; } int b = (sum - 1) / (4 * M); int m = 0; for (int i = 0; i < N && m < M; i++...
#include <iostream> #include <vector> using namespace std; int N, M; vector<int> A; int main() { cin >> N; cin >> M; A = vector<int>(N); int sum = 0; for (int i = 0; i < N; i++) { cin >> A[i]; sum += A[i]; } int b = (sum - 1) / (4 * M); int m = 0; for (int i = 0; i < N && m < M; i++...
[["-", 8, 9, 0, 57, 15, 339, 51, 16, 17, 20], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 17, 47]]
1
153
#include <bits/stdc++.h> using namespace std; int main() { ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL); int n, m; cin >> n >> m; int a[105]; int total = 0; for (int i = 1; i <= n; i++) cin >> a[i], total += a[i]; int x = 0; for (int i = 1; i <= n; i++) { if (4 * m * ...
#include <bits/stdc++.h> using namespace std; int main() { ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL); int n, m; cin >> n >> m; int a[105]; int total = 0; for (int i = 1; i <= n; i++) cin >> a[i], total += a[i]; int x = 0; for (int i = 1; i <= n; i++) { if (4 * m * ...
[["-", 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; int main() { int N, M; cin >> N >> M; vector<int> vote(N); for (int i = 0; i < N; i++) { cin >> vote.at(i); } sort(vote.begin(), vote.end()); reverse(vote.begin(), vote.end()); bool answer = true; int sum = 0; for (int i = 0; i < N; i++) { sum ...
#include <bits/stdc++.h> using namespace std; int main() { int N, M; cin >> N >> M; vector<double> vote(N); for (int i = 0; i < N; i++) { cin >> vote.at(i); } sort(vote.begin(), vote.end()); reverse(vote.begin(), vote.end()); bool answer = true; double sum = 0; for (int i = 0; i < N; i++) { ...
[["-", 0, 43, 39, 344, 3, 347, 0, 77, 39, 40], ["+", 0, 43, 39, 344, 3, 347, 0, 77, 39, 40], ["-", 0, 30, 0, 14, 8, 9, 0, 43, 39, 40], ["+", 0, 30, 0, 14, 8, 9, 0, 43, 39, 40]]
1
188
N,M=map(int,input().split()) A=list(map(int, input().split())) list.sort(A,reverse=True) sumnum = sum(A) if A[M-1] > (sumnum/(4*M)): print("Yes") else: print("No")
N,M=map(int,input().split()) A=list(map(int, input().split())) list.sort(A,reverse=True) sumnum = sum(A) if A[M-1] >= (sumnum/(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
81
#include <bits/stdc++.h> #define VI vector<int> #define VVI vector<vector<int>> #define REP(i, n) for (int i = 0; i < (n); i++) #define MOD 1000000007 #define INF 1e9 #define All(x) (x).begin(), (x).end() typedef long long ll; using namespace std; int main() { int N, M; cin >> N >> M; VI A(N); int sum = 0; R...
#include <bits/stdc++.h> #define VI vector<int> #define VVI vector<vector<int>> #define REP(i, n) for (int i = 0; i < (n); i++) #define MOD 1000000007 #define INF 1e9 #define All(x) (x).begin(), (x).end() typedef long long ll; using namespace std; int main() { int N, M; cin >> N >> M; VI A(N); int sum = 0; R...
[["+", 3, 4, 0, 16, 31, 16, 31, 74, 0, 24], ["+", 0, 16, 31, 16, 31, 74, 39, 77, 39, 40], ["+", 3, 4, 0, 16, 31, 16, 31, 74, 0, 25], ["-", 0, 14, 8, 9, 0, 7, 15, 16, 17, 20], ["+", 0, 14, 8, 9, 0, 7, 15, 16, 17, 47]]
1
159
#include <bits/stdc++.h> using namespace std; typedef long long ll; const int N = 120; int a[N]; int n, m; int main() { // freopen("in.txt","r",stdin); cin >> n >> m; int sum = 0; for (int i = 0; i < n; i++) { cin >> a[i]; sum += a[i]; } int cnt = 0; for (int i = 0; i < n; i++) { if (4 * m * ...
#include <bits/stdc++.h> using namespace std; typedef long long ll; const int N = 120; int a[N]; int n, m; int main() { // freopen("in.txt","r",stdin); cin >> n >> m; int sum = 0; for (int i = 0; i < n; i++) { cin >> a[i]; sum += a[i]; } int cnt = 0; for (int i = 0; i < n; i++) { if (4 * m * ...
[["-", 8, 9, 0, 57, 15, 339, 51, 16, 17, 47], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 17, 20]]
1
137
import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner scan = new Scanner(System.in); int N = scan.nextInt(); int M = scan.nextInt(); int A[] = new int[N]; String coment = "No"; int total = 0; for (int i = 0; i < N; i++) { A[i] = scan.nextInt...
import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner scan = new Scanner(System.in); int N = scan.nextInt(); int M = scan.nextInt(); int A[] = new int[N]; String coment = "No"; int total = 0; for (int i = 0; i < N; i++) { A[i] = scan.nextInt...
[["-", 8, 196, 0, 57, 15, 15, 0, 16, 17, 47], ["+", 8, 196, 0, 57, 15, 15, 0, 16, 17, 20]]
3
199
n, m = map(int, input().split()) a = [int(i) for i in input().split()] a.sort() if a[-m] > sum(a)*1/(4*m): print("Yes") else: print("No")
n, m = map(int, input().split()) a = [int(i) for i in input().split()] a.sort() if a[-m] >= sum(a)*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
73
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(); Integer[] a = new Integer[n]; int total = 0; for (int i = 0; i < n; i++) { a[i] = sc.nextInt(); total += 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(); Integer[] a = new Integer[n]; int total = 0; for (int i = 0; i < n; i++) { a[i] = sc.nextInt(); total += a[i]; } ...
[["-", 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, 74, 0, 24], ["+", 49, 200, 51, 16, 31, 74, 39, 511, 0, 512], ["+", 0, 503, 49, 200, 51, 16, 31, 74, 0, 25]]
3
166
#include <bits/stdc++.h> #include <iostream> #include <string> using namespace std; int main() { int n, m; cin >> n >> m; int a[n]; int SUM = 0; for (int i = 0; i < n; i++) { cin >> a[i]; SUM += a[i]; } int lim = SUM / (4 * m); sort(a, a + n, std::greater<int>()); bool flag = 1; for (i...
#include <bits/stdc++.h> #include <iostream> #include <string> using namespace std; int main() { int n, m; cin >> n >> m; double a[n]; double SUM = 0; for (int i = 0; i < n; i++) { cin >> a[i]; SUM += a[i]; } double lim = SUM / (4.0 * m); sort(a, a + n, std::greater<double>()); bool flag...
[["-", 0, 30, 0, 14, 8, 9, 0, 43, 39, 40], ["+", 0, 30, 0, 14, 8, 9, 0, 43, 39, 40], ["-", 49, 50, 51, 16, 12, 23, 0, 16, 31, 13], ["+", 49, 50, 51, 16, 12, 23, 0, 16, 31, 13], ["-", 63, 343, 141, 346, 3, 347, 0, 77, 39, 40], ["+", 63, 343, 141, 346, 3, 347, 0, 77, 39, 40]]
1
168
#include <bits/stdc++.h> using namespace std; int main() { int n, m; cin >> n >> m; vector<int> elects(n); for (int i = 0; i < n; i++) cin >> elects.at(i); // sort sort(elects.begin(), elects.end()); // total double total; for (int i = 0; i < n; i++) total += elects.at(i); // conpare ele...
#include <bits/stdc++.h> using namespace std; int main() { int n, m; cin >> n >> m; vector<int> elects(n); for (int i = 0; i < n; i++) cin >> elects.at(i); // sort sort(elects.begin(), elects.end()); // total double total; for (int i = 0; i < n; i++) total += elects.at(i); // conpare ele...
[["-", 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> //短縮 #define rep(i, n) for (int i = 0; i < (n); ++i) // sort()用 #define all(v) v.begin(), v.end() using namespace std; int main() { int N, M; cin >> N >> M; vector<int> A(N); rep(i, N) cin >> A.at(i); int count = 0, sum = 0; rep(i, N) { sum += A.at(i); } rep(i, N) { if (A....
#include <bits/stdc++.h> //短縮 #define rep(i, n) for (int i = 0; i < (n); ++i) // sort()用 #define all(v) v.begin(), v.end() using namespace std; int main() { int N, M; cin >> N >> M; vector<int> A(N); rep(i, N) cin >> A.at(i); int count = 0; double sum = 0; rep(i, N) { sum += A.at(i); } rep(i, N) { ...
[["-", 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, 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
146
#include <stdio.h> #include <stdlib.h> int desc(const void *a, const void *b) { return *(int *)b - *(int *)a; } 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]); qsort(a, sizeof(a) / sizeof(int), sizeof(int), desc); for (int j = 0; ...
#include <stdio.h> #include <stdlib.h> int desc(const void *a, const void *b) { return *(int *)b - *(int *)a; } 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]); qsort(a, sizeof(a) / sizeof(int), sizeof(int), desc); for (int j = 0; ...
[["-", 15, 23, 0, 16, 12, 74, 51, 23, 0, 24], ["+", 0, 16, 12, 16, 12, 74, 39, 77, 39, 40], ["+", 15, 23, 0, 16, 12, 16, 12, 74, 0, 25], ["+", 0, 16, 12, 16, 12, 74, 51, 23, 0, 24], ["-", 12, 74, 51, 23, 0, 16, 12, 23, 0, 25]]
0
181
#include <bits/stdc++.h> using namespace std; using ll = long long; #define rep(i, n) for (ll i = 0; i < (n); i++) #define all(a) a.begin(), a.end() template <typename T = ll> using v = vector<T>; template <typename T = ll> using vv = v<v<T>>; template <typename T> T chmin(T &a, T b) { return a = min(a, b); } template ...
#include <bits/stdc++.h> using namespace std; using ll = long long; #define rep(i, n) for (ll i = 0; i < (n); i++) #define all(a) a.begin(), a.end() template <typename T = ll> using v = vector<T>; template <typename T = ll> using vv = v<v<T>>; template <typename T> T chmin(T &a, T b) { return a = min(a, b); } template ...
[["+", 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]]
1
322
import sys import copy import math import bisect import pprint import bisect from functools import reduce from copy import deepcopy from collections import deque from decimal import * def lcm(x, y): return (x * y) // math.gcd(x, y) if __name__ == '__main__': b, c = map(int, input().split()) a = [int(i)...
import sys import copy import math import bisect import pprint import bisect from functools import reduce from copy import deepcopy from collections import deque from decimal import * def lcm(x, y): return (x * y) // math.gcd(x, y) if __name__ == '__main__': b, c = map(int, input().split()) a = [int(i)...
[["-", 8, 196, 0, 57, 15, 666, 0, 657, 31, 22], ["+", 8, 196, 0, 57, 15, 666, 0, 657, 31, 612]]
5
155
N, M = map(int, input().split()) A = list(map(int, input().split())) sum = sum(A) flag = 0 A = sorted(A, reverse=True) # print(sum, A) for i in range(0, M+1): if M == 0: break if A[i]<(sum/(4*M)): print('No') flag = 1 break if flag == 0: print("Yes")
N, M = map(int, input().split()) A = list(map(int, input().split())) sum = sum(A) flag = 0 A = sorted(A, reverse=True) # print(sum, A) for i in range(0, M): if M == 0: break if A[i]<(sum/(4*M)): print('No') flag = 1 break if flag == 0: print("Yes")
[["-", 0, 7, 12, 652, 3, 4, 0, 657, 17, 72], ["-", 0, 7, 12, 652, 3, 4, 0, 657, 12, 612]]
5
108
#include <bits/stdc++.h> using namespace std; typedef long long int ll; int main() { int i, n, m, cnt = 0; ll sum = 0; double mx; cin >> n >> m; int a[n]; for (i = 0; i < n; i++) { cin >> a[i]; sum += a[i]; } mx = sum / (4 * m); for (i = 0; i < n; i++) if (a[i] > mx) cnt++; if (cnt...
#include <bits/stdc++.h> using namespace std; typedef long long int ll; int main() { int i, n, m, cnt = 0; ll sum = 0; double mx; cin >> n >> m; int a[n]; for (i = 0; i < n; i++) { cin >> a[i]; sum += a[i]; } mx = sum; mx /= (4 * m); for (i = 0; i < n; i++) if (a[i] >= mx) cnt++; ...
[["-", 8, 9, 0, 1, 0, 11, 12, 16, 17, 85], ["+", 0, 30, 0, 14, 8, 9, 0, 1, 0, 35], ["+", 0, 14, 8, 9, 0, 1, 0, 11, 31, 22], ["+", 0, 14, 8, 9, 0, 1, 0, 11, 17, 90], ["-", 0, 7, 8, 57, 15, 339, 51, 16, 17, 47], ["+", 0, 7, 8, 57, 15, 339, 51, 16, 17, 20]]
1
137
#!/usr/bin/env python t = input().split() n = int(t[0]) m = int(t[1]) a = sorted(map(int, input().split())) s = sum(a) if a[-m] < s//(4*m): print("No") else: print("Yes")
#!/usr/bin/env python t = input().split() n = int(t[0]) m = int(t[1]) a = sorted(map(int, input().split())) s = sum(a) if a[n-m] < s/(4*m): print("No") else: print("Yes")
[["+", 0, 57, 15, 666, 0, 206, 206, 657, 31, 22], ["-", 0, 656, 0, 57, 15, 666, 0, 657, 17, 676], ["+", 0, 656, 0, 57, 15, 666, 0, 657, 17, 85]]
5
80
#include <bits/stdc++.h> using namespace std; int main() { int N; int M; cin >> N >> M; vector<int> vote(N); int sum = 0; for (int i = 0; i < N; i++) { cin >> vote.at(i); sum += vote.at(i); } sort(vote.begin(), vote.end()); reverse(vote.begin(), vote.end()); double q = sum / (4 * M); ...
#include <bits/stdc++.h> using namespace std; int main() { int N; double M; cin >> N >> M; vector<int> vote(N); double sum = 0; for (int i = 0; i < N; i++) { cin >> vote.at(i); sum += vote.at(i); } // cout << sum << endl; sort(vote.begin(), vote.end()); reverse(vote.begin(), vote.end()); ...
[["-", 0, 30, 0, 14, 8, 9, 0, 43, 39, 40], ["+", 0, 30, 0, 14, 8, 9, 0, 43, 39, 40]]
1
147
N, M = [int(x) for x in input().split()] A = [int(x) for x in input().split()] A.sort() A.reverse() total = 0 Flag = True for i in A: total += i for i in range(M): if A[i]*4*M < total: Flag = False if Flag: print("YES") else: print("NO")
N, M = [int(x) for x in input().split()] A = [int(x) for x in input().split()] A.sort() A.reverse() total = 0 Flag = True for i in A: total += i for i in range(M): if A[i]*4*M < total: Flag = False if Flag: 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
102
#include <bits/stdc++.h> #include <iomanip> #include <iostream> #include <string> using namespace std; #define rep(i, N) for (ll i = 0; i < (N); i++) typedef long long ll; int main() { cin.tie(0); ios::sync_with_stdio(false); ll n, m; ll sum = 0; cin >> n >> m; vector<ll> vec(n, 0); rep(i, n) { cin >...
#include <bits/stdc++.h> #include <iomanip> #include <iostream> #include <string> using namespace std; #define rep(i, N) for (ll i = 0; i < (N); i++) typedef long long ll; int main() { cin.tie(0); ios::sync_with_stdio(false); ll n, m; ll sum = 0; cin >> n >> m; vector<ll> vec(n, 0); rep(i, n) { cin >...
[["+", 0, 57, 15, 339, 51, 16, 31, 16, 17, 48], ["+", 0, 57, 15, 339, 51, 16, 31, 16, 12, 22]]
1
166
#include <bits/stdc++.h> using namespace std; int main() { int n, m; cin >> n >> m; int a[n], sum = 0, ans = 0; for (int i = 0; i < n; ++i) { cin >> a[i]; sum += a[i]; } for (int i = 0; i < n; ++i) { if (a[i] >= sum / (4 * m)) ans += 1; } if (ans >= m) cout << "Yes" << endl; ...
#include <bits/stdc++.h> using namespace std; int main() { int n; double m; cin >> n >> m; double a[n], sum = 0, ans = 0; for (int i = 0; i < n; ++i) { cin >> a[i]; sum += a[i]; } for (int i = 0; i < n; ++i) { if (a[i] >= sum / (4 * m)) ans += 1; } if (ans >= m) cout << "Yes"...
[["-", 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
128
in1 = input().split() in1num = [int(x) for x in in1] a = input().split() anum = [int(x) for x in a] sum_a = sum(anum) anum.sort(reverse=True) N = in1num[0] M = in1num[1] #print(sum_a) #print((sum_a)/(4*M)) #print(anum[M-1]) if anum[M-1] > (sum_a)/(4*M): print("Yes") else: print("No")
in1 = input().split() in1num = [int(x) for x in in1] a = input().split() anum = [int(x) for x in a] sum_a = sum(anum) anum.sort(reverse=True) N = in1num[0] M = in1num[1] #print(sum_a) #print((sum_a)/(4*M)) #print(anum[M-1]) if anum[M-1] >= (sum_a)/(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
103
#include <bits/stdc++.h> using namespace std; #define int long long #define endl '\n' #define SPEED \ ios_base::sync_with_stdio(false); \ cin.tie(NULL); ...
#include <bits/stdc++.h> using namespace std; #define int long long #define endl '\n' #define SPEED \ ios_base::sync_with_stdio(false); \ cin.tie(NULL); ...
[["+", 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
141
#include <bits/stdc++.h> #define _GLIBCXX_DEBUG #define rep(i, n) for (int i = 0; i < (int)(n); i++) #define all(v) v.begin(), v.end() #define INF INT_MAX; typedef long long ll; using namespace std; int main() { int N, M, sum = 0; cin >> N >> M; vector<int> a(N); rep(i, N) { cin >> a.at(i); sum += a.at...
#include <bits/stdc++.h> #define _GLIBCXX_DEBUG #define rep(i, n) for (int i = 0; i < (int)(n); i++) #define all(v) v.begin(), v.end() #define INF INT_MAX; typedef long long ll; using namespace std; int main() { int N, M, sum = 0; cin >> N >> M; vector<int> a(N); rep(i, N) { cin >> a.at(i); sum += a.at...
[["-", 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
148
#define _GLIBCXX_DEBUG #include <bits/stdc++.h> using namespace std; int main() { int N, M; cin >> N >> M; vector<int> votes(N); for (int i = 0; i < N; i++) { cin >> votes[i]; } sort(votes.begin(), votes.end()); reverse(votes.begin(), votes.end()); int sum = 0; for (int i = 0; i < N; i++) { s...
#define _GLIBCXX_DEBUG #include <bits/stdc++.h> using namespace std; int main() { int N, M; cin >> N >> M; vector<double> votes(N); for (int i = 0; i < N; i++) { cin >> votes[i]; } sort(votes.begin(), votes.end()); reverse(votes.begin(), votes.end()); double sum = 0; for (int i = 0; i < N; i++) {...
[["-", 0, 43, 39, 344, 3, 347, 0, 77, 39, 40], ["+", 0, 43, 39, 344, 3, 347, 0, 77, 39, 40], ["-", 0, 30, 0, 14, 8, 9, 0, 43, 39, 40], ["+", 0, 30, 0, 14, 8, 9, 0, 43, 39, 40], ["+", 51, 16, 31, 69, 341, 342, 0, 16, 17, 33], ["+", 51, 16, 31, 69, 341, 342, 0, 16, 12, 13]]
1
151
#include <algorithm> #include <cmath> #include <iostream> #include <map> #include <queue> #include <set> #include <stack> #include <string> #include <utility> #include <vector> typedef long long ll; using namespace std; int main() { int N, M, A[100], sum = 0; cin >> N >> M; for (int i = 0; i < N; i++) { ; ...
#include <algorithm> #include <cmath> #include <iostream> #include <map> #include <queue> #include <set> #include <stack> #include <string> #include <utility> #include <vector> typedef long long ll; using namespace std; int main() { int N, M, A[100], sum = 0; cin >> N >> M; for (int i = 0; i < N; i++) { ; ...
[["+", 51, 16, 12, 16, 12, 74, 39, 77, 39, 40], ["+", 15, 339, 51, 16, 12, 16, 12, 74, 0, 25], ["+", 51, 16, 12, 16, 12, 74, 51, 23, 0, 24]]
1
176
n, m = map(int,input().split()) A = sorted([i for i in map(int,input().split())]) total = sum(A) if A[-m] > total/4/m: print('Yes') else: print('No')
n, m = map(int,input().split()) A = sorted([i for i in map(int,input().split())]) total = sum(A) if A[-m] >= total/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
72
n,m = map(int,input().split()) a = list(map(int,input().split())) r = sum(a) count = 0 for i in range(n): if r < (a[i]*(4*m)): count += 1 if count >= m: print("Yes") else: print("No")
n,m = map(int,input().split()) a = list(map(int,input().split())) r = sum(a) count = 0 for i in range(len(a)): if r <= (a[i]*(4*m)): count += 1 if count >= m: print("Yes") else: print("No")
[["-", 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], ["+", 0, 656, 0, 7, 12, 652, 3, 4, 0, 25], ["-", 0, 7, 8, 196, 0, 57, 15, 666, 667, 18], ["+", 0, 7, 8, 196, 0, 57, 15, 666, 667, 19]]
5
88
# -*- coding: utf-8 -*- import numpy as np N, M = map(int, input().split()) count = 0 nums = [int(x.strip()) for x in input().split(' ')] num_sum = sum(nums) tmp = num_sum/(4*M) for num in nums: if num >tmp: count += 1 if count >= M: print('Yes') else: print('No')
# -*- coding: utf-8 -*- N, M = map(int, input().split()) count = 0 nums = [int(x.strip()) for x in input().split(' ')] num_sum = sum(nums) tmp = num_sum / (4*M) for num in nums: if not num < tmp: count += 1 if count >= M: print('Yes') else: print('No')
[["-", 36, 36, 36, 36, 0, 656, 0, 596, 0, 487], ["-", 0, 656, 0, 596, 141, 704, 141, 673, 0, 22], ["-", 36, 36, 0, 656, 0, 596, 141, 704, 0, 272], ["-", 36, 36, 0, 656, 0, 596, 141, 704, 705, 22], ["+", 0, 7, 8, 196, 0, 57, 15, 681, 0, 372], ["-", 0, 7, 8, 196, 0, 57, 15, 666, 667, 47], ["+", 8, 196, 0, 57, 15, 681, 28...
5
96
#include <bits/stdc++.h> using namespace std; int main() { int n, m, sum = 0; cin >> n >> m; int a[101]; for (int i = 0; i < n; i++) { cin >> a[i]; sum += a[i]; } sum /= 4 * m; int cnt = 0; for (int i = 0; i < n; i++) if (a[i] >= sum) cnt++; cout << (cnt >= m ? "Yes" : "No") << endl;...
#include <bits/stdc++.h> using namespace std; int main() { int n, m; double sum = 0; cin >> n >> m; int a[101]; for (int i = 0; i < n; i++) { cin >> a[i]; sum += (double)a[i]; } sum /= 4 * m; int cnt = 0; for (int i = 0; i < n; i++) if (a[i] >= sum) cnt++; cout << (cnt >= m ? "Yes"...
[["-", 0, 30, 0, 14, 8, 9, 0, 43, 0, 21], ["+", 0, 30, 0, 14, 8, 9, 0, 43, 0, 35], ["+", 0, 30, 0, 14, 8, 9, 0, 43, 39, 40], ["+", 8, 9, 0, 1, 0, 11, 12, 74, 0, 24], ["+", 0, 1, 0, 11, 12, 74, 39, 77, 39, 40], ["+", 8, 9, 0, 1, 0, 11, 12, 74, 0, 25]]
1
121
N,M=map(int,input().split()) A=list(map(int,input().split())) su=sum(A) i=0 while max(A)*4*M>=su: i+=1 A.remove(max(A)) else: if i>=M: print("Yes") else: print("No")
N,M=map(int,input().split()) A=list(map(int,input().split())) su=sum(A) i=0 while max(A)*4*M>=su: i+=1 A.remove(max(A)) if i>=M: print("Yes") break else: print("No")
[["-", 36, 36, 0, 656, 0, 52, 75, 76, 0, 95], ["-", 36, 36, 0, 656, 0, 52, 75, 76, 0, 102], ["+", 8, 196, 0, 57, 64, 196, 0, 93, 0, 94]]
5
87
# coding: utf-8 a=list(map(int,input().split())) #読み込み N = a[0] M = a[1] b=list(map(int,input().split())) #総得票数 Sum_vote = sum(b) list.sort(b, reverse=True) if b[M-1] < (Sum_vote / 4 * M): print("No") else : print("Yes")
# coding: utf-8 a=list(map(int,input().split())) #読み込み N = a[0] M = a[1] b=list(map(int,input().split())) #総得票数 Sum_vote = sum(b) list.sort(b, reverse=True) if b[M-1] < (Sum_vote /( 4 * M)): print("No") else : print("Yes")
[["+", 15, 666, 0, 23, 0, 657, 12, 23, 0, 24], ["+", 15, 666, 0, 23, 0, 657, 12, 23, 0, 25]]
5
95
#include <bits/stdc++.h> using namespace std; int n, m, cnt, sum, a[200]; int main() { scanf("%d%d", &n, &m); for (int i = 1; i <= n; i++) scanf("%d", &a[i]), sum += a[i]; if (sum % (4 * m) != 0) sum = sum / (4 * m) + 1; else sum = sum / (4 * m); for (int i = 1; i <= n; i++) if (a[i] > sum) ...
#include <bits/stdc++.h> using namespace std; int n, m, cnt, sum, a[200]; int main() { scanf("%d%d", &n, &m); for (int i = 1; i <= n; i++) scanf("%d", &a[i]), sum += a[i]; if (sum % (4 * m) != 0) sum = sum / (4 * m) + 1; else sum = sum / (4 * m); for (int i = 1; i <= n; i++) if (a[i] >= sum)...
[["-", 0, 7, 8, 57, 15, 339, 51, 16, 17, 47], ["+", 0, 7, 8, 57, 15, 339, 51, 16, 17, 20]]
1
155
#include <algorithm> #include <bitset> #include <cstring> #include <deque> #include <iomanip> #include <iostream> #include <list> #include <map> #include <math.h> #include <queue> #include <random> #include <set> #include <stack> #include <stdint.h> #include <string> #include <time.h> #include <unordered_map> #include ...
#include <algorithm> #include <bitset> #include <cstring> #include <deque> #include <iomanip> #include <iostream> #include <list> #include <map> #include <math.h> #include <queue> #include <random> #include <set> #include <stack> #include <stdint.h> #include <string> #include <time.h> #include <unordered_map> #include ...
[["-", 8, 9, 0, 43, 49, 50, 51, 16, 31, 13], ["+", 0, 43, 49, 50, 51, 16, 31, 74, 0, 24], ["+", 49, 50, 51, 16, 31, 74, 39, 77, 39, 40], ["+", 0, 43, 49, 50, 51, 16, 31, 74, 0, 25], ["+", 0, 43, 49, 50, 51, 16, 31, 74, 51, 22], ["-", 51, 16, 12, 23, 0, 16, 12, 74, 51, 22], ["+", 51, 16, 12, 23, 0, 16, 12, 74, 51, 22]]
1
207
#include <bits/stdc++.h> using namespace std; #define ll long long int int main() { ll n, m; cin >> n >> m; ll arr[n + 1], sum = 0; for (int i = 0; i < n; i++) { cin >> arr[i]; sum += arr[i]; } sum = double(sum); double c = ceil(sum / (m * 4)); sort(arr, arr + n); ll k = 0; for (int i = n - ...
#include <bits/stdc++.h> using namespace std; #define ll long long int int main() { ll n, m; cin >> n >> m; ll arr[n + 1], sum = 0; for (int i = 0; i < n; i++) { cin >> arr[i]; sum += arr[i]; } sum = double(sum); double c = ceil(sum / (double(m) * 4)); sort(arr, arr + n); ll k = 0; for (int ...
[["+", 0, 16, 12, 23, 0, 16, 31, 2, 63, 40], ["+", 12, 23, 0, 16, 31, 2, 3, 4, 0, 24], ["+", 12, 23, 0, 16, 31, 2, 3, 4, 0, 25]]
1
166
n, m= map(int, (input().split())) a = list(map(int, input().split())) count = 0 total = 0 for i in a: total += i for j in a: if j / total > 1 / (4 * m): count += 1 if count >= m: print("Yes") else: print("No")
n, m= map(int, (input().split())) a = list(map(int, input().split())) count = 0 total = 0 for i in a: total += i for j in a: if not (j / total < 1 / (4 * m)): count += 1 if count >= m: print("Yes") else: print("No")
[["+", 0, 7, 8, 196, 0, 57, 15, 681, 0, 372], ["+", 8, 196, 0, 57, 15, 681, 28, 23, 0, 24], ["-", 0, 7, 8, 196, 0, 57, 15, 666, 667, 47], ["+", 0, 57, 15, 681, 28, 23, 0, 666, 667, 18], ["+", 28, 23, 0, 666, 0, 657, 12, 23, 0, 25]]
5
89
#include <algorithm> #include <iostream> #include <vector> #define rep(i, n) for (int i = 0; i < (n); i++) using namespace std; template <class T> inline bool chmin(T &a, T b) { if (a > b) { a = b; return true; } return false; } typedef long long ll; int main() { ll n, m; cin >> n >> m; ll sum = 0...
#include <algorithm> #include <iostream> #include <vector> #define rep(i, n) for (int i = 0; i < (n); i++) using namespace std; template <class T> inline bool chmin(T &a, T b) { if (a > b) { a = b; return true; } return false; } typedef long long ll; int main() { ll n, m; cin >> n >> m; ll sum = 0...
[["+", 15, 339, 51, 16, 12, 16, 31, 2, 63, 40], ["+", 51, 16, 12, 16, 31, 2, 3, 4, 0, 24], ["+", 51, 16, 12, 16, 31, 2, 3, 4, 0, 25]]
1
164
n, m = input().split(" ") n = int(n) m = int(m) votes = input().split(" ") votes = [int(vote) for vote in votes] votes.sort(reverse=True) check_vote = votes[m-1] if check_vote >= sum(votes) / n: print("Yes") else: print("No")
n, m = input().split(" ") n = int(n) m = int(m) votes = input().split(" ") votes = [int(vote) for vote in votes] votes.sort(reverse=True) check_vote = votes[m-1] if check_vote >= sum(votes) / (4*m): print("Yes") else: print("No")
[["-", 0, 656, 0, 57, 15, 666, 0, 657, 12, 22], ["+", 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], ["+", 15, 666, 0, 657, 12, 23, 0, 657, 12, 22], ["+", 0, 57, 15, 666, 0, 657, 12, 23, 0, 25]]
5
90
n, m = map(int, input().split()) votes = list(map(int, input().split())) total_votes = sum(votes) border = total_votes // (4 * m) count = 0 for a in votes: if a < border: continue count += 1 if count >= m: print('Yes') else: print('No')
n, m = map(int, input().split()) votes = list(map(int, input().split())) total_votes = sum(votes) border = total_votes / (4 * m) count = 0 for a in votes: if a < border: continue count += 1 if count >= 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
84
N, M = map(int, input().split()) As = list(map(int,input().split())) vote_sum = sum(As) least_vote_num = vote_sum / (4 * M) if len([A for A in As if A > least_vote_num]) >= M: print('Yes') else: print('No')
N, M = map(int, input().split()) As = list(map(int,input().split())) vote_sum = sum(As) least_vote_num = vote_sum / (4 * M) if len([A for A in As if A >= least_vote_num]) >= M: print('Yes') else: print('No')
[["-", 3, 4, 0, 658, 0, 678, 0, 666, 667, 47], ["+", 3, 4, 0, 658, 0, 678, 0, 666, 667, 20]]
5
80
#include <bits/stdc++.h> using namespace std; #define rep(i, n) for (int i = 0; i < (int)(n); i++) using ll = long long; int mod = 1000000000 + 7; int main() { int n, m; cin >> n >> m; int a[n]; int sum = 0; rep(i, n) { cin >> a[i]; sum += a[i]; } sum = sum / (4 * m); rep(i, n) { if (a[i...
#include <bits/stdc++.h> using namespace std; #define rep(i, n) for (int i = 0; i < (int)(n); i++) using ll = long long; int mod = 1000000000 + 7; int main() { int n, m; cin >> n >> m; int a[n]; double sum = 0; rep(i, n) { cin >> a[i]; sum += a[i]; } sum = sum / (4 * m); rep(i, n) { if (...
[["-", 0, 30, 0, 14, 8, 9, 0, 43, 39, 40], ["+", 0, 30, 0, 14, 8, 9, 0, 43, 39, 40]]
1
133
#include <bits/stdc++.h> #define pb push_back #define mp make_pair #define fi first #define se second #define sz(a) (a).size() #define all(c) (c).begin(), (c).end() #define rep(i, n) for (int i = 0; i < n; i++) #define forn(i, n) for (int i = 1; i <= n; i++) #define ford(i, n) for (int i = n; i >= 0; i--) #define REP(i...
#include <bits/stdc++.h> #define pb push_back #define mp make_pair #define fi first #define se second #define sz(a) (a).size() #define all(c) (c).begin(), (c).end() #define rep(i, n) for (int i = 0; i < n; i++) #define forn(i, n) for (int i = 1; i <= n; i++) #define ford(i, n) for (int i = n; i >= 0; i--) #define REP(i...
[["-", 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, 17, 85], ["+", 0, 30, 0, 14, 8, 9, 0, 43, 0, 35], ["+", 0, 14, 8, 9, 0, 1, 0, 11, 31, 22], ["+", 0, 14, 8, 9, 0, 1, 0, 11, 17, 90], ["-", 8, 9, 0, 43, 49, 50, 51, 16, 17, 85], ["+", 8, 9, 0, 1, 0, 1...
1
235
#include <algorithm> #include <iostream> #include <set> #include <string> #include <vector> using namespace std; #define forn(i, n) for (int i = 0; i < int(n); i++) int main() { int M, N; cin >> N >> M; int total = 0; vector<int> item; forn(i, N) { int tmp; cin >> tmp; total += tmp; item.pu...
#include <algorithm> #include <iostream> #include <set> #include <string> #include <vector> using namespace std; #define forn(i, n) for (int i = 0; i < int(n); i++) int main() { int M, N; cin >> N >> M; double total = 0; vector<int> item; forn(i, N) { int tmp; cin >> tmp; total += tmp; item...
[["-", 0, 30, 0, 14, 8, 9, 0, 43, 39, 40], ["+", 0, 30, 0, 14, 8, 9, 0, 43, 39, 40]]
1
132
#include <cstdlib> #include <iostream> using namespace std; int main(void) { int n, m; cin >> n >> m; int a[n]; int sum = 0; for (int i = 0; i < n; i++) { cin >> a[i]; sum += a[i]; } int count = 0; for (int i = 0; i < n; i++) { if (a[i] > (sum / (4.0 * m))) count++; } if (coun...
#include <cstdlib> #include <iostream> using namespace std; int main(void) { int n, m; cin >> n >> m; int a[n]; int sum = 0; for (int i = 0; i < n; i++) { cin >> a[i]; sum += a[i]; } int count = 0; for (int i = 0; i < n; i++) { if (a[i] >= (sum / (4.0 * m))) count++; } if (cou...
[["-", 8, 9, 0, 57, 15, 339, 51, 16, 17, 47], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 17, 20]]
1
134
#include <bits/stdc++.h> using namespace std; const string YES = "Yes"; const string NO = "No"; void solve(long long N, long long M, std::vector<long long> A) { sort(A.begin(), A.end()); long long sum = 0; for (int i = 0; i < N; i++) { sum += A[i]; } for (int i = 0; i < M; i++) { if (A[N - 1 - i...
#include <bits/stdc++.h> using namespace std; const string YES = "Yes"; const string NO = "No"; void solve(long long N, long long M, std::vector<long long> A) { sort(A.begin(), A.end()); long long sum = 0; for (int i = 0; i < N; i++) { sum += A[i]; } for (int i = 0; i < M; i++) { if (A[N - 1 - 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
234
#include <bits/stdc++.h> #define vll vector<ll> #define vi vector<int> #define vpll vector<pair<ll, ll>> #define pii pair<int, int> #define REP(i, a) for (int(i) = 0; (i) < (a); (i)++) #define RREP(i, a) for (int(i) = a - 1; (i) >= (0); (i)--) #define REP2(i, a, b) for (int(i) = (a); (i) < (b); (i)++) #define MOD 10000...
#include <bits/stdc++.h> #define vll vector<ll> #define vi vector<int> #define vpll vector<pair<ll, ll>> #define pii pair<int, int> #define REP(i, a) for (int(i) = 0; (i) < (a); (i)++) #define RREP(i, a) for (int(i) = a - 1; (i) >= (0); (i)--) #define REP2(i, a, b) for (int(i) = (a); (i) < (b); (i)++) #define MOD 10000...
[["-", 0, 14, 8, 9, 0, 43, 49, 50, 49, 22], ["+", 0, 14, 8, 9, 0, 43, 49, 50, 49, 22], ["-", 8, 9, 0, 1, 0, 11, 0, 42, 0, 22], ["+", 8, 9, 0, 1, 0, 11, 0, 42, 0, 22], ["-", 8, 9, 0, 57, 15, 339, 51, 16, 17, 47], ["-", 8, 9, 0, 57, 15, 339, 51, 16, 12, 22], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 17, 20], ["+", 8, 9, 0, 57,...
1
182