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 s, t; s = 0; t = 0; vector<int> a(N + 1); for (int i = 1; i <= N; i++) { cin >> a.at(i); s += a.at(i); } double u; u = 0.25 * N / M; for (int i = 1; i <= N; i++) { if (a.at(i) >= u) { t++; ...
#include <bits/stdc++.h> using namespace std; int main() { int N, M; cin >> N >> M; int s, t; s = 0; t = 0; vector<int> a(N + 1); for (int i = 1; i <= N; i++) { cin >> a.at(i); s += a.at(i); } double u; u = (double)0.25 * s / M; for (int i = 1; i <= N; i++) { if (a.at(i) >= u) { ...
[["+", 0, 11, 12, 16, 31, 16, 31, 74, 0, 24], ["+", 12, 16, 31, 16, 31, 74, 39, 77, 39, 40], ["+", 0, 11, 12, 16, 31, 16, 31, 74, 0, 25], ["-", 0, 1, 0, 11, 12, 16, 31, 16, 12, 22], ["+", 0, 1, 0, 11, 12, 16, 31, 16, 12, 22]]
1
147
#include <bits/stdc++.h> using namespace std; int main() { int n, m; cin >> n >> m; int total = 0; vector<int> v(n); int x; for (int i = 0; i < n; i++) { cin >> x; total += x; v[i] = x; } int count = 0; double minp = (1 / (4 * (double)m)) * total; for (int i = 0; i < n; i++) { if (...
#include <bits/stdc++.h> using namespace std; int main() { int n, m; cin >> n >> m; int total = 0; vector<int> v(n); int x; for (int i = 0; i < n; i++) { cin >> x; total += x; v[i] = x; } int count = 0; double minp = (1 / (4 * (double)m)) * total; for (int i = 0; i < n; i++) { if (...
[["-", 8, 9, 0, 57, 15, 339, 51, 16, 17, 47], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 17, 20]]
1
153
#include <bits/stdc++.h> using namespace std; #define rep(i, n) for (int i = 0; i < (int)(n); i++) typedef long long int ll; typedef pair<int, int> P; int n, m, a[200]; int main() { cin >> n >> m; int sum = 0; rep(i, n) { cin >> a[i]; sum += a[i]; } sort(a, a + n, greater<int>()); rep(i, m) { ...
#include <bits/stdc++.h> using namespace std; #define rep(i, n) for (int i = 0; i < (int)(n); i++) typedef long long int ll; typedef pair<int, int> P; int n, m; double a[200]; int main() { cin >> n >> m; double sum = 0; rep(i, n) { cin >> a[i]; sum += a[i]; } sort(a, a + n, greater<int>()); rep(i...
[["-", 36, 36, 36, 36, 0, 30, 0, 43, 0, 21], ["+", 36, 36, 36, 36, 0, 30, 0, 43, 0, 35], ["+", 36, 36, 36, 36, 0, 30, 0, 43, 39, 40], ["-", 0, 30, 0, 14, 8, 9, 0, 43, 39, 40], ["+", 0, 30, 0, 14, 8, 9, 0, 43, 39, 40], ["+", 12, 74, 51, 23, 0, 16, 12, 74, 0, 24], ["+", 51, 23, 0, 16, 12, 74, 39, 77, 39, 40], ["+", 12, 7...
1
146
#include <bits/stdc++.h> using namespace std; typedef long long ll; int main() { int N, M; cin >> N >> M; int A[N], 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 * M)) count++; } if (count >= M)...
#include <bits/stdc++.h> using namespace std; typedef long long ll; int main() { int N; double M; cin >> N >> M; double A[N], 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 * M)) count++; } if ...
[["-", 0, 30, 0, 14, 8, 9, 0, 43, 0, 21], ["+", 0, 30, 0, 14, 8, 9, 0, 43, 0, 35], ["+", 0, 30, 0, 14, 8, 9, 0, 43, 39, 40], ["-", 0, 30, 0, 14, 8, 9, 0, 43, 39, 40]]
1
134
#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>; int main() { int n, m; cin >> n >> m; vector<int> a(n); int total = 0; rep(i, n) { cin >> a[i]; total += a[i]; } int cnt = 0; int div = total / (4 * m...
#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>; int main() { int n, m; cin >> n >> m; vector<int> a(n); int total = 0; rep(i, n) { cin >> a[i]; total += a[i]; } int cnt = 0; double div = (double)tot...
[["-", 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
147
#include <bits/stdc++.h> using namespace std; using ll = long long int; #define INF 100000000 #define rep(i, a, b) for (int(i) = a; (i) < (int)(b); (i)++) int main() { int N, M, allNum; cin >> N >> M; vector<int> A(N, 0); rep(i, 0, N) cin >> A[i]; sort(A.begin(), A.end(), greater<int>()); allNum = accumula...
#include <bits/stdc++.h> using namespace std; using ll = long long int; #define INF 100000000 #define rep(i, a, b) for (int(i) = a; (i) < (int)(b); (i)++) int main() { double N, M, allNum; cin >> N >> M; vector<double> A(N, 0); rep(i, 0, N) cin >> A[i]; sort(A.begin(), A.end(), greater<double>()); allNum =...
[["-", 0, 30, 0, 14, 8, 9, 0, 43, 39, 40], ["+", 0, 30, 0, 14, 8, 9, 0, 43, 39, 40], ["-", 0, 43, 39, 344, 3, 347, 0, 77, 39, 40], ["+", 0, 43, 39, 344, 3, 347, 0, 77, 39, 40], ["-", 0, 2, 63, 346, 3, 347, 0, 77, 39, 40], ["+", 0, 2, 63, 346, 3, 347, 0, 77, 39, 40], ["-", 0, 1, 0, 11, 12, 2, 3, 4, 0, 13], ["+", 0, 1, 0...
1
151
#include <algorithm> // min, max, swap, sort, reverse, lower_bound, upper_bound #include <bitset> // bitset #include <cctype> // isupper, islower, isdigit, toupper, tolower #include <cmath> #include <cstdint> // int64_t, int*_t #include <cstdio> // printf #include <deque> // deque #include <iostream> #include ...
#include <algorithm> // min, max, swap, sort, reverse, lower_bound, upper_bound #include <bitset> // bitset #include <cctype> // isupper, islower, isdigit, toupper, tolower #include <cmath> #include <cstdint> // int64_t, int*_t #include <cstdio> // printf #include <deque> // deque #include <iostream> #include ...
[["-", 0, 30, 0, 14, 8, 9, 0, 43, 39, 40], ["+", 0, 30, 0, 14, 8, 9, 0, 43, 39, 40]]
1
184
import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int n = Integer.parseInt(sc.next()); int m = Integer.parseInt(sc.next()); int[] a = new int[n]; int all = 0; for (int i = 0; i < n; i++) { a[i] = Integer.pars...
import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int n = Integer.parseInt(sc.next()); int m = Integer.parseInt(sc.next()); int[] a = new int[n]; int all = 0; for (int i = 0; i < n; i++) { a[i] = Integer.pars...
[["+", 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], ["+", 0, 503, 49, 200, 51, 16, 12, 23, 0, 24], ["-", 8, 196, 0, 503, 49, 200, 51, 16, 17, 85], ["+", 49, 200, 51, 16, 12, 23, 0, 16, 17, 48], ["+", 0, 503, 49, 200, 51, 16, 12,...
3
195
#include <algorithm> #include <iostream> #include <vector> using namespace std; int main(void) { int n, m, all = 0; vector<int> a; cin >> n >> m; for (int i = 0; i < n; ++i) { int num; cin >> num; all += num; a.push_back(num); } sort(a.begin(), a.end()); cout << ((a[n - m - 1] >= ((float)...
#include <algorithm> #include <iostream> #include <vector> using namespace std; int main(void) { int n, m, all = 0; vector<int> a; cin >> n >> m; for (int i = 0; i < n; ++i) { int num; cin >> num; all += num; a.push_back(num); } sort(a.begin(), a.end()); cout << ((a[n - m] >= ((float)all ...
[["-", 0, 16, 31, 69, 341, 342, 0, 16, 17, 33], ["-", 0, 16, 31, 69, 341, 342, 0, 16, 12, 13]]
1
128
#include <bits/stdc++.h> #include <cstdio> #include <fstream> #include <iostream> #include <queue> #include <stdio.h> #include <string.h> #define F first #define S second #define R cin >> #define Z class #define ll long long #define ln cout << '\n' #define in(a) insert(a) #define pb(a) push_back(a) #define pd(a) print...
#include <bits/stdc++.h> #include <cstdio> #include <fstream> #include <iostream> #include <queue> #include <stdio.h> #include <string.h> #define F first #define S second #define R cin >> #define Z class #define ll long long #define ln cout << '\n' #define in(a) insert(a) #define pb(a) push_back(a) #define pd(a) print...
[["+", 15, 339, 51, 16, 31, 16, 31, 74, 0, 24], ["+", 51, 16, 31, 16, 31, 74, 39, 77, 39, 40], ["+", 15, 339, 51, 16, 31, 16, 31, 74, 0, 25], ["+", 0, 57, 15, 339, 51, 16, 12, 74, 0, 24], ["+", 15, 339, 51, 16, 12, 74, 39, 77, 39, 40], ["+", 0, 57, 15, 339, 51, 16, 12, 74, 0, 25]]
1
265
#include <bits/stdc++.h> using namespace std; int main() { int n, m, meow = 0, k = 0; cin >> n >> m; int ara[n]; for (int i = 0; i < n; i++) { cin >> ara[i]; meow += ara[i]; } meow = ((double)meow / (4.0 * m)); for (int i = 0; i < n; i++) { if (ara[i] >= meow) k++; } if (k >= m) ...
#include <bits/stdc++.h> using namespace std; int main() { int n, m, k = 0; double meow = 0; cin >> n >> m; int ara[n]; for (int i = 0; i < n; i++) { cin >> ara[i]; meow += ara[i]; } meow = ((double)meow / (4.0 * m)); for (int i = 0; i < n; i++) { if (ara[i] >= meow) k++; } if (k >...
[["-", 0, 14, 8, 9, 0, 43, 49, 50, 49, 22], ["+", 0, 14, 8, 9, 0, 43, 49, 50, 49, 22], ["-", 0, 30, 0, 14, 8, 9, 0, 43, 0, 21], ["+", 0, 30, 0, 14, 8, 9, 0, 43, 0, 35], ["+", 0, 30, 0, 14, 8, 9, 0, 43, 39, 40]]
1
136
#include <bits/stdc++.h> using namespace std; typedef long long ll; #define pb push_back int main() { double n, m; cin >> n >> m; vector<double> v(n); ll i, sum = 0; for (i = 0; i < n; i++) { cin >> v[i]; sum += v[i]; } sort(v.begin(), v.end()); reverse(v.begin(), v.end()); ll tot = 0; for...
#include <bits/stdc++.h> using namespace std; typedef long long ll; #define pb push_back int main() { double n, m; cin >> n >> m; vector<double> v(n); ll i; double sum = 0; for (i = 0; i < n; i++) { cin >> v[i]; sum += v[i]; } sort(v.begin(), v.end()); reverse(v.begin(), v.end()); ll tot =...
[["-", 0, 30, 0, 14, 8, 9, 0, 43, 0, 21], ["+", 0, 30, 0, 14, 8, 9, 0, 43, 0, 35], ["+", 0, 30, 0, 14, 8, 9, 0, 43, 39, 40], ["-", 8, 9, 0, 57, 15, 339, 51, 16, 17, 47], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 17, 20]]
1
169
#include <iostream> using namespace std; int main() { int n, m; cin >> n >> m; double a[n]; for (int i = 0; i < n; ++i) cin >> a[i]; double sum = 0; for (int i = 0; i < n; ++i) sum += a[i]; double ss = sum * 1.0 / (4 * m); int tot = 0; for (int i = 0; i < n; ++i) if (a[i] > ss) ++tot...
#include <iostream> using namespace std; int main() { int n, m; cin >> n >> m; double a[n]; for (int i = 0; i < n; ++i) cin >> a[i]; double sum = 0; for (int i = 0; i < n; ++i) sum += a[i]; double ss = sum * 1.0 / (4 * m); int tot = 0; for (int i = 0; i < n; ++i) if (a[i] >= ss) ++to...
[["-", 0, 7, 8, 57, 15, 339, 51, 16, 17, 47], ["+", 0, 7, 8, 57, 15, 339, 51, 16, 17, 20]]
1
146
#include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < (n); i++) using namespace std; using ll = long long; int main() { int n, m; int sum = 0; bool cond = true; cin >> n >> m; vector<int> a(n); rep(i, n) { cin >> a[i]; sum += a[i]; } sort(a.begin(), a.end()); double num = a[n - m] / ...
#include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < (n); i++) using namespace std; using ll = long long; int main() { int n, m; int sum = 0; bool cond = true; cin >> n >> m; vector<int> a(n); rep(i, n) { cin >> a[i]; sum += a[i]; } sort(a.begin(), a.end()); double num = (double)a[n...
[["+", 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], ["+", 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
139
#include <bits/stdc++.h> #define endl '\n'; #define rep(i, n) for (int i = 0; i < (n); i++) using namespace std; using ll = long long; using P = pair<int, int>; #pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native") #pragma GCC optimize("Ofast") constexpr ll INF = 1e18; constexpr int inf = 1e9; c...
#include <bits/stdc++.h> #define endl '\n'; #define rep(i, n) for (int i = 0; i < (n); i++) using namespace std; using ll = long long; using P = pair<int, int>; #pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native") #pragma GCC optimize("Ofast") constexpr ll INF = 1e18; constexpr int inf = 1e9; c...
[["-", 0, 1, 0, 16, 31, 16, 12, 5, 0, 6], ["+", 0, 1, 0, 16, 31, 16, 12, 5, 0, 6]]
1
356
#include <bits/stdc++.h> using namespace std; int main() { int N, M; cin >> N >> M; vector<int> p(N); for (int i = 0; i < N; i++) { cin >> p[i]; } sort(p.begin(), p.end()); int sum = 0; for (int i = 0; i < N; i++) { sum += p[i]; } int border = 0; if (sum % (4 * M) == 0) border = sum /...
#include <bits/stdc++.h> using namespace std; int main() { int N, M; cin >> N >> M; vector<int> p(N); for (int i = 0; i < N; i++) { cin >> p[i]; } sort(p.begin(), p.end()); int sum = 0; for (int i = 0; i < N; i++) { sum += p[i]; } int border; if (sum % (4 * M) == 0) border = sum / (4 ...
[["-", 0, 14, 8, 9, 0, 43, 49, 50, 0, 32], ["-", 0, 14, 8, 9, 0, 43, 49, 50, 51, 13], ["-", 8, 9, 0, 57, 15, 339, 51, 16, 17, 47], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 17, 20]]
1
179
#include <bits/stdc++.h> using namespace std; typedef unsigned long ul; typedef unsigned long long ull; typedef long long ll; typedef vector<ll> vint; typedef vector<vector<ll>> vvint; typedef vector<vector<vector<ll>>> vvvint; typedef vector<string> vstring; typedef vector<vector<string>> vvstring; typedef vector<cha...
#include <bits/stdc++.h> using namespace std; typedef unsigned long ul; typedef unsigned long long ull; typedef long long ll; typedef vector<ll> vint; typedef vector<vector<ll>> vvint; typedef vector<vector<vector<ll>>> vvvint; typedef vector<string> vstring; typedef vector<vector<string>> vvstring; typedef vector<cha...
[["-", 0, 1, 0, 11, 31, 2, 3, 4, 0, 22], ["+", 0, 1, 0, 11, 31, 2, 3, 4, 0, 22], ["-", 12, 69, 341, 342, 0, 16, 31, 16, 31, 22], ["-", 12, 69, 341, 342, 0, 16, 31, 16, 17, 33], ["-", 12, 69, 341, 342, 0, 16, 31, 16, 12, 13], ["-", 0, 11, 12, 69, 341, 342, 0, 16, 17, 33]]
1
724
#include <stdio.h> int main() { int a[1000]; int n, m, all, i, c; all = 0; c = 0; scanf("%d %d", &n, &m); for (i = 0; i < n; i++) { scanf("%d", &a[i]); all = all + a[i]; } for (i = 0; i < n; i++) { if (a[i] * (4 * m) >= all) { c++; } } if (c > m) { printf("Yes"); } el...
#include <stdio.h> int main() { int a[1000]; int n, m, all, i, c; all = 0; c = 0; scanf("%d %d", &n, &m); for (i = 0; i < n; i++) { scanf("%d", &a[i]); all = all + a[i]; } for (i = 0; i < n; i++) { if (a[i] * (4 * m) >= all) { c++; } } if (c >= m) { printf("Yes"); } e...
[["-", 8, 9, 0, 57, 15, 23, 0, 16, 17, 47], ["+", 8, 9, 0, 57, 15, 23, 0, 16, 17, 20]]
0
143
#include <bits/stdc++.h> using namespace std; int main(void) { int n, m, a[105], vote = 0, ans = 0; cin >> n >> m; for (int i = 0; i < n; i++) { cin >> a[i]; vote += a[i]; } for (int i = 0; i < n; i++) { if (a[i] >= vote / (4 * m)) { ans++; } } if (ans < m) { cout << "No\n"; ...
#include <bits/stdc++.h> using namespace std; int main(void) { double n, m, a[105], vote = 0; int ans = 0; cin >> n >> m; for (int i = 0; i < n; i++) { cin >> a[i]; vote += a[i]; } for (int i = 0; i < n; i++) { if (a[i] >= vote / (4 * m)) { ans++; } } if (ans < m) { cout << "...
[["-", 0, 30, 0, 14, 8, 9, 0, 43, 39, 40], ["+", 0, 30, 0, 14, 8, 9, 0, 43, 39, 40], ["-", 0, 30, 0, 14, 8, 9, 0, 43, 0, 21], ["+", 0, 30, 0, 14, 8, 9, 0, 43, 0, 35]]
1
128
#include <algorithm> #include <cmath> #include <iostream> #include <map> #include <string> #include <vector> using namespace std; using ll = long long; using ull = unsigned long long; constexpr ll LLINF{1001002003004005006}; // ll = 9*LLINF constexpr int INTINF{1000000000}; // int = 2*INTINF #define rep(i, n)...
#include <algorithm> #include <cmath> #include <iostream> #include <map> #include <string> #include <vector> using namespace std; using ll = long long; using ull = unsigned long long; constexpr ll LLINF{1001002003004005006}; // ll = 9*LLINF constexpr int INTINF{1000000000}; // int = 2*INTINF #define rep(i, n)...
[["-", 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, 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
332
N, M = list(map(int, input().split())) a_i = list(map(int, input().split())) v_sum = sum(a_i) n = len([a for a in a_i if a >= (1/(4*M))]) if n >= M: print('Yes') else: print('No')
N, M = list(map(int, input().split())) a_i = list(map(int, input().split())) v_sum = sum(a_i) n = len([a for a in a_i if a >= (v_sum/(4*M))]) if n >= M: print('Yes') else: print('No')
[["-", 0, 678, 0, 666, 0, 23, 0, 657, 31, 612], ["+", 0, 678, 0, 666, 0, 23, 0, 657, 31, 22]]
5
85
/****************************************************************************** Online Java Compiler. Code, Compile, Run and Debug java program online. Write your code in this editor and press "Run" button to execute it. *****************************************************...
/****************************************************************************** Online Java Compiler. Code, Compile, Run and Debug java program online. Write your code in this editor and press "Run" button to execute it. *****************************************************...
[["-", 0, 57, 15, 15, 0, 16, 12, 74, 0, 24], ["-", 15, 15, 0, 16, 12, 74, 39, 506, 0, 507], ["-", 0, 57, 15, 15, 0, 16, 12, 74, 0, 25]]
3
191
#include <algorithm> //█████████████████████████████ #include <ctype.h> //█ ▄▄ █░░░░░░░░░░░█ ▄▄ █ #include <iostream> //█ █▄▄█ █░░▀░░┬░░▀░░█ █▄▄█ █ #include <math.h> //█ ▄▀▄ ▄▀▄ █ #include <stdio.h> //█████████████████████████████ #include <stdlib.h> //█ █ #include <...
#include <algorithm> //█████████████████████████████ #include <ctype.h> //█ ▄▄ █░░░░░░░░░░░█ ▄▄ █ #include <iostream> //█ █▄▄█ █░░▀░░┬░░▀░░█ █▄▄█ █ #include <math.h> //█ ▄▀▄ ▄▀▄ █ #include <stdio.h> //█████████████████████████████ #include <stdlib.h> //█ █ #include <...
[["-", 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], ["+", 0, 30, 0, 14, 8, 9, 0, 43, 39, 40], ["-", 51, 23, 0, 16, 12, 23, 0, 16, 31, 13], ["+", 51, 23, 0, 16, 12, 23, 0, 16, 31, 13]]
1
485
/*|In The Name Of Allah|*/ #include <bits/stdc++.h> using namespace std; typedef long long ll; const int N = 1e5 + 5; int n, m; int sum; int ar[N]; int main() { cin >> n >> m; for (int i = 1; i <= n; i++) { cin >> ar[i]; sum += ar[i]; } int ls = sum / (4 * m); // cout << ls << endl; sort(ar + ...
/*|In The Name Of Allah|*/ #include <bits/stdc++.h> using namespace std; typedef long long ll; const int N = 1e5 + 5; int n; double m; double sum; int ar[N]; int main() { cin >> n >> m; for (int i = 1; i <= n; i++) { cin >> ar[i]; sum += ar[i]; } double ls = sum / (4 * m); // cout << ls << endl;...
[["-", 36, 36, 36, 36, 0, 30, 0, 43, 0, 21], ["+", 36, 36, 36, 36, 0, 30, 0, 43, 0, 35], ["+", 36, 36, 36, 36, 0, 30, 0, 43, 39, 40], ["-", 36, 36, 36, 36, 0, 30, 0, 43, 39, 40], ["-", 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_net = [k for k in a if k > (sum(a)/(4*m))] if len(a_net) >= m: print('Yes') else: print('No')
n, m = map(int, input().split()) a = list(map(int, input().split())) a_net = [k for k in a if k >= (sum(a)/(4*m))] if len(a_net) >= m: print('Yes') else: print('No')
[["-", 0, 662, 12, 658, 0, 678, 0, 666, 667, 47], ["+", 0, 662, 12, 658, 0, 678, 0, 666, 667, 20]]
5
79
N,M = map(int,input().split()) A=list(map(int, input().split())) A_sum = sum(A) c=0 for i in range(len(A)): if A[i] >= A_sum/(M*4): c+=1 if M < c: print('Yes') else: print('No')
N,M = map(int,input().split()) A=list(map(int, input().split())) A_sum = sum(A) c=0 for i in range(len(A)): if A[i] >= A_sum/(M*4): c+=1 if c >= M: print('Yes') else: print('No')
[["-", 36, 36, 0, 656, 0, 57, 15, 666, 0, 22], ["-", 36, 36, 0, 656, 0, 57, 15, 666, 667, 18], ["+", 36, 36, 0, 656, 0, 57, 15, 666, 667, 20], ["+", 36, 36, 0, 656, 0, 57, 15, 666, 0, 22]]
5
89
#include <bits/stdc++.h> using namespace std; int a[100000]; int main() { int n, p, i, alls = 0, pd = 1, k = 0; scanf("%d %d", &n, &p); for (i = 1; i <= n; i++) { scanf("%d", &a[i]); alls += a[i]; } sort(a, a + n); for (i = n - 1, k = 0; k < p; i--, k++) { if (a[i] * 4 * p < alls) { pd = 0...
#include <bits/stdc++.h> using namespace std; int a[100000]; int main() { int n, p, i, alls = 0, pd = 1, k = 0; scanf("%d %d", &n, &p); for (i = 1; i <= n; i++) { scanf("%d", &a[i]); alls += a[i]; } sort(a + 1, a + n + 1); for (i = n, k = 0; k < p; i--, k++) { if (a[i] * 4 * p < alls) { pd...
[["+", 0, 1, 0, 2, 3, 4, 0, 16, 17, 72], ["+", 0, 1, 0, 2, 3, 4, 0, 16, 12, 13], ["-", 0, 7, 10, 34, 31, 11, 12, 16, 17, 33], ["-", 0, 7, 10, 34, 31, 11, 12, 16, 12, 13]]
1
160
n,m=map(int,input().split()) l=list(map(int,input().split())) l.sort() if l[0-m]>=sum(l)//(4*m): print("Yes") else: print("No")
n,m=map(int,input().split()) l=list(map(int,input().split())) l.sort() if l[0-m]>=sum(l)/(4*m): print("Yes") else: print("No")
[["-", 0, 656, 0, 57, 15, 666, 0, 657, 17, 676], ["+", 0, 656, 0, 57, 15, 666, 0, 657, 17, 85]]
5
71
n,m = map(int,input().split()) l = sorted(list(map(int,input().split())))[::-1] s = float(sum(l)/4*m) t = "Yes" for i in range(m): if l[i]>=s: t = "No" print(t)
n,m = map(int,input().split()) l = sorted(list(map(int,input().split())))[::-1] s = float(sum(l)/(4*m)) t = "Yes" for i in range(m): if l[i]<s: t = "No" break print(t)
[["+", 12, 652, 3, 4, 0, 657, 12, 23, 0, 24], ["+", 12, 652, 3, 4, 0, 657, 12, 23, 0, 25], ["-", 0, 7, 8, 196, 0, 57, 15, 666, 667, 20], ["+", 0, 7, 8, 196, 0, 57, 15, 666, 667, 18], ["+", 8, 196, 0, 57, 64, 196, 0, 93, 0, 94]]
5
85
#include <bits/stdc++.h> using namespace std; #define MOD 1000000007 int main() { int N, M; cin >> N >> M; int sum = 0; vector<int> A(N); for (int i = 0; i < N; i++) { cin >> A[i]; sum += A[i]; } int s = (double)1 / (4 * M) * sum; int num = 0; for (int i = 0; i < N; i++) { if (A[i] >= ...
#include <bits/stdc++.h> using namespace std; #define MOD 1000000007 int main() { int N, M; cin >> N >> M; int sum = 0; vector<int> A(N); for (int i = 0; i < N; i++) { cin >> A[i]; sum += A[i]; } double s = (double)1 / (4 * M) * sum; int num = 0; for (int i = 0; i < N; i++) { if (A[i] ...
[["-", 0, 30, 0, 14, 8, 9, 0, 43, 39, 40], ["+", 0, 30, 0, 14, 8, 9, 0, 43, 39, 40]]
1
142
N, M = map(int, input().split()) A = [int(p) for p in input().split()] sumA = sum(A) count = 0 for i in A: if(i > sumA/(4*M)): count += 1 if(count > M-1): print("Yes") else: print("No")
N, M = map(int, input().split()) A = [int(p) for p in input().split()] sumA = sum(A) count = 0 for i in A: if(i >= sumA/(4*M)): count += 1 if(count >= M): print("Yes") else: print("No")
[["-", 8, 196, 0, 57, 15, 23, 0, 666, 667, 47], ["+", 8, 196, 0, 57, 15, 23, 0, 666, 667, 20], ["-", 0, 656, 0, 57, 15, 23, 0, 666, 667, 47], ["+", 0, 656, 0, 57, 15, 23, 0, 666, 667, 20], ["-", 0, 57, 15, 23, 0, 666, 0, 657, 17, 33], ["-", 0, 57, 15, 23, 0, 666, 0, 657, 12, 612]]
5
87
n, m = map(int, input().split()) a = list(map(int, input().split())) a.sort(reverse=True) total = sum(a) canPick = True for i in range(m): if a[m] < total / (4 * m): canPick = False if canPick is True: print("Yes") else: print("No")
n, m = map(int, input().split()) a = list(map(int, input().split())) a.sort(reverse=True) total = sum(a) canPick = True for i in range(m): if a[i] < total / (4 * m): canPick = False if canPick is True: print("Yes") else: print("No")
[["-", 8, 196, 0, 57, 15, 666, 0, 206, 206, 22], ["+", 8, 196, 0, 57, 15, 666, 0, 206, 206, 22]]
5
94
import sys N,M=map(int,input().split()) A=list(map(int,input().split())) total=sum(A) sou=1/(M*4) s=0 for a in A: tmp=a/total if(tmp > sou): s+=1 if(s == M): print("Yes") sys.exit() print('No')
import sys N,M=map(int,input().split()) A=list(map(int,input().split())) total=sum(A) sou=1/(M*4) s=0 for a in A: tmp=a/total if(tmp >= sou): s+=1 if(s == M): print("Yes") sys.exit() print('No')
[["-", 8, 196, 0, 57, 15, 23, 0, 666, 667, 47], ["+", 8, 196, 0, 57, 15, 23, 0, 666, 667, 20]]
5
97
#include <bits/stdc++.h> using namespace std; #define REP(i, n) for (int i = 0; i < (n); i++) #define REP2(i, x, n) for (int i = x; i < (n); i++) #define ALL(n) begin(n), end(n) #define sz(x) int(x.size()) using ll = long long; const ll LLINF = numeric_limits<long long>::max(); const int mod = 1000000007; const int INF...
#include <bits/stdc++.h> using namespace std; #define REP(i, n) for (int i = 0; i < (n); i++) #define REP2(i, x, n) for (int i = x; i < (n); i++) #define ALL(n) begin(n), end(n) #define sz(x) int(x.size()) using ll = long long; const ll LLINF = numeric_limits<long long>::max(); const int mod = 1000000007; const int INF...
[["-", 0, 30, 0, 14, 8, 9, 0, 43, 39, 40], ["+", 0, 30, 0, 14, 8, 9, 0, 43, 39, 40], ["+", 31, 69, 341, 342, 0, 16, 31, 16, 31, 22], ["+", 31, 69, 341, 342, 0, 16, 31, 16, 17, 33], ["+", 51, 16, 31, 69, 341, 342, 0, 16, 17, 33], ["+", 51, 16, 31, 69, 341, 342, 0, 16, 12, 13]]
1
197
def main(): n, m = map(int, input().split()) data = list(map(int, input().split())) sum_v = sum(data) count = 0 for d in data: if sum_v / ( 4 * m ) < d: count += 1 else: pass if count >= m: print("Yes") else: print("No") if __name__ == "__main__": main()
def main(): n, m = map(int, input().split()) data = list(map(int, input().split())) sum_v = sum(data) count = 0 for d in data: if sum_v / ( 4 * m ) <= d: count += 1 else: pass if count >= m: print("Yes") else: print("No") if __name__ == "__main__": main()
[["-", 0, 7, 8, 196, 0, 57, 15, 666, 667, 18], ["+", 0, 7, 8, 196, 0, 57, 15, 666, 667, 19]]
5
98
n, m = map(int, input().split()) a_list = list(map(int, input().split())) tot_num = sum(a_list) selectable = len([el for el in a_list if el>=tot_num/4*m]) >= m if selectable: print('Yes') else: print('No')
n, m = map(int, input().split()) a_list = list(map(int, input().split())) tot_num = sum(a_list) selectable = len([el for el in a_list if el>=tot_num/4/m]) >= m if selectable: print('Yes') else: print('No')
[["-", 0, 658, 0, 678, 0, 666, 0, 657, 17, 48], ["+", 0, 658, 0, 678, 0, 666, 0, 657, 17, 85]]
5
78
#include <bits/stdc++.h> using namespace std; const int N = 1e5 + 7; int main() { ios_base::sync_with_stdio(0); cin.tie(0); // freopen("in.in" , "r" , stdin) ; int n, m, ans = 0, sum = 0; cin >> n >> m; int a[n + 1]; for (int i = 0; i < n; i++) { cin >> a[i]; sum += a[i]; } int lim = sum /...
#include <bits/stdc++.h> using namespace std; const int N = 1e5 + 7; int main() { ios_base::sync_with_stdio(0); cin.tie(0); // freopen("in.in" , "r" , stdin) ; int n, m, ans = 0, sum = 0; cin >> n >> m; double a[n + 1]; for (int i = 0; i < n; i++) { cin >> a[i]; sum += a[i]; } double lim = ...
[["-", 0, 30, 0, 14, 8, 9, 0, 43, 39, 40], ["+", 0, 30, 0, 14, 8, 9, 0, 43, 39, 40], ["-", 49, 50, 51, 16, 12, 23, 0, 16, 31, 13], ["+", 49, 50, 51, 16, 12, 23, 0, 16, 31, 13]]
1
153
#include <bits/stdc++.h> using namespace std; #define fio \ ios_base::sync_with_stdio(0); \ cin.tie(NULL); \ cout.tie(NULL); #define Mod 1...
#include <bits/stdc++.h> using namespace std; #define fio \ ios_base::sync_with_stdio(0); \ cin.tie(NULL); \ cout.tie(NULL); #define Mod 1...
[["+", 0, 43, 49, 50, 51, 16, 31, 74, 0, 24], ["+", 49, 50, 51, 16, 31, 74, 39, 77, 39, 78], ["+", 0, 43, 49, 50, 51, 16, 31, 74, 0, 25], ["+", 51, 16, 12, 23, 0, 16, 12, 74, 0, 24], ["+", 12, 23, 0, 16, 12, 74, 39, 77, 39, 78], ["+", 51, 16, 12, 23, 0, 16, 12, 74, 0, 25]]
1
416
import java.io.BufferedInputStream; import java.util.Arrays; import java.util.Scanner; import java.util.Stack; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(new BufferedInputStream(System.in)); int n = sc.nextInt(); int m = sc.nextInt(); int a[] = new int[n]; ...
import java.io.BufferedInputStream; import java.util.Arrays; import java.util.Scanner; import java.util.Stack; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(new BufferedInputStream(System.in)); int n = sc.nextInt(); int m = sc.nextInt(); int a[] = new int[n]; ...
[["-", 15, 15, 0, 16, 31, 504, 71, 16, 17, 33], ["-", 15, 15, 0, 16, 31, 504, 71, 16, 12, 499]]
3
178
#include <bits/stdc++.h> using namespace std; #define rep(i, n) for (int i = 0; i < n; i++) #define ll long long int int main() { int N, M; cin >> N >> M; int A[N], count = 0, jud = 0; ; rep(i, N) { cin >> A[i]; count += A[i]; } rep(i, N) { if (A[i] >= count / (4 * M)) jud++; } if ...
#include <bits/stdc++.h> using namespace std; #define rep(i, n) for (int i = 0; i < n; i++) #define ll long long int int main() { int N, M; cin >> N >> M; int A[N], count = 0, jud = 0; ; rep(i, N) { cin >> A[i]; count += A[i]; } rep(i, N) { if (A[i] >= (double)count / (4 * M)) jud++; ...
[["+", 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
123
//#include <tourist> #include <bits/stdc++.h> using namespace std; typedef long long ll; typedef pair<ll, ll> p; const int INF = 1e9; const ll LINF = ll(1e18); const int MOD = 1000000007; const int dx[4] = {0, 1, 0, -1}, dy[4] = {-1, 0, 1, 0}; const int Dx[8] = {0, 1, 1, 1, 0, -1, -1, -1}, Dy[8] = {-1, -1, 0,...
//#include <tourist> #include <bits/stdc++.h> using namespace std; typedef long long ll; typedef pair<ll, ll> p; const int INF = 1e9; const ll LINF = ll(1e18); const int MOD = 1000000007; const int dx[4] = {0, 1, 0, -1}, dy[4] = {-1, 0, 1, 0}; const int Dx[8] = {0, 1, 1, 1, 0, -1, -1, -1}, Dy[8] = {-1, -1, 0,...
[["-", 0, 30, 0, 14, 8, 9, 0, 43, 39, 40], ["+", 0, 30, 0, 14, 8, 9, 0, 43, 39, 40], ["-", 8, 9, 0, 43, 49, 50, 51, 2, 63, 40], ["-", 0, 43, 49, 50, 51, 2, 3, 4, 0, 24], ["-", 51, 2, 3, 4, 0, 16, 12, 23, 0, 25]]
1
405
#include <iostream> #include <vector> using namespace std; int main(void) { // Your code here! 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); } int th = sum / (4 * M); int cnt = 0; for (int i = 0; i < N; i++) { if (A....
#include <iostream> #include <vector> using namespace std; int main(void) { // Your code here! 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); } double th = (double)sum / (4 * M); int cnt = 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], ["+", 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
150
#include <stdio.h> #include <stdlib.h> int cmp(const void *p, const void *q) { return -*(int *)p + *(int *)q; } int main() { int a[210000], i, n, j = 0, m; double k, l; scanf("%d%d", &n, &m); for (i = 0; i < n; i++) { scanf("%d", &a[i]); } for (i = 0; i < n; i++) { j += a[i]; } qsort(a, n, s...
#include <stdio.h> #include <stdlib.h> int cmp(const void *p, const void *q) { return -*(int *)p + *(int *)q; } int main() { int a[210000], i, n, j = 0, m; double k, l; scanf("%d%d", &n, &m); for (i = 0; i < n; i++) { scanf("%d", &a[i]); } for (i = 0; i < n; i++) { j += a[i]; } qsort(a, n, s...
[["-", 0, 1, 0, 11, 12, 16, 31, 16, 12, 13], ["+", 0, 1, 0, 11, 12, 16, 31, 16, 12, 13]]
0
184
#include <iostream> #include <vector> int main() { std::ios_base::sync_with_stdio(0); std::cin.tie(0); int n, m, inp, cnt = 0; std::cin >> n >> m; long sum = 0; std::vector<int> v{}; for (int i = 0; i < n; ++i) { std::cin >> inp; sum += inp; v.push_back(inp); } for (int i = 1; i <= n; ++...
#include <iostream> #include <vector> int main() { std::ios_base::sync_with_stdio(0); std::cin.tie(0); long n, m, inp, cnt = 0; std::cin >> n >> m; long sum = 0; std::vector<long> v{0}; for (int i = 0; i < n; ++i) { std::cin >> inp; sum += inp; v.push_back(inp); } for (int i = 1; i <= n;...
[["-", 0, 30, 0, 14, 8, 9, 0, 43, 39, 40], ["+", 0, 14, 8, 9, 0, 43, 39, 86, 0, 96], ["-", 39, 343, 141, 344, 3, 347, 0, 77, 39, 40], ["+", 141, 344, 3, 347, 0, 77, 39, 86, 0, 96], ["+", 8, 9, 0, 43, 49, 50, 51, 83, 0, 13]]
1
143
// I am so vegetable //#define _LOCAL_ #pragma GCC optimize(2) #include <bits/stdc++.h> #define FIO ios::sync_with_stdio(false), cin.tie(0), cout.tie(0) #define PB push_back #define IN insert #define ER erase #define CT count #define EP empty #define _for(i, a, b) for (int i = (a); i < (b); ++i) #define _rfor(i, a, b) ...
// I am so vegetable //#define _LOCAL_ #pragma GCC optimize(2) #include <bits/stdc++.h> #define FIO ios::sync_with_stdio(false), cin.tie(0), cout.tie(0) #define PB push_back #define IN insert #define ER erase #define CT count #define EP empty #define _for(i, a, b) for (int i = (a); i < (b); ++i) #define _rfor(i, a, b) ...
[["-", 0, 30, 0, 14, 8, 9, 0, 43, 39, 40], ["+", 0, 30, 0, 14, 8, 9, 0, 43, 39, 40], ["-", 49, 50, 51, 16, 12, 23, 0, 16, 31, 13], ["+", 49, 50, 51, 16, 12, 23, 0, 16, 31, 13]]
1
340
#include <bits/stdc++.h> 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++) typedef long long ll; #define mod 1000000007 ll gcd(ll x, ll y) { return y ? gcd(y, x % y) : x; } ll lcm(ll x, ll y) { return x / gcd(x, y) * y; } int main() { int n, m, tota...
#include <bits/stdc++.h> 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++) typedef long long ll; #define mod 1000000007 ll gcd(ll x, ll y) { return y ? gcd(y, x % y) : x; } ll lcm(ll x, ll y) { return x / gcd(x, y) * y; } int main() { int n, m, tota...
[["-", 49, 50, 51, 16, 31, 23, 0, 16, 17, 72], ["+", 49, 50, 51, 16, 31, 23, 0, 16, 17, 33], ["-", 31, 16, 12, 23, 0, 41, 15, 16, 17, 19], ["+", 31, 16, 12, 23, 0, 41, 15, 16, 17, 18]]
1
188
/* CCBESTGIRL */ #include <bits/stdc++.h> using namespace std; typedef long long ll; int main() { ios_base::sync_with_stdio(false); cin.tie(NULL); int n, m; cin >> n >> m; int arr[n]; int sum = 0; for (int i = 0; i < n; i++) { cin >> arr[i]; sum += arr[i]; } double val = (double)sum / (4...
/* CCBESTGIRL */ #include <bits/stdc++.h> using namespace std; typedef long long ll; int main() { ios_base::sync_with_stdio(false); cin.tie(NULL); int n, m; cin >> n >> m; int arr[n]; int sum = 0; for (int i = 0; i < n; i++) { cin >> arr[i]; sum += arr[i]; } double val = (double)sum / (4...
[["-", 8, 9, 0, 57, 15, 339, 51, 16, 17, 47], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 17, 20]]
1
161
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 sum = 0; for (int i = 0; i < N; i++) { A[i] += sc.nextInt(); sum += 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 sum = 0; for (int i = 0; i < N; i++) { A[i] += sc.nextInt(); sum += A[i]; } dou...
[["-", 0, 195, 8, 196, 0, 503, 39, 506, 0, 507], ["+", 0, 195, 8, 196, 0, 503, 39, 511, 0, 512], ["+", 49, 200, 51, 16, 31, 16, 31, 74, 0, 24], ["+", 51, 16, 31, 16, 31, 74, 39, 511, 0, 512], ["+", 49, 200, 51, 16, 31, 16, 31, 74, 0, 25]]
3
178
#include <bits/stdc++.h> using namespace std; int main(void) { 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]; } sort(a.begin(), a.end(), greater<int>()); int count = 0; for (int i = 0; i < n; i++) { if (a[i] >= total...
#include <bits/stdc++.h> using namespace std; int main(void) { int n, m; cin >> n >> m; vector<int> a(n); double total = 0; for (int i = 0; i < n; i++) { cin >> a[i]; total += a[i]; } sort(a.begin(), a.end(), greater<int>()); int count = 0; for (int i = 0; i < n; i++) { if (a[i] >= to...
[["-", 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
150
#include <iostream> #include <vector> using namespace std; int main() { int N, M; cin >> N >> M; vector<int> A(N); int sum = 0; int check = 0; for (int i = 0; i < N; i++) { cin >> A.at(i); sum = sum + A.at(i); } for (int i = 0; i < N; i++) { if (A.at(i) < (sum / (4 * M))) { check++; ...
#include <iostream> #include <vector> using namespace std; int main() { double N, M; cin >> N >> M; vector<double> A(N); double sum = 0; int check = 0; for (int i = 0; i < N; i++) { cin >> A.at(i); sum = sum + A.at(i); } for (int i = 0; i < N; i++) { if (A.at(i) < (sum / (4 * M))) { ch...
[["-", 0, 30, 0, 14, 8, 9, 0, 43, 39, 40], ["+", 0, 30, 0, 14, 8, 9, 0, 43, 39, 40], ["-", 0, 43, 39, 344, 3, 347, 0, 77, 39, 40], ["+", 0, 43, 39, 344, 3, 347, 0, 77, 39, 40]]
1
154
#include <bits/stdc++.h> using namespace std; #define rep(i, n) for (int i = 0; i < (int)(n); i++) int main() { int N, M; cin >> N >> M; vector<int> a(N); rep(i, N) { cin >> a.at(i); } int sum = 0; rep(i, N) { sum += a.at(i); } int cnt = 0; rep(i, N) { if (!(a.at(i) < sum / (4 * M))) { cnt...
#include <bits/stdc++.h> using namespace std; #define rep(i, n) for (int i = 0; i < (int)(n); i++) int main() { double N, M; cin >> N >> M; vector<double> a(N); rep(i, N) { cin >> a.at(i); } double sum = 0; rep(i, N) { sum += a.at(i); } int cnt = 0; rep(i, N) { if (!(a.at(i) < sum / (4 * M))) { ...
[["-", 0, 30, 0, 14, 8, 9, 0, 43, 39, 40], ["+", 0, 30, 0, 14, 8, 9, 0, 43, 39, 40], ["-", 0, 43, 39, 344, 3, 347, 0, 77, 39, 40], ["+", 0, 43, 39, 344, 3, 347, 0, 77, 39, 40]]
1
140
n,m=map(int,input().split()) a=list(map(int,input().split())) t=sum(a) cnt=0 d=int(t/(4*m)) for i in range(n): if d<=a[i]: cnt+=1 if cnt>=m: print("Yes") else: print("No")
n,m=map(int,input().split()) a=list(map(int,input().split())) t=sum(a) cnt=0 d=(t/(4*m)) for i in range(n): if d<=a[i]: cnt+=1 if cnt>=m: print("Yes") else: print("No")
[["-", 0, 656, 0, 1, 0, 662, 12, 652, 63, 22]]
5
92
n,m = (int(x) for x in input().split()) la = list(map(int, input().split())) h = 0 s = sum(la) for i in range(n): if la[i] > s/(4*m): h += 1 if h >= m: print("Yes") else: print("No")
n,m = (int(x) for x in input().split()) la = list(map(int, input().split())) h = 0 s = sum(la) for i in range(n): if la[i] >= s/(4*m): h += 1 if h >= 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
n,m=map(int,input().split()) a=list(map(int,input().split())) ashi=sum(a)/4*m ans="No" a=[i for i in a if i >=ashi] if len(a)>=m: ans="Yes" print(ans)
n,m=map(int,input().split()) a=list(map(int,input().split())) ashi=sum(a)/(4*m) ans="No" b=[i for i in a if i >=ashi] if len(b)>=m: ans="Yes" print(ans)
[["+", 0, 1, 0, 662, 12, 657, 12, 23, 0, 24], ["+", 0, 1, 0, 662, 12, 657, 12, 23, 0, 25], ["-", 36, 36, 0, 656, 0, 1, 0, 662, 31, 22], ["+", 36, 36, 0, 656, 0, 1, 0, 662, 31, 22], ["-", 0, 57, 15, 666, 0, 652, 3, 4, 0, 22], ["+", 0, 57, 15, 666, 0, 652, 3, 4, 0, 22]]
5
78
#include <bits/stdc++.h> using namespace std; vector<int> V; int main() { int N, M; cin >> N >> M; int Sum = 0; while (N--) { int X; cin >> X; Sum += X; V.push_back(X); } sort(V.rbegin(), V.rend()); if (V[M - 1] >= (Sum + 4 * M - 1) / 4 * M) puts("Yes"); else puts("No"); return...
#include <bits/stdc++.h> using namespace std; vector<int> V; int main() { int N, M; cin >> N >> M; int Sum = 0; while (N--) { int X; cin >> X; Sum += X; V.push_back(X); } sort(V.rbegin(), V.rend()); if (V[M - 1] >= (Sum + (4 * M) - 1) / (4 * M)) puts("Yes"); else puts("No"); re...
[["+", 31, 23, 0, 16, 31, 16, 12, 23, 0, 24], ["+", 31, 23, 0, 16, 31, 16, 12, 23, 0, 25], ["+", 15, 339, 51, 16, 12, 16, 12, 23, 0, 24], ["+", 15, 339, 51, 16, 12, 16, 12, 23, 0, 25]]
1
115
#include <bits/stdc++.h> using namespace std; #define rep(i, n) for (int64_t i = 0; i < (int64_t)(n); i++) int main() { int n, m; cin >> n >> m; vector<double> a(n); rep(i, n) cin >> a[i]; sort(a.begin(), a.end()); reverse(a.begin(), a.end()); int v = 0; for (double i : a) v += i; double w = v /...
#include <bits/stdc++.h> using namespace std; #define rep(i, n) for (int64_t i = 0; i < (int64_t)(n); i++) int main() { int n, m; cin >> n >> m; vector<double> a(n); rep(i, n) cin >> a[i]; sort(a.begin(), a.end()); reverse(a.begin(), a.end()); int v = 0; for (double i : a) v += i; double w = 1.0...
[["+", 0, 43, 49, 50, 51, 16, 31, 16, 31, 13], ["+", 0, 43, 49, 50, 51, 16, 31, 16, 17, 48]]
1
162
#include <bits/stdc++.h> using namespace std; #define rep(i, n) for (int i = 0; i < (n); ++i) using ll = long long; int main() { int n, m; cin >> n >> m; vector<int> a(n); int sum = 0; rep(i, n) { cin >> a[i]; sum += a[i]; } sort(a.begin(), a.end(), greater<int>()); if (a[m - 1] >= sum / (4 * m)...
#include <bits/stdc++.h> using namespace std; #define rep(i, n) for (int i = 0; i < (n); ++i) using ll = long long; int main() { int n, m; cin >> n >> m; vector<double> a(n); double sum = 0; rep(i, n) { cin >> a[i]; sum += a[i]; } sort(a.begin(), a.end(), greater<double>()); if (a[m - 1] >= sum ...
[["-", 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], ["-", 0, 2, 63, 346, 3, 347, 0, 77, 39, 40], ["+", 0, 2, 63, 346, 3, 347, 0, 77, 39, 40]]
1
125
n,m=map(int,input().split()) A=list(map(int,input().split())) cnt=0 s=sum(A) for i in range(n): if A[i]>=s*(1/4*m): cnt += 1 if cnt>=m: print("Yes") else: print("No")
n,m=map(int,input().split()) A=list(map(int,input().split())) cnt=0 s=sum(A) for i in range(n): if A[i]>=s*(1/(4*m)): cnt += 1 if cnt>=m: print("Yes") else: print("No")
[["+", 0, 657, 12, 23, 0, 657, 12, 23, 0, 24], ["+", 0, 657, 12, 23, 0, 657, 12, 23, 0, 25]]
5
88
#include <bits/stdc++.h> using namespace std; typedef long long ll; int a[1001]; int main() { ll m, n; cin >> n >> m; ll sum = 0; for (int i = 0; i < n; i++) { cin >> a[i]; sum += a[i]; } sum /= 4 * m; int ans = 0; for (int i = 0; i < n; i++) { if (a[i] >= sum) ans++; } if (ans >= ...
#include <bits/stdc++.h> using namespace std; typedef long long ll; ll a[1001]; int main() { ll m, n; cin >> n >> m; double sum = 0; for (int i = 0; i < n; i++) { cin >> a[i]; sum += a[i]; } sum /= 4.0 * m; int ans = 0; for (int i = 0; i < n; i++) { if (a[i] >= sum) ans++; } if (an...
[["-", 36, 36, 36, 36, 0, 30, 0, 43, 39, 40], ["+", 36, 36, 36, 36, 0, 30, 0, 43, 39, 78], ["-", 0, 30, 0, 14, 8, 9, 0, 43, 39, 78], ["+", 0, 30, 0, 14, 8, 9, 0, 43, 39, 40], ["-", 8, 9, 0, 1, 0, 11, 12, 16, 31, 13], ["+", 8, 9, 0, 1, 0, 11, 12, 16, 31, 13]]
1
127
#include <algorithm> #include <iostream> #include <string> using namespace std; int main() { int i, N, M, sum, all; bool can; int A[100]; can = false; // string S,A; cin >> N >> M; for (i = 0; i < N; i++) { cin >> A[i]; } all = 0; sum = 0; for (i = 0; i < N; i++) { all += A[i]; } f...
#include <algorithm> #include <iostream> #include <string> using namespace std; int main() { int i, N, M, sum, all; bool can; int A[100]; can = false; // string S,A; cin >> N >> M; for (i = 0; i < N; i++) { cin >> A[i]; } all = 0; sum = 0; for (i = 0; i < N; i++) { all += A[i]; } f...
[["-", 12, 23, 0, 16, 12, 23, 0, 16, 31, 13], ["+", 12, 23, 0, 16, 12, 23, 0, 16, 31, 13]]
1
165
n,m=map(int,input().split()) a=list(map(int,input().split())) a.sort() sum_vote=sum(a) least_vote=int((sum_vote/(4*m))) if(a[-1*m]>=least_vote): print("Yes") else: print("No")
n,m=map(int,input().split()) a=list(map(int,input().split())) a.sort() sum_vote=sum(a) least_vote=sum_vote/(4*m) if(a[-1*m]>=least_vote): 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, 662, 12, 652, 3, 4, 0, 23, 0, 24], ["-", 3, 4, 0, 23, 0, 657, 12, 23, 0, 25], ["-", 0, 662, 12, 652, 3, 4, 0, 23, 0, 25]]
5
85
#include <algorithm> #include <cmath> #include <iomanip> #include <iostream> #include <map> #include <stack> #include <string> #include <vector> using namespace std; int main() { int N, M; cin >> N >> M; vector<int> AS; int A; int sum = 0; for (int i = 0; i < N; ++i) { cin >> A; AS.push_back(A); ...
#include <algorithm> #include <cmath> #include <iomanip> #include <iostream> #include <map> #include <stack> #include <string> #include <vector> using namespace std; int main() { int N, M; cin >> N >> M; vector<int> AS; int A; int sum = 0; for (int i = 0; i < N; ++i) { cin >> A; AS.push_back(A); ...
[["-", 8, 9, 0, 57, 15, 339, 51, 16, 17, 18], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 17, 20]]
1
156
#include <bits/stdc++.h> using namespace std; #define int long long #define rep(a, b, c) for (int a = b; a < c; a++) #define repd(a, b, c) for (int a = c; a >= b; a--) #define vi vector<int> #define all(v) v.begin(), v.end() #define F first #define S second #define pb push_back #define pbb pop_back const int N = 5e5 + ...
#include <bits/stdc++.h> using namespace std; #define int long long #define rep(a, b, c) for (int a = b; a < c; a++) #define repd(a, b, c) for (int a = c; a >= b; a--) #define vi vector<int> #define all(v) v.begin(), v.end() #define F first #define S second #define pb push_back #define pbb pop_back const int N = 5e5 + ...
[["-", 8, 9, 0, 7, 8, 9, 0, 43, 39, 40], ["+", 8, 9, 0, 7, 8, 9, 0, 43, 39, 40], ["+", 0, 43, 49, 50, 51, 16, 31, 16, 31, 13], ["+", 0, 43, 49, 50, 51, 16, 31, 16, 17, 48]]
1
225
N, M = map(int, input().split()) A = list(map(int, input().split())) cnt = 0 for i in range(N): if 1/4/M*sum(A)<A[i]: cnt += 1 if cnt>=M: print('Yes') else: print('No')
N, M = map(int, input().split()) A = list(map(int, input().split())) cnt = 0 for i in range(N): if 1/4/M*sum(A)<=A[i]: cnt += 1 if cnt>=M: print('Yes') else: print('No')
[["-", 0, 7, 8, 196, 0, 57, 15, 666, 667, 18], ["+", 0, 7, 8, 196, 0, 57, 15, 666, 667, 19]]
5
83
#include <bits/stdc++.h> #include <ext/pb_ds/assoc_container.hpp> #include <ext/pb_ds/tree_policy.hpp> #define ordered_set \ tree<ll, null_type, less<ll>, rb_tree_tag, tree_order_statistics_node_update> #define pb push_back #define mp make_pair #define ff fir...
#include <bits/stdc++.h> #include <ext/pb_ds/assoc_container.hpp> #include <ext/pb_ds/tree_policy.hpp> #define ordered_set \ tree<ll, null_type, less<ll>, rb_tree_tag, tree_order_statistics_node_update> #define pb push_back #define mp make_pair #define ff fir...
[["-", 0, 7, 8, 9, 0, 57, 75, 76, 0, 95], ["-", 8, 9, 0, 57, 75, 76, 0, 93, 0, 94], ["-", 8, 9, 0, 57, 75, 76, 0, 93, 0, 35]]
1
194
#include <bits/stdc++.h> using namespace std; typedef long long ll; using P = pair<ll, ll>; const ll mod = 1e9 + 7; #define ALL(x) (x).begin(), (x).end() #define pow(x, y) modpow(x, y) #define REP(i, n) for (ll(i) = 0; (i) < (n); (i)++) #define REPS(i, n) for (ll(i) = 1; (i) <= (n); (i)++) #define RREP(i, n) for (ll(i)...
#include <bits/stdc++.h> using namespace std; typedef long long ll; using P = pair<ll, ll>; const ll mod = 1e9 + 7; #define ALL(x) (x).begin(), (x).end() #define pow(x, y) modpow(x, y) #define REP(i, n) for (ll(i) = 0; (i) < (n); (i)++) #define REPS(i, n) for (ll(i) = 1; (i) <= (n); (i)++) #define RREP(i, n) for (ll(i)...
[["-", 0, 30, 0, 14, 8, 9, 0, 43, 39, 40], ["+", 0, 30, 0, 14, 8, 9, 0, 43, 39, 40], ["+", 49, 50, 51, 2, 63, 346, 3, 347, 0, 18], ["+", 51, 2, 63, 346, 3, 347, 0, 77, 39, 40], ["+", 49, 50, 51, 2, 63, 346, 3, 347, 0, 47]]
1
311
#include <iostream> using namespace std; int main() { int n, m, i, a[100], s = 0, j = 0; double min; cin >> n >> m; for (i = 0; i < n; i++) { cin >> a[i]; s += a[i]; } min = s / (4 * m); for (i = 0; i < n; i++) { if (a[i] >= min) j++; if (j == m) { cout << "Yes"; return 0...
#include <iostream> using namespace std; int main() { int n, m, i, a[100], s = 0, j = 0; double min; cin >> n >> m; for (i = 0; i < n; i++) { cin >> a[i]; s += a[i]; } min = s / (4.0 * m); for (i = 0; i < n; i++) { if (a[i] >= min) j++; if (j == m) { cout << "Yes"; return...
[["-", 0, 11, 12, 16, 12, 23, 0, 16, 31, 13], ["+", 0, 11, 12, 16, 12, 23, 0, 16, 31, 13]]
1
133
// PIGMEISTER™ // #include <bits/stdc++.h> using namespace std; #define ll long long #define ull unsigned long long #define sidha(i, x, n) for (ll i = (ll)(x); i < (ll)(n); i++) #define ulta(i, x, n) for (ll i = (ll)(x); i >= (ll)(n); i--) #define mi map<ll, ll> #define vi vector<ll> #define si set<ll> #define pi...
// PIGMEISTER™ // #include <bits/stdc++.h> using namespace std; #define ll long long #define ull unsigned long long #define sidha(i, x, n) for (ll i = (ll)(x); i < (ll)(n); i++) #define ulta(i, x, n) for (ll i = (ll)(x); i >= (ll)(n); i--) #define mi map<ll, ll> #define vi vector<ll> #define si set<ll> #define pi...
[["-", 0, 30, 0, 14, 8, 9, 0, 43, 39, 78], ["+", 0, 30, 0, 14, 8, 9, 0, 43, 39, 40], ["+", 0, 43, 49, 50, 51, 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
297
#include <algorithm> #include <cmath> #include <iomanip> #include <iostream> #include <map> #include <queue> #include <string> #include <vector> #define rep(i, n) for (int i = 0; i < (n); i++) using namespace std; typedef long long int ll; const int INF = 100000000; int main() { int n, m; int a[100]; cin >> n ...
#include <algorithm> #include <cmath> #include <iomanip> #include <iostream> #include <map> #include <queue> #include <string> #include <vector> #define rep(i, n) for (int i = 0; i < (n); i++) using namespace std; typedef long long int ll; const int INF = 100000000; int main() { int n, m; int a[100]; cin >> n ...
[["-", 0, 30, 0, 14, 8, 9, 0, 43, 39, 40], ["+", 0, 30, 0, 14, 8, 9, 0, 43, 39, 78], ["+", 0, 30, 0, 14, 8, 9, 0, 43, 39, 40], ["-", 49, 50, 51, 16, 12, 23, 0, 16, 31, 13], ["+", 49, 50, 51, 16, 12, 23, 0, 16, 31, 13], ["-", 8, 9, 0, 57, 15, 339, 51, 16, 17, 47], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 17, 20]]
1
152
#include <bits/stdc++.h> using namespace std; #define int long long #define rep(i, n) for (int i = 0; i < n; i++) #define rep1(i, n) for (int i = 1; i <= n; i++) #define rep2(i, n) for (int i = 0; i <= n; i++) #define repr(i, a, n) for (int i = a; i < n; i++) #define all(a) a.begin(), a.end() #define P pair<long long, ...
#include <bits/stdc++.h> using namespace std; #define int long long #define rep(i, n) for (int i = 0; i < n; i++) #define rep1(i, n) for (int i = 1; i <= n; i++) #define rep2(i, n) for (int i = 0; i <= n; i++) #define repr(i, a, n) for (int i = a; i < n; i++) #define all(a) a.begin(), a.end() #define P pair<long long, ...
[["-", 8, 9, 0, 57, 15, 339, 51, 16, 17, 47], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 17, 20]]
1
291
#include <bits/stdc++.h> using namespace std; #define rep(i, x, y) for (ll i = (x); i < (y); i++) #define rrep(i, x, y) for (ll i = (ll)(y)-1; i >= (x); i--) #define all(x) (x).begin(), (x).end() #ifdef LOCAL #define dump(x) cerr << #x << " = " << (x) << endl #define debug(x) ...
#include <bits/stdc++.h> using namespace std; #define rep(i, x, y) for (ll i = (x); i < (y); i++) #define rrep(i, x, y) for (ll i = (ll)(y)-1; i >= (x); i--) #define all(x) (x).begin(), (x).end() #ifdef LOCAL #define dump(x) cerr << #x << " = " << (x) << endl #define debug(x) ...
[["+", 12, 2, 3, 4, 0, 16, 31, 16, 31, 13], ["+", 12, 2, 3, 4, 0, 16, 31, 16, 17, 48]]
1
273
def count_section_by_zero(data): count = 0 flg = False start = 0 for i, d in enumerate(data): if flg is False and d != 0: count += 1 flg = True if d == 0: flg = False return count def input_list(): return list(map(int, input().split())) def input_list_str(): return list(...
def count_section_by_zero(data): count = 0 flg = False start = 0 for i, d in enumerate(data): if flg is False and d != 0: count += 1 flg = True if d == 0: flg = False return count def input_list(): return list(map(int, input().split())) def input_list_str(): return list(...
[["-", 8, 196, 0, 1, 0, 662, 12, 652, 63, 22], ["+", 0, 1, 0, 662, 12, 652, 63, 319, 500, 22], ["+", 0, 1, 0, 662, 12, 652, 63, 319, 0, 131], ["+", 0, 1, 0, 662, 12, 652, 63, 319, 319, 22]]
5
396
n,m = map(int,input().split()) A = list(map(int,input().split())) s = sum(A) A.sort(reverse=True) if A[m] >= s*1/(4*m): print('Yes') else: print('No')
n,m = map(int,input().split()) A = list(map(int,input().split())) s = sum(A) A.sort(reverse=True) if A[m-1] >= s*1/(4*m): print('Yes') else: print('No')
[["+", 0, 57, 15, 666, 0, 206, 206, 657, 17, 33], ["+", 0, 57, 15, 666, 0, 206, 206, 657, 12, 612]]
5
77
#include <bits/stdc++.h> using namespace std; int main() { int n, m; cin >> n >> m; float total = 0; vector<float> v; for (int i = 0; i < n; i++) { float x; cin >> x; total += x; v.push_back(x); } total /= (4 * (float)(m)); sort(v.begin(), v.end(), greater<int>()); int cnt = 0; for...
#include <bits/stdc++.h> using namespace std; int main() { int n, m; cin >> n >> m; float total = 0; vector<float> v; for (int i = 0; i < n; i++) { float x; cin >> x; total += x; v.push_back(x); } total /= (4 * (float)(m)); sort(v.begin(), v.end(), greater<int>()); int cnt = 0; for...
[["-", 8, 9, 0, 57, 15, 339, 51, 16, 17, 47], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 17, 20]]
1
158
#include <stdio.h> int int_sort(const void *a, const void *b) { /* 引数はvoid*型と規定されているのでint型にcastする */ if (*(int *)a < *(int *)b) { return -1; } else if (*(int *)a == *(int *)b) { return 0; } return 1; } int main(void) { int n, m, i, sum = 0; int *a; scanf("%d %d", &n, &m); a = (int *)malloc(s...
#include <stdio.h> int int_sort(const void *a, const void *b) { /* 引数はvoid*型と規定されているのでint型にcastする */ if (*(int *)a < *(int *)b) { return -1; } else if (*(int *)a == *(int *)b) { return 0; } return 1; } int main(void) { int n, m, i, sum = 0; int *a; scanf("%d %d", &n, &m); a = (int *)malloc(s...
[["+", 15, 23, 0, 16, 12, 16, 31, 74, 0, 24], ["+", 0, 16, 12, 16, 31, 74, 39, 77, 39, 40], ["+", 15, 23, 0, 16, 12, 16, 31, 74, 0, 25]]
0
209
n,m = map(int,input().split()) a = list(map(int, input().split())) popular = list(filter(lambda e: e>(1/(4*m))*sum(a),a)) print("Yes" if len(popular) >= m else "No")
n,m = map(int,input().split()) a = list(map(int, input().split())) popular = list(filter(lambda e: e>=(1/(4*m))*sum(a),a)) print("Yes" if len(popular) >= m else "No")
[["-", 0, 652, 3, 4, 0, 670, 8, 666, 667, 47], ["+", 0, 652, 3, 4, 0, 670, 8, 666, 667, 20]]
5
79
#include <bits/stdc++.h> using namespace std; using ll = long long; using pint = pair<int, int>; using pll = pair<ll, ll>; using Edge = pair<int, ll>; using Graph = vector<vector<int>>; using WeightedGraph = vector<vector<Edge>>; const ll INF64 = 1LL << 60; const int INF32 = 1 << 29; const ll MOD = 1000000007; const i...
#include <bits/stdc++.h> using namespace std; using ll = long long; using pint = pair<int, int>; using pll = pair<ll, ll>; using Edge = pair<int, ll>; using Graph = vector<vector<int>>; using WeightedGraph = vector<vector<Edge>>; const ll INF64 = 1LL << 60; const int INF32 = 1 << 29; const ll MOD = 1000000007; const 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
323
#include <bits/stdc++.h> using namespace std; #define all(v) v.begin(), v.end() #define rep(i, n) for (int i = 0; i < (int)(n); i++) #define intll int long long const int INF = 1e9; const int MOD = 1e9 + 7; int main() { int n, m; cin >> n >> m; int all = 0; vector<int> v(n); rep(i, n) { cin >> v.at(i);...
#include <bits/stdc++.h> using namespace std; #define all(v) v.begin(), v.end() #define rep(i, n) for (int i = 0; i < (int)(n); i++) #define intll int long long const int INF = 1e9; const int MOD = 1e9 + 7; int main() { int n, m; cin >> n >> m; int all = 0; vector<int> v(n); rep(i, n) { cin >> v.at(i);...
[["-", 8, 9, 0, 57, 15, 339, 51, 16, 17, 47], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 17, 20]]
1
144
(N, M) = [int(x) for x in input().split()] line=[int(x) for x in input().split()] cutoff=sum(line)/(4*M) count=0 for i in line: if i>=cutoff: count+=1 if count>M: print("Yes") else: print("No")
(N, M) = [int(x) for x in input().split()] line=[int(x) for x in input().split()] cutoff=sum(line)/(4*M) count=N for i in line: if i<cutoff: count-=1 if count>=M: print("Yes") else: print("No")
[["-", 36, 36, 0, 656, 0, 1, 0, 662, 12, 612], ["+", 36, 36, 0, 656, 0, 1, 0, 662, 12, 22], ["-", 0, 7, 8, 196, 0, 57, 15, 666, 667, 20], ["+", 0, 7, 8, 196, 0, 57, 15, 666, 667, 18], ["-", 0, 57, 64, 196, 0, 1, 0, 677, 17, 107], ["+", 0, 57, 64, 196, 0, 1, 0, 677, 17, 110], ["-", 36, 36, 0, 656, 0, 57, 15, 666, 667, 4...
5
87
n,m = gets.split(/ /).map(&:to_i) a = gets.split(/ /).map(&:to_i).sort{|a,b| b <=> a} sum = a.inject(&:+) / (4 * m) result = 'Yes' m.times do |i| if a[i] < sum result = 'No' end end puts result
n,m = gets.split(/ /).map(&:to_i) a = gets.split(/ /).map(&:to_i).sort{|a,b| b <=> a} sum = a.inject(&:+).to_f / (4 * m) result = 'Yes' m.times do |i| if a[i] < sum result = 'No' end end puts result
[["+", 0, 493, 0, 662, 12, 738, 31, 652, 17, 131], ["+", 0, 493, 0, 662, 12, 738, 31, 652, 735, 22]]
4
89
#include "algorithm" #include "bits/stdc++.h" #include "math.h" #include "string.h" using namespace std; typedef int64_t ll; typedef vector<int64_t> vll; typedef vector<vll> vvll; typedef vector<bool> vb; typedef vector<vb> vvb; typedef vector<int> vin; typedef pair<ll, ll> P; typedef vector<P> vp; typedef vector<doub...
#include "algorithm" #include "bits/stdc++.h" #include "math.h" #include "string.h" using namespace std; typedef int64_t ll; typedef vector<int64_t> vll; typedef vector<vll> vvll; typedef vector<bool> vb; typedef vector<vb> vvb; typedef vector<int> vin; typedef pair<ll, ll> P; typedef vector<P> vp; typedef vector<doub...
[["-", 0, 14, 8, 9, 0, 43, 49, 50, 49, 22], ["+", 0, 14, 8, 9, 0, 43, 49, 50, 49, 22], ["-", 0, 30, 0, 14, 8, 9, 0, 43, 0, 21], ["+", 0, 30, 0, 14, 8, 9, 0, 43, 0, 35], ["+", 0, 30, 0, 14, 8, 9, 0, 43, 39, 40]]
1
221
# coding: utf-8 # Your code here! # coding: utf-8 import sys sys.setrecursionlimit(10000000) #const dxdy=((1,0),(0,1)) # my functions here! def pin(type=int): return map(type,input().rstrip().split()) def resolve(): N,M=pin() A=sorted(list(pin())) A.reverse() p=(sum(A))//(4*M) #print(sum(A),A)...
# coding: utf-8 # Your code here! # coding: utf-8 import sys sys.setrecursionlimit(10000000) #const dxdy=((1,0),(0,1)) # my functions here! def pin(type=int): return map(type,input().rstrip().split()) def resolve(): N,M=pin() A=sorted(list(pin())) A.reverse() p=(sum(A))/(4*M) #print(sum(A),A) ...
[["-", 8, 196, 0, 1, 0, 662, 12, 657, 17, 676], ["+", 8, 196, 0, 1, 0, 662, 12, 657, 17, 85], ["-", 0, 652, 3, 4, 0, 206, 206, 666, 667, 47], ["+", 0, 652, 3, 4, 0, 206, 206, 666, 667, 20]]
5
303
n, m = gets.chomp!.split(" ").map(&:to_i) a = gets.chomp!.split(" ").map(&:to_i) if a.sort.reverse[m - 1] < (a.inject(:+) / (4 * m)) puts "No" else puts "Yes" end
n, m = gets.chomp!.split(" ").map(&:to_i) a = gets.chomp!.split(" ").map(&:to_i) if a.sort.reverse[m - 1] < (a.inject(:+) / (4.0 * m)) puts "No" else puts "Yes" end
[["-", 12, 739, 0, 738, 12, 739, 0, 738, 31, 612], ["+", 12, 739, 0, 738, 12, 739, 0, 738, 31, 531]]
4
74
N, M = map(int, input().split()) A = [int(i) for i in input().split()] A.sort(reverse=True) print(A) if A[M - 1] * 4 * M >= sum(A) : print('Yes') else: print('No')
N, M = map(int, input().split()) A = [int(i) for i in input().split()] A.sort(reverse=True) if A[M - 1] * 4 * M >= sum(A): 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
77
// WeirdBugsButOkay #include <bits/stdc++.h> #define ll long long #define ld long double #define pii pair<int, int> #define pll pair<ll, ll> #define mp make_pair #define pb push_back #define ff first #define ss second using namespace std; ll pow3(ll a, ll b, ll m = 1000000007) { ll res = 1; while (b > 0) { ...
// WeirdBugsButOkay #include <bits/stdc++.h> #define ll long long #define ld long double #define pii pair<int, int> #define pll pair<ll, ll> #define mp make_pair #define pb push_back #define ff first #define ss second using namespace std; ll pow3(ll a, ll b, ll m = 1000000007) { ll res = 1; while (b > 0) { ...
[["-", 8, 9, 0, 57, 15, 339, 51, 16, 17, 47], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 17, 20]]
1
268
#include "bits/stdc++.h" using namespace std; typedef long long ll; // #define int long long template <class T> bool INRANGE(T x, T a, T b) { return a <= x && x <= b; } template <class T> inline bool chmin(T &a, T b) { if (a > b) { a = b; return true; } return false; } template <class T> inline bool chma...
#include "bits/stdc++.h" using namespace std; typedef long long ll; // #define int long long template <class T> bool INRANGE(T x, T a, T b) { return a <= x && x <= b; } template <class T> inline bool chmin(T &a, T b) { if (a > b) { a = b; return true; } return false; } template <class T> inline bool chma...
[["+", 0, 57, 15, 339, 51, 16, 31, 74, 0, 24], ["+", 15, 339, 51, 16, 31, 74, 39, 77, 39, 40], ["+", 0, 57, 15, 339, 51, 16, 31, 74, 0, 25], ["+", 15, 339, 51, 16, 12, 16, 31, 74, 0, 24], ["+", 51, 16, 12, 16, 31, 74, 39, 77, 39, 40], ["+", 15, 339, 51, 16, 12, 16, 31, 74, 0, 25]]
1
320
#include <bits/stdc++.h> using namespace std; int main() { int n, m; cin >> n >> m; int ar[n]; for (int i = 0; i < n; ++i) cin >> ar[i]; int sum = 0; sum += accumulate(ar, ar + n, 0); sort(ar, ar + n, greater<int>()); bool flag = true; int req = sum / (4 * m); if (ar[m - 1] >= req) cout <...
#include <bits/stdc++.h> using namespace std; int main() { int n, m; cin >> n >> m; int ar[n]; for (int i = 0; i < n; ++i) cin >> ar[i]; int sum = 0; sum += accumulate(ar, ar + n, 0); sort(ar, ar + n, greater<int>()); bool flag = true; double req = (double)sum / (4 * m); if (ar[m - 1] >= req)...
[["-", 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
124
n,m= map(int,input().split()) l = list(map(int,input().split())) s = sum(l) r=s/(4*m) cnt=0 for i in l: if i>r: cnt=cnt+1 if cnt>=m: print("Yes") else: print("No")
n,m= map(int,input().split()) l = list(map(int,input().split())) s = sum(l) r=s/(4*m) cnt=0 for i in l: if i>=r: cnt=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
85
#include <algorithm> #include <iomanip> #include <iostream> #include <map> #include <math.h> #include <queue> #include <vector> using namespace std; typedef long long ll; #define rep(i, n) for (long long i = 0; i < (long long)(n); i++) #define repi(i, s, n) for (int i = (int)s; i < (int)n; i++) #define memset(v, h) me...
#include <algorithm> #include <iomanip> #include <iostream> #include <map> #include <math.h> #include <queue> #include <vector> using namespace std; typedef long long ll; #define rep(i, n) for (long long i = 0; i < (long long)(n); i++) #define repi(i, s, n) for (int i = (int)s; i < (int)n; i++) #define memset(v, h) me...
[["-", 0, 30, 0, 14, 8, 9, 0, 43, 39, 78], ["+", 0, 30, 0, 14, 8, 9, 0, 43, 39, 40], ["+", 15, 339, 51, 16, 12, 16, 12, 74, 0, 24], ["+", 51, 16, 12, 16, 12, 74, 39, 77, 39, 40], ["+", 15, 339, 51, 16, 12, 16, 12, 74, 0, 25]]
1
1,475
#include <iostream> #include <vector> using namespace std; int main() { int m, n; cin >> n >> m; int sum = 0; vector<int> a(n); for (int i = 0; i < n; i++) { cin >> a[i]; sum += a[i]; } int cnt = 0; for (int i = 0; i < n; i++) { if (a[i] >= (sum / (4 * m))) { cnt++; } } cout ...
#include <iostream> #include <vector> using namespace std; int main() { int m, n; cin >> n >> m; int sum = 0; vector<int> a(n); for (int i = 0; i < n; i++) { cin >> a[i]; sum += a[i]; } int cnt = 0; for (int i = 0; i < n; i++) { if (a[i] >= (sum / (4.0 * m))) { cnt++; } } cou...
[["-", 12, 23, 0, 16, 12, 23, 0, 16, 31, 13], ["+", 12, 23, 0, 16, 12, 23, 0, 16, 31, 13]]
1
135
#include <bits/stdc++.h> #define rep(i, a, b) for (int i = a; i < b; i++) #define Rep(i, a, b) for (int i = a; i <= b; i++) #define _GLIBCXX_DEBUG #define Vl vector<ll> #define Vs vector<string> #define ll long long #define ALL(v) (v).begin(), (v).end() using namespace std; void solve() { ll n, m; cin >> n >> m; ...
#include <bits/stdc++.h> #define rep(i, a, b) for (int i = a; i < b; i++) #define Rep(i, a, b) for (int i = a; i <= b; i++) #define _GLIBCXX_DEBUG #define Vl vector<ll> #define Vs vector<string> #define ll long long #define ALL(v) (v).begin(), (v).end() using namespace std; void solve() { ll n, m; cin >> n >> m; ...
[["-", 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> #define ll long long #define IOS \ ios_base::sync_with_stdio(false); \ cin.tie(NULL); \ cout.tie(NULL); #define deb(x...
#include <bits/stdc++.h> #define ll long long #define IOS \ ios_base::sync_with_stdio(false); \ cin.tie(NULL); \ cout.tie(NULL); #define deb(x...
[["+", 0, 57, 15, 339, 51, 16, 31, 74, 0, 24], ["+", 15, 339, 51, 16, 31, 74, 39, 77, 39, 40], ["+", 0, 57, 15, 339, 51, 16, 31, 74, 0, 25], ["+", 15, 339, 51, 16, 12, 16, 31, 74, 0, 24], ["+", 51, 16, 12, 16, 31, 74, 39, 77, 39, 40], ["+", 15, 339, 51, 16, 12, 16, 31, 74, 0, 25]]
1
170
#include "bits/stdc++.h" using namespace std; typedef long long ll; int main() { ll n, m; cin >> n >> m; ll a; ll all = 0; vector<ll> as = {}; while (cin >> a) { as.push_back(a); all += a; } sort(as.begin(), as.end()); reverse(as.begin(), as.end()); auto cnt = 0; for (auto i = 0; i < m...
#include "bits/stdc++.h" using namespace std; typedef long long ll; int main() { ll n, m; cin >> n >> m; ll a; double all = 0; vector<ll> as = {}; while (cin >> a) { as.push_back(a); all += a; } sort(as.begin(), as.end()); reverse(as.begin(), as.end()); auto cnt = 0; for (auto i = 0; i...
[["-", 0, 30, 0, 14, 8, 9, 0, 43, 39, 78], ["+", 0, 30, 0, 14, 8, 9, 0, 43, 39, 40]]
1
169
#include <bits/stdc++.h> using namespace std; #define ll long long int ll const mod = 1e9 + 7; ll power(ll x, ll y, ll p) { // x^y % p ll res = 1; // Initialize result x = x % p; // Update x if it is more than or equal to p while (y > 0) { if (y & 1) // If y is odd, multiply x...
#include <bits/stdc++.h> using namespace std; #define ll long long int ll const mod = 1e9 + 7; ll power(ll x, ll y, ll p) { // x^y % p ll res = 1; // Initialize result x = x % p; // Update x if it is more than or equal to p while (y > 0) { if (y & 1) // If y is odd, multiply x...
[["-", 8, 9, 0, 57, 15, 339, 51, 16, 17, 47], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 17, 20]]
1
249
#include <iostream> 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 canChoose = 0; for (int i = 0; i < n; i++) { if ((float)a[i] >= sum / (4.0 * m)) { canChoose++; } } if (canChoose...
#include <iostream> 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 canChoose = 0; for (int i = 0; i < n; i++) { if ((float)a[i] >= sum / (4.0 * m)) { canChoose++; } } if (canChoose...
[["-", 8, 9, 0, 57, 15, 339, 51, 16, 12, 13], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 12, 22]]
1
138
n,m=map(int,input().split()) ans=0 lis=list(map(int,input().split())) for num in lis: if num*4*m>=n: ans+=1 if ans >=m: print("Yes") else:print("No")
n,m=map(int,input().split()) ans=0 lis=list(map(int,input().split())) for num in lis: if num*4*m>=sum(lis): ans+=1 if ans >=m: print("Yes") else:print("No")
[["-", 0, 7, 8, 196, 0, 57, 15, 666, 0, 22], ["+", 8, 196, 0, 57, 15, 666, 0, 652, 63, 22], ["+", 0, 57, 15, 666, 0, 652, 3, 4, 0, 24], ["+", 0, 57, 15, 666, 0, 652, 3, 4, 0, 22], ["+", 0, 57, 15, 666, 0, 652, 3, 4, 0, 25]]
5
72
#include <bits/stdc++.h> using namespace std; int main() { int N, M; cin >> N >> M; int a[N]; double sum = 0; int cnt = 0; for (int i = 0; i < N; i++) { cin >> a[i]; sum = sum + a[i]; } for (int i = 0; i < N; i++) { if (a[i] > sum / (4 * M)) { cnt++; } } if (cnt >= M) { cou...
#include <bits/stdc++.h> using namespace std; int main() { int N, M; cin >> N >> M; int a[N]; double sum = 0; int cnt = 0; for (int i = 0; i < N; i++) { cin >> a[i]; sum = sum + a[i]; } for (int i = 0; i < N; i++) { if (a[i] >= sum / (4 * M)) { cnt++; } } if (cnt >= M) { co...
[["-", 8, 9, 0, 57, 15, 339, 51, 16, 17, 47], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 17, 20]]
1
137
#include <algorithm> #include <cmath> #include <iostream> #include <list> #include <map> #include <queue> #include <set> #include <stack> #include <string> #include <vector> //#include<bits/stdc++.h> using namespace std; long long MOD = 1000000007LL; #undef INT_MIN #undef INT_MAX #define INT_MIN -2147483648 #define IN...
#include <algorithm> #include <cmath> #include <iostream> #include <list> #include <map> #include <queue> #include <set> #include <stack> #include <string> #include <vector> //#include<bits/stdc++.h> using namespace std; long long MOD = 1000000007LL; #undef INT_MIN #undef INT_MAX #define INT_MIN -2147483648 #define IN...
[["-", 51, 16, 31, 16, 12, 23, 0, 16, 31, 13], ["+", 51, 16, 31, 16, 12, 23, 0, 16, 31, 13]]
1
171
#include <bits/stdc++.h> using namespace std; #define ll long long int #define pb push_back #define endl "\n" #define fast \ ios_base::sync_with_stdio(false); \ cin.tie(NULL); ...
#include <bits/stdc++.h> using namespace std; #define ll long long int #define pb push_back #define endl "\n" #define fast \ ios_base::sync_with_stdio(false); \ cin.tie(NULL); ...
[["-", 0, 14, 8, 9, 0, 1, 0, 16, 31, 22], ["-", 0, 14, 8, 9, 0, 1, 0, 16, 17, 151], ["-", 0, 14, 8, 9, 0, 1, 0, 16, 12, 22], ["-", 0, 30, 0, 14, 8, 9, 0, 1, 0, 35]]
1
170
#include <bits/stdc++.h> using namespace std; int main() { long N, M; cin >> N >> M; vector<float> A(N); long wa = 0; for (int i = 0; i < N; i++) { int a; cin >> a; wa += a; A[i] = a; } float ch = wa / (4 * M); int cnt = 0; for (int i = 0; i < N; i++) { if (A[i] >= ch) cnt++...
#include <bits/stdc++.h> using namespace std; int main() { long N, M; cin >> N >> M; vector<float> A(N); long wa = 0; for (int i = 0; i < N; i++) { int a; cin >> a; wa += a; A[i] = a; } float ch = wa / (4.0 * M); int cnt = 0; for (int i = 0; i < N; i++) { if (A[i] >= ch) cnt...
[["-", 49, 50, 51, 16, 12, 23, 0, 16, 31, 13], ["+", 49, 50, 51, 16, 12, 23, 0, 16, 31, 13]]
1
133