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
n, m = [int(i) for i in input().split()] a = [int(i) for i in input().split()] print('No' if sum([i for i in a if sum(a)/(4*m) <= i]) < m else 'Yes')
n, m = [int(i) for i in input().split()] a = [int(i) for i in input().split()] print('No' if len([i for i in a if sum(a)/(4*m) <= i]) < m else 'Yes')
[["-", 3, 4, 0, 41, 0, 666, 0, 652, 63, 22], ["+", 3, 4, 0, 41, 0, 666, 0, 652, 63, 22]]
5
74
#include <bits/stdc++.h> using namespace std; int main() { int N, M; cin >> N; cin >> 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 (sum / (4 * M) <= a[i]) { count++; } } if (count >= M) { ...
#include <bits/stdc++.h> using namespace std; int main() { int N, M; cin >> N; cin >> 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 (sum / (4.0 * M) <= a[i]) { count++; } } if (count >= M) ...
[["-", 51, 16, 31, 16, 12, 23, 0, 16, 31, 13], ["+", 51, 16, 31, 16, 12, 23, 0, 16, 31, 13]]
1
134
#include <bits/stdc++.h> using namespace std; #define ff first #define ss second #define int long long #define pb push_back #define mp make_pair #define pii pair<int, int> #define vi vector<int> #define mii map<int, int> #define pqb priority_queue<int> #define pqs priority_queue<int, vi, greater<int>> #define setbits...
#include <bits/stdc++.h> using namespace std; #define ff first #define ss second #define int long long #define pb push_back #define mp make_pair #define pii pair<int, int> #define vi vector<int> #define mii map<int, int> #define pqb priority_queue<int> #define pqs priority_queue<int, vi, greater<int>> #define setbits...
[["-", 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], ["-", 51, 16, 12, 16, 12, 23, 0, 16, 31, 13], ["+", 51, 16, 12, 16, 12, 23, 0, 16, 31, 13]]
1
210
#include <bits/stdc++.h> using namespace std; int main() { int N, M; cin >> N >> M; vector<int> A(N); int ans = 0; int total = 0; for (auto &x : A) { cin >> x; total += x; } total /= (4 * M); for (auto &x : A) { if (x >= total) { ans += 1; } if (ans >= M) { cout <<...
#include <bits/stdc++.h> using namespace std; int main() { int N, M; cin >> N >> M; vector<int> A(N); int ans = 0; double total = 0; for (auto &x : A) { cin >> x; total += x; } total /= (4 * M); for (auto &x : A) { if ((double)x >= total) { ans += 1; } if (ans >= M) { ...
[["-", 0, 30, 0, 14, 8, 9, 0, 43, 39, 40], ["+", 0, 30, 0, 14, 8, 9, 0, 43, 39, 40], ["+", 0, 57, 15, 339, 51, 16, 31, 74, 0, 24], ["+", 15, 339, 51, 16, 31, 74, 39, 77, 39, 40], ["+", 0, 57, 15, 339, 51, 16, 31, 74, 0, 25]]
1
120
int main() { long n, m, i; long *data, total = 0, count = 0, try; double cutOff; scanf("%ld%ld", &n, &m); data = (long int *)malloc(sizeof(long int) * n); for (i = 0; i < n; i++) { scanf("%ld", &data[i]); total += data[i]; } cutOff = total / (4 * m); for (i = 0; i < n; i++) { if (data[i]...
int main() { long n, m, i; long *data, total = 0, count = 0; double cutOff; scanf("%ld%ld", &n, &m); data = (long int *)malloc(sizeof(long int) * n); for (i = 0; i < n; i++) { scanf("%ld", &data[i]); total += data[i]; } cutOff = total / (4.0 * m); for (i = 0; i < n; i++) { if (data[i] >=...
[["-", 0, 30, 0, 14, 8, 9, 0, 43, 0, 21], ["-", 0, 30, 0, 14, 8, 9, 0, 43, 49, 22], ["-", 0, 11, 12, 16, 12, 23, 0, 16, 31, 13], ["+", 0, 11, 12, 16, 12, 23, 0, 16, 31, 13]]
0
155
#include <bits/stdc++.h> using namespace std; #define ll long long #define loop(i, a, n) for (ll i = a; i < n; ++i) #define revloop(i, a, b) for (ll i = a; i >= b; --i) #define pb push_back #define mp make_pair #define ff first #define ss second void func() { ll n, m, sum = 0; cin >> n >> m; ll a[n]; loop(i, ...
#include <bits/stdc++.h> using namespace std; #define ll long long #define loop(i, a, n) for (ll i = a; i < n; ++i) #define revloop(i, a, b) for (ll i = a; i >= b; --i) #define pb push_back #define mp make_pair #define ff first #define ss second void func() { ll n, m, sum = 0; cin >> n >> m; ll a[n]; loop(i, ...
[["-", 0, 30, 0, 14, 8, 9, 0, 43, 39, 78], ["+", 0, 30, 0, 14, 8, 9, 0, 43, 39, 40], ["-", 49, 50, 51, 16, 12, 23, 0, 16, 31, 13], ["+", 49, 50, 51, 16, 12, 23, 0, 16, 31, 13]]
1
212
#include <bits/stdc++.h> using namespace std; int main() { int n, m; cin >> n >> m; int a[n]; int sum = 0; int ct = 0; for (int i = 0; i < n; i++) { cin >> a[i]; sum += a[i]; } bool b = true; for (int i = 0; i < n; i++) { if (a[i] > sum / (4 * m)) { ct++; } } if (ct >= m) ...
#include <bits/stdc++.h> using namespace std; int main() { int n, m; cin >> n >> m; int a[n]; int sum = 0; int ct = 0; for (int i = 0; i < n; i++) { cin >> a[i]; sum += a[i]; } bool b = true; for (int i = 0; i < n; i++) { if (a[i] >= ((double)sum / (4 * m))) { ct++; } } if (c...
[["-", 8, 9, 0, 57, 15, 339, 51, 16, 17, 47], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 17, 20], ["+", 0, 57, 15, 339, 51, 16, 12, 23, 0, 24], ["+", 51, 16, 12, 23, 0, 16, 31, 74, 0, 24], ["+", 12, 23, 0, 16, 31, 74, 39, 77, 39, 40], ["+", 51, 16, 12, 23, 0, 16, 31, 74, 0, 25], ["+", 51, 16, 12, 23, 0, 16, 12, 23, 0, 25]]
1
134
#include <bits/stdc++.h> using namespace std; int main() { int n, m; cin >> n >> m; int sou = 0; int a[n]; for (int i = 0; i < n; i++) { cin >> a[i]; sou += a[i]; } int kazu = 0; for (int i = 0; i < n; i++) { if (a[i] * 4 * m > sou) kazu++; } if (kazu >= m) cout << "Yes" << end...
#include <bits/stdc++.h> using namespace std; int main() { int n, m; cin >> n >> m; int sou = 0; int a[n]; for (int i = 0; i < n; i++) { cin >> a[i]; sou += a[i]; } int kazu = 0; for (int i = 0; i < n; i++) { if (a[i] * 4 * m >= sou) kazu++; } if (kazu >= m) cout << "Yes" << en...
[["-", 8, 9, 0, 57, 15, 339, 51, 16, 17, 47], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 17, 20]]
1
124
#include <bits/stdc++.h> using namespace std; int main() { ios::sync_with_stdio(0); cin.tie(0); 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]; } sort(v.begin(), v.end(), greater<int>()); (sum <= v[m] * 4 * m) ? (cout << "Ye...
#include <bits/stdc++.h> using namespace std; int main() { ios::sync_with_stdio(0); cin.tie(0); 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]; } sort(v.begin(), v.end(), greater<int>()); (sum <= v[m - 1] * 4 * m) ? (cout <<...
[["+", 31, 16, 31, 69, 341, 342, 0, 16, 17, 33], ["+", 31, 16, 31, 69, 341, 342, 0, 16, 12, 13]]
1
135
#include <bits/stdc++.h> using namespace std; int main() { int N, M; int total = 0; cin >> N >> M; vector<int> A(N); for (int i = 0; i < N; ++i) { cin >> A[i]; total += A[i]; } sort(A.begin(), A.end()); reverse(A.begin(), A.end()); if (A[M - 1] < total / (4 * M)) cout << "No" << endl; e...
#include <bits/stdc++.h> using namespace std; int main() { int N, M; int total = 0; cin >> N >> M; vector<int> A(N); for (int i = 0; i < N; ++i) { cin >> A[i]; total += A[i]; } sort(A.begin(), A.end()); reverse(A.begin(), A.end()); if (A[M - 1] * (4 * M) < total) cout << "No" << endl; e...
[["-", 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
131
#include <stdio.h> int main() { int n, m, a[100], ans = 0; double total = 0; scanf("%d%d", &n, &m); for (int i = 0; i < n; i++) { scanf("%d", &a[i]); total += a[i]; } for (int i = 0; i < n; i++) { if (1.0 / (4 * m) <= (a[i]) / total) ans++; } if (ans >= m) printf("YES"); else ...
#include <stdio.h> int main() { int n, m, a[100], ans = 0; double total = 0; scanf("%d%d", &n, &m); for (int i = 0; i < n; i++) { scanf("%d", &a[i]); total += a[i]; } for (int i = 0; i < n; i++) { if (1.0 / (4 * m) <= a[i] / total) ans++; } if (ans >= m) printf("Yes"); else ...
[["-", 15, 23, 0, 16, 12, 16, 31, 23, 0, 24], ["-", 15, 23, 0, 16, 12, 16, 31, 23, 0, 25], ["-", 64, 1, 0, 2, 3, 4, 0, 5, 0, 6], ["+", 64, 1, 0, 2, 3, 4, 0, 5, 0, 6], ["-", 0, 1, 0, 2, 3, 4, 0, 5, 0, 6], ["+", 0, 1, 0, 2, 3, 4, 0, 5, 0, 6]]
0
138
#include <bits/stdc++.h> using namespace std; int main() { int n, m; cin >> n >> m; vector<int> a; int sum = 0; for (int i = 0; i < n; ++i) { int ai; cin >> ai; sum += ai; a.push_back(ai); } sort(a.begin(), a.end(), greater<int>()); // bool flg = true; for (int j = 0; j <= m - 1; +...
#include <bits/stdc++.h> using namespace std; int main() { int n, m; cin >> n >> m; vector<int> a; double sum = 0; for (int i = 0; i < n; ++i) { int ai; cin >> ai; sum += ai; a.push_back(ai); } sort(a.begin(), a.end(), greater<int>()); // bool flg = true; for (int j = 0; j <= m - 1...
[["-", 0, 30, 0, 14, 8, 9, 0, 43, 39, 40], ["+", 0, 30, 0, 14, 8, 9, 0, 43, 39, 40], ["+", 0, 57, 15, 339, 51, 16, 12, 74, 0, 24], ["+", 15, 339, 51, 16, 12, 74, 39, 77, 39, 40], ["+", 0, 57, 15, 339, 51, 16, 12, 74, 0, 25], ["+", 15, 339, 51, 16, 12, 74, 51, 23, 0, 24], ["+", 12, 74, 51, 23, 0, 16, 12, 23, 0, 25]]
1
154
#include <bits/stdc++.h> using namespace std; typedef long long ll; typedef vector<int> vi; typedef vector<ll> vl; typedef vector<pair<int, int>> vp; #define rep(i, n) for (int i = 0; i < n; ++i) #define REP(i, k, n) for (int i = k; i <= n; ++i) #define REPR(i, k, n) for (int i = k; i >= n; --i) #define INF (int)1e9 ...
#include <bits/stdc++.h> using namespace std; typedef long long ll; typedef vector<int> vi; typedef vector<ll> vl; typedef vector<pair<int, int>> vp; #define rep(i, n) for (int i = 0; i < n; ++i) #define REP(i, k, n) for (int i = k; i <= n; ++i) #define REPR(i, k, n) for (int i = k; i >= n; --i) #define INF (int)1e9 ...
[["+", 15, 339, 51, 16, 12, 16, 12, 2, 63, 40]]
1
282
#include <iostream> using namespace std; typedef long long LL; const int LEN = 1e2 + 10; int A[LEN]; int main() { int N, M, sum = 0, cnt = 0; cin >> N >> M; for (int i = 0; i < N; i++) { cin >> A[i]; sum += A[i]; } int flag = 0; for (int i = 0; i < N; i++) { if (A[i] * 4 * M > sum) { cnt...
#include <iostream> using namespace std; typedef long long LL; const int LEN = 1e2 + 10; int A[LEN]; int main() { int N, M, sum = 0, cnt = 0; cin >> N >> M; for (int i = 0; i < N; i++) { cin >> A[i]; sum += A[i]; } int flag = 0; for (int i = 0; i < N; i++) { if (A[i] * 4 * M >= sum) { cn...
[["-", 8, 9, 0, 57, 15, 339, 51, 16, 17, 47], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 17, 20]]
1
162
#include <bits/stdc++.h> using namespace std; typedef long long ll; int main() { ll n, m; cin >> n >> m; vector<int> arr(n); int sum = 0; for (int i = 0; i < n; i++) { cin >> arr[i]; sum += arr[i]; } set<int> s; ll val = sum / (4.0 * m); for (auto x : arr) { if (x >= val) s.ins...
#include <bits/stdc++.h> using namespace std; typedef long long ll; int main() { ll n, m; cin >> n >> m; vector<int> arr(n); int sum = 0; for (int i = 0; i < n; i++) { cin >> arr[i]; sum += arr[i]; } set<int> s; ll val = ceil(sum / (4.0 * m)); for (auto x : arr) { if (x >= val) ...
[["+", 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, 12, 23, 0, 25]]
1
143
#include <bits/stdc++.h> #include <vector> using namespace std; int main() { int n, m; cin >> n >> m; vector<int> a(n); int sum = 0; // 総得票数を数える for (int i = 0; i < n; i++) { cin >> a[i]; sum += a[i]; } int count = 0; for (int i = 0; i < n; i++) { if (a[i] >= sum / (4 * m)) count++...
#include <bits/stdc++.h> #include <vector> using namespace std; int main() { double n, m; cin >> n >> m; vector<int> a(n); double 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)) ...
[["-", 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
135
n,m=map(int,input().split()) a=list(map(int,input().split())) a=sorted(a,reverse=True) A=[] s=sum(a) c=s/(4*m) for i in range(m): if a[i]>c: A.append(a[i]) print("Yes" if len(A)==m else "No")
n,m=map(int,input().split()) a=list(map(int,input().split())) a=sorted(a,reverse=True) A=[] s=sum(a) c=s/(4*m) for i in range(m): if a[i]>=c: A.append(a[i]) print("Yes" if len(A)==m else "No")
[["-", 0, 7, 8, 196, 0, 57, 15, 666, 667, 47], ["+", 0, 7, 8, 196, 0, 57, 15, 666, 667, 20]]
5
104
#include <bits/stdc++.h> #define ll long long #define ull unsigned long long #define FOR(i, a, b) for (int i = (a); i < (b); ++i) #define REP(a, b) for (int a = 0; a < (b); ++a) #define REP1(i, n) for (int i = 1; i <= (n); ++i) #define debug(x) cerr << #x << ": " << x << '\n' #define all(x) (x).begin(), (x).end() #defi...
#include <bits/stdc++.h> #define ll long long #define ull unsigned long long #define FOR(i, a, b) for (int i = (a); i < (b); ++i) #define REP(a, b) for (int a = 0; a < (b); ++a) #define REP1(i, n) for (int i = 1; i <= (n); ++i) #define debug(x) cerr << #x << ": " << x << '\n' #define all(x) (x).begin(), (x).end() #defi...
[["+", 51, 16, 12, 23, 0, 16, 31, 74, 0, 24], ["+", 12, 23, 0, 16, 31, 74, 39, 77, 39, 40], ["+", 51, 16, 12, 23, 0, 16, 31, 74, 0, 25]]
1
862
n,m = map(int,input().split()) a = list(map(int,input().split())) a.sort(reverse=True) sum_a = sum(a) # print(a) ans = 0 for i in range(n): if a[i] > sum_a/(4*m): ans = i+1 # print(ans) # print(sum_a/(4*m)) if ans >=m: print("Yes") else: print("No")
n,m = map(int,input().split()) a = list(map(int,input().split())) a.sort(reverse=True) sum_a = sum(a) # print(a) ans = 0 for i in range(n): if a[i] >= sum_a/(4*m): ans = i+1 # print(ans) # print(sum_a/(4*m)) if ans >=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
99
#include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < (n); i++) typedef long long ll; using namespace std; int main() { cin.tie(0); ios::sync_with_stdio(false); ll n, m, a = 0, cnt = 0; ; cin >> n >> m; vector<ll> v(n); for (ll i = 0; i < n; i++) { cin >> v.at(i); a += v.at(i); } for...
#include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < (n); i++) typedef long long ll; using namespace std; int main() { cin.tie(0); ios::sync_with_stdio(false); double n, m, a = 0, cnt = 0; ; cin >> n >> m; vector<double> v(n); for (ll i = 0; i < n; i++) { cin >> v.at(i); a += v.at(i); ...
[["-", 0, 30, 0, 14, 8, 9, 0, 43, 39, 78], ["+", 0, 30, 0, 14, 8, 9, 0, 43, 39, 40], ["-", 0, 43, 39, 344, 3, 347, 0, 77, 39, 78], ["+", 0, 43, 39, 344, 3, 347, 0, 77, 39, 40]]
1
170
#include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < (n); i++) #define all(x) x.begin(), x.end() 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 sum = 0; rep(i, n) { cin >> a[i]; sum += a[i]; } sort(a.begin...
#include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < (n); i++) #define all(x) x.begin(), x.end() 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 sum = 0; rep(i, n) { cin >> a[i]; sum += a[i]; } sort(a.begin...
[["-", 64, 1, 0, 16, 31, 16, 12, 5, 0, 6], ["+", 64, 1, 0, 16, 31, 16, 12, 5, 0, 6], ["-", 0, 1, 0, 16, 31, 16, 12, 5, 0, 6], ["+", 0, 1, 0, 16, 31, 16, 12, 5, 0, 6]]
1
192
n, m = gets.chomp.split(" ").map(&:to_i) a = gets.chomp.split(" ").map(&:to_i) k = a.inject(:+) / (4 * m) puts a.select{|x| x >= k}.size >= m ? "Yes" : "No"
n, m = gets.chomp.split(" ").map(&:to_i) a = gets.chomp.split(" ").map(&:to_i) k = a.inject(:+) / (4.0 * m) puts a.select{|x| x >= k}.size >= m ? "Yes" : "No"
[["-", 0, 662, 12, 738, 12, 739, 0, 738, 31, 612], ["+", 0, 662, 12, 738, 12, 739, 0, 738, 31, 531]]
4
76
#include <bits/stdc++.h> using namespace std; //#define rep(i,n) for (int i=0;i<(n);++i) int main() { // srandom((unsigned long)time(NULL)); int n, m; cin >> n >> m; vector<int> a; int sum = 0; for (int i = 0; i < n; i++) { int x; cin >> x; sum += x; a.emplace_back(x); } sort(a.begin(...
#include <bits/stdc++.h> using namespace std; //#define rep(i,n) for (int i=0;i<(n);++i) int main() { // srandom((unsigned long)time(NULL)); int n, m; cin >> n >> m; vector<int> a; int sum = 0; for (int i = 0; i < n; i++) { int x; cin >> x; sum += x; a.emplace_back(x); } sort(a.begin(...
[["+", 51, 16, 12, 16, 31, 16, 31, 74, 0, 24], ["+", 12, 16, 31, 16, 31, 74, 39, 77, 39, 40], ["+", 51, 16, 12, 16, 31, 16, 31, 74, 0, 25]]
1
148
#include <algorithm> #include <cmath> #include <cstdio> #include <cstring> #include <iostream> #include <map> #include <queue> #include <set> #include <stack> #include <unordered_map> #include <unordered_set> #include <vector> #define ll long long #define fi first #define se second #define pb push_back #define me memse...
#include <algorithm> #include <cmath> #include <cstdio> #include <cstring> #include <iostream> #include <map> #include <queue> #include <set> #include <stack> #include <unordered_map> #include <unordered_set> #include <vector> #define ll long long #define fi first #define se second #define pb push_back #define me memse...
[["-", 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
226
N, M = map(int, input().split()) A = sorted(map(int, input().split()), reverse=True) for i in range(M): if A[i] < 1/(4*M): print("No") break elif i == M-1: print("Yes")
N, M = map(int, input().split()) A = sorted(map(int, input().split()), reverse=True) for i in range(M): if A[i] < sum(A)/(4*M): print("No") break elif i == M-1: print("Yes")
[["-", 8, 196, 0, 57, 15, 666, 0, 657, 31, 612], ["+", 0, 57, 15, 666, 0, 657, 31, 652, 63, 22], ["+", 15, 666, 0, 657, 31, 652, 3, 4, 0, 24], ["+", 15, 666, 0, 657, 31, 652, 3, 4, 0, 22], ["+", 15, 666, 0, 657, 31, 652, 3, 4, 0, 25]]
5
79
url = "https://atcoder.jp/contests/abc161/tasks/abc161_b" def main(): n, m = list(map(int, input().split())) n_li = list(map(int, input().split())) n_li = sorted(n_li, reverse=True) all = sum(n_li) for i in range(1, m + 1): if all / (4 * m) >= n_li[i - 1]: print('No') ...
url = "https://atcoder.jp/contests/abc161/tasks/abc161_b" def main(): n, m = list(map(int, input().split())) n_li = list(map(int, input().split())) n_li = sorted(n_li, reverse=True) all_num = sum(n_li) for i in range(1, m + 1): if all_num / (4 * m) > n_li[i - 1]: print('No') ...
[["-", 0, 14, 8, 196, 0, 1, 0, 662, 31, 22], ["+", 0, 14, 8, 196, 0, 1, 0, 662, 31, 22], ["-", 8, 196, 0, 57, 15, 666, 0, 657, 31, 22], ["+", 8, 196, 0, 57, 15, 666, 0, 657, 31, 22], ["-", 0, 7, 8, 196, 0, 57, 15, 666, 667, 20], ["+", 0, 7, 8, 196, 0, 57, 15, 666, 667, 47]]
5
115
n, m = map(int, input().split()) a = list(map(int, input().split())) A = sum(a) l = a.sort(reverse=True) if l[m-1] >= A/(4*m): print("Yes") else: print("No")
n, m = list(map(int, input().split())) a = list(map(int, input().split())) A = sum(a) a.sort(reverse=True) if a[m-1] >= A/(4*m): print("Yes") else: print("No")
[["+", 0, 656, 0, 1, 0, 662, 12, 652, 63, 22], ["+", 0, 1, 0, 662, 12, 652, 3, 4, 0, 24], ["+", 0, 1, 0, 662, 12, 652, 3, 4, 0, 25], ["-", 36, 36, 0, 656, 0, 1, 0, 662, 31, 22], ["-", 36, 36, 0, 656, 0, 1, 0, 662, 0, 32], ["-", 0, 656, 0, 57, 15, 666, 0, 206, 51, 22], ["+", 0, 656, 0, 57, 15, 666, 0, 206, 51, 22]]
5
79
#include <bits/stdc++.h> using namespace std; #define pp pair<int, int> #define rep(i, n) \ ; \ for (int(i) = 0; (i) < (n); (i)++) #define ll long long #define ld long double #defi...
#include <bits/stdc++.h> using namespace std; #define pp pair<int, int> #define rep(i, n) for (int(i) = 0; (i) < (n); (i)++) #define ll long long #define ld long double #define all(a) (a).begin(), (a).end() int main() { int n, m; cin >> n >> m; vector<int> a(n); rep(i, n) cin >> a[i]; ld s = 0; rep(i, n) s...
[["-", 36, 36, 36, 36, 36, 36, 0, 30, 0, 112], ["-", 36, 36, 36, 36, 0, 30, 0, 112, 141, 22], ["-", 36, 36, 0, 30, 0, 112, 141, 22, 54, 158], ["-", 0, 30, 0, 112, 141, 22, 54, 158, 0, 22], ["-", 0, 112, 141, 22, 54, 158, 0, 22, 0, 22], ["-", 141, 22, 54, 158, 0, 22, 0, 22, 51, 59], ["-", 36, 36, 36, 36, 0, 30, 0, 112, ...
1
149
#include <bits/stdc++.h> using namespace std; #define pp pair<int, int> #define rep(i, n) \ ; \ for (int(i) = 0; (i) < (n); (i)++) #define ll long long #define ld long double #defi...
#include <bits/stdc++.h> using namespace std; #define pp pair<int, int> #define rep(i, n) \ ; \ for (int(i) = 0; (i) < (n); (i)++) #define ll long long #define ld long double #defi...
[["-", 0, 30, 0, 14, 8, 9, 0, 43, 39, 78], ["+", 0, 30, 0, 14, 8, 9, 0, 43, 39, 78]]
1
149
#include <algorithm> #include <cmath> #include <cstdio> #include <cstring> #include <iostream> #include <map> #include <queue> #include <utility> #include <vector> #define endl '\n' #define fi first #define se second #define pb push_back #define debug(x) cout << "[debug] " << #x << ": " << x << endl using namespace std...
#include <algorithm> #include <cmath> #include <cstdio> #include <cstring> #include <iostream> #include <map> #include <queue> #include <utility> #include <vector> #define endl '\n' #define fi first #define se second #define pb push_back #define debug(x) cout << "[debug] " << #x << ": " << x << endl using namespace std...
[["+", 15, 339, 51, 16, 31, 16, 31, 16, 17, 48], ["+", 15, 339, 51, 16, 31, 16, 31, 16, 12, 13], ["+", 0, 57, 15, 339, 51, 16, 31, 16, 17, 48], ["+", 0, 57, 15, 339, 51, 16, 31, 16, 12, 22], ["-", 8, 9, 0, 57, 15, 339, 51, 16, 12, 22], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 12, 22]]
1
255
N,M=map(int,input().split()) A=list(map(int,input().split())) x=sum(A) if sum([i if a>=x/4/M else 0 for a in A])>=M: print('Yes') else: print('No')
N,M=map(int,input().split()) A=list(map(int,input().split())) x=sum(A) if sum([1 if a>=x/4/M else 0 for a in A])>=M: print('Yes') else: print('No')
[["-", 0, 652, 3, 4, 0, 658, 8, 41, 0, 22], ["+", 0, 652, 3, 4, 0, 658, 8, 41, 0, 612]]
5
77
#include <bits/stdc++.h> using namespace std; 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 min = sum / (4 * m); sort(a.begin(), a.end(), greater<int>()); if (a[m - 1] < min) cout << "No"; else cout...
#include <bits/stdc++.h> using namespace std; 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 min = (double)sum / (4 * m); sort(a.begin(), a.end(), greater<int>()); if (a[m - 1] < min) cout << "No"; el...
[["-", 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
str1 = input() A = input() list1 = str1.split() list2 = A.split() N = list1[0] M = list1[1] M_count = 0 all = 0 for i in range(len(list2)): all = all + int(list2[i]) #print("all" + str(all)) judge = 1/(4*int(M)) * all #print("judge" + str(judge)) for i in list2: #print("list2 = "+ i ) if int(i) >= jud...
str1 = input() A = input() list1 = str1.split() list2 = A.split() N = list1[0] M = list1[1] M_count = 0 all = 0 for i in range(len(list2)): all = all + int(list2[i]) #print("all" + str(all)) judge = 1/(4*int(M)) * all #print("judge" + str(judge)) for i in list2: #print("list2 = "+ i ) if int(i) >= jud...
[["-", 0, 1, 0, 652, 3, 4, 0, 557, 0, 6], ["+", 0, 1, 0, 652, 3, 4, 0, 557, 0, 6]]
5
122
import java.util.Arrays; import java.util.Scanner; public class Main { public static void main(String[] args) throws Exception { Scanner sc = new Scanner(System.in); int N = sc.nextInt(); int M = sc.nextInt(); int[] A = new int[N]; int sum = 0; for (int i = 0; i < N; i++) { A[i] = sc.ne...
import java.util.Arrays; import java.util.Scanner; public class Main { public static void main(String[] args) throws Exception { Scanner sc = new Scanner(System.in); int N = sc.nextInt(); int M = sc.nextInt(); int[] A = new int[N]; int sum = 0; for (int i = 0; i < N; i++) { A[i] = sc.ne...
[["+", 12, 16, 12, 23, 0, 16, 12, 74, 0, 24], ["+", 12, 23, 0, 16, 12, 74, 39, 511, 0, 512], ["+", 12, 16, 12, 23, 0, 16, 12, 74, 0, 25]]
3
163
n, m = map(int, input().split()) a=[int(x) for x in input().split()] a=sorted(a, reverse=True) c=0 anch=sum(a)//(4*m) for i in a: if i>=anch: c+=1 else: break if c>=m: print("Yes") else: print("No")
n, m = map(int, input().split()) a=[int(x) for x in input().split()] a=sorted(a, reverse=True) c=0 anch=sum(a)/(4*m) for i in a: if i>=anch: c+=1 else: break if c>=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
94
#include <stdio.h> #include <stdlib.h> int compare_int(const void *a, const void *b) { return *(int *)b - *(int *)a; } int main() { int N, M; scanf("%d%d", &N, &M); int A[N]; int sum = 0; for (int i = 0; i < N; i++) { scanf("%d", &A[i]); sum += A[i]; } qsort(A, N, sizeof(int), compare_int); ...
#include <stdio.h> #include <stdlib.h> int compare_int(const void *a, const void *b) { return *(int *)b - *(int *)a; } int main() { int N, M; scanf("%d%d", &N, &M); int A[N]; int sum = 0; for (int i = 0; i < N; i++) { scanf("%d", &A[i]); sum += A[i]; } qsort(A, N, sizeof(int), compare_int); ...
[["+", 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
158
#include <bits/stdc++.h> using namespace std; int main(void) { int N, M; cin >> N >> M; vector<int> A(N); int S = 0; for (int i = 0; i < N; i++) { cin >> A[i]; S += A[i]; } int ans = 0; for (int i = 0; i < N; i++) { if (A[i] >= S / (4 * M)) ans++; } if (ans >= M) cout << "Yes"...
#include <bits/stdc++.h> using namespace std; int main(void) { double N, M; cin >> N >> M; vector<double> A(N); double S = 0; for (int i = 0; i < N; i++) { cin >> A[i]; S += A[i]; } int ans = 0; for (int i = 0; i < N; i++) { if (A[i] >= S / (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, 43, 39, 344, 3, 347, 0, 77, 39, 40], ["+", 0, 43, 39, 344, 3, 347, 0, 77, 39, 40]]
1
130
#include <iostream> #include <vector> using namespace std; int main() { int n, m; cin >> n >> m; vector<int> a(n); double s = 0; for (int i = 0; i < n; i++) { cin >> a[i]; s += a[i]; } int cnt = 0; for (int i = 0; i < n; i++) { if (a[i] > (s / 4 * m)) cnt++; } if (cnt >= m) ...
#include <iostream> #include <vector> using namespace std; int main() { int n, m; cin >> n >> m; vector<double> a(n); double s = 0; for (int i = 0; i < n; i++) { cin >> a[i]; s += a[i]; } int cnt = 0; for (int i = 0; i < n; i++) { if (a[i] >= (s / (4 * m))) cnt++; } if (cnt >=...
[["-", 0, 43, 39, 344, 3, 347, 0, 77, 39, 40], ["+", 0, 43, 39, 344, 3, 347, 0, 77, 39, 40], ["-", 8, 9, 0, 57, 15, 339, 51, 16, 17, 47], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 17, 20], ["+", 51, 16, 12, 23, 0, 16, 12, 23, 0, 24], ["+", 51, 16, 12, 23, 0, 16, 12, 23, 0, 25]]
1
134
k,m = map(int, input().split()) a = list(map(int, input().split())) # リストaの総投票数をsに格納する s = sum(a) # リストaを降順にソートする a.sort(reverse=True) if a[m] >= s*(1/4/m): print('Yes') else: print('No')
k,m = map(int, input().split()) a = list(map(int, input().split())) # リストaの総投票数をsに格納する s = sum(a) # リスト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
79
#include <algorithm> #include <cassert> #include <cmath> #include <cstring> #include <functional> #include <iomanip> #include <iostream> #include <numeric> #include <string> #include <vector> using namespace std; using ll = long long; const int INF = 1 << 30; const int MOD = (int)1e9 + 7; const int MAX_N = (int)1e5 + 5...
#include <algorithm> #include <cassert> #include <cmath> #include <cstring> #include <functional> #include <iomanip> #include <iostream> #include <numeric> #include <string> #include <vector> using namespace std; using ll = long long; const int INF = 1 << 30; const int MOD = (int)1e9 + 7; const int MAX_N = (int)1e5 + 5...
[["-", 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
346
#include <algorithm> // min, max, swap, sort, reverse, lower_bound, upper_bound #include <bitset> // bitset #include <cctype> // isupper, islower, isdigit, toupper, tolower #include <cstdint> // int64_t, int*_t #include <cstdio> // printf #include <deque> // deque #include <iostream> // cout, endl, cin ...
#include <algorithm> // min, max, swap, sort, reverse, lower_bound, upper_bound #include <bitset> // bitset #include <cctype> // isupper, islower, isdigit, toupper, tolower #include <cstdint> // int64_t, int*_t #include <cstdio> // printf #include <deque> // deque #include <iostream> // cout, endl, cin ...
[["+", 0, 1, 0, 11, 12, 16, 31, 74, 0, 24], ["+", 0, 11, 12, 16, 31, 74, 39, 77, 39, 40], ["+", 0, 1, 0, 11, 12, 16, 31, 74, 0, 25]]
1
251
#include <bits/stdc++.h> using namespace std; #define ll long long #define FOR(i, a, b) for (ll i = (a); i < (b); ++i) #define REP(i, n) FOR(i, 0, n) #define PRINT(item) cout << (item) << endl; #define PRINT_VEC(V) \ for (auto v : (V)) ...
#include <bits/stdc++.h> using namespace std; #define ll long long #define FOR(i, a, b) for (ll i = (a); i < (b); ++i) #define REP(i, n) FOR(i, 0, n) #define PRINT(item) cout << (item) << endl; #define PRINT_VEC(V) \ for (auto v : (V)) ...
[["+", 51, 16, 31, 69, 341, 342, 0, 16, 17, 33], ["+", 51, 16, 31, 69, 341, 342, 0, 16, 12, 13]]
1
175
#include <bits/stdc++.h> using namespace std; int main() { int n; int m; int ans = 0; int total = 0; cin >> n >> m; vector<int> a(n); for (int i = 0; i < n; i++) { cin >> a.at(i); total += a.at(i); } for (int i = 0; i < n; i++) { if (a.at(i) >= total / (4 * m)) { ans++; } } ...
#include <bits/stdc++.h> using namespace std; int main() { int n; int m; int ans = 0; int total = 0; cin >> n >> m; vector<int> a(n); for (int i = 0; i < n; i++) { cin >> a.at(i); total += a.at(i); } for (int i = 0; i < n; i++) { if ((double)a.at(i) >= total / (4.0 * m)) { ans++; ...
[["+", 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], ["-", 51, 16, 12, 16, 12, 23, 0, 16, 31, 13], ["+", 51, 16, 12, 16, 12, 23, 0, 16, 31, 13]]
1
145
n,m=input().split() n,m=[int(n),int(m)] a=list(map(int, input().strip().split())) sum=0 for i in range(len(a)): sum=sum+a[i] b=sorted(a) if b[n-m]>sum/4/m: print("Yes") else: print("No")
n,m=input().split() n,m=[int(n),int(m)] a=list(map(int, input().strip().split())) sum=0 for i in range(len(a)): sum=sum+a[i] b=sorted(a) if b[n-m]>=sum/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
#pragma GCC optimize(2) #include <bits/stdc++.h> using namespace std; #define all(x) (x).begin(), (x).end() #define SZ(x) ((int)(x).size()) #define x first #define y second typedef long long LL; typedef pair<int, int> PII; void R(char &c) { c = getchar(); }; void R(string &s) { scanf("%s", s.c_str()); } void R(char s[]...
#pragma GCC optimize(2) #include <bits/stdc++.h> using namespace std; #define all(x) (x).begin(), (x).end() #define SZ(x) ((int)(x).size()) #define x first #define y second typedef long long LL; typedef pair<int, int> PII; void R(char &c) { c = getchar(); }; void R(string &s) { scanf("%s", s.c_str()); } void R(char s[]...
[["-", 8, 9, 0, 57, 15, 339, 51, 16, 17, 85], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 17, 109]]
1
651
#include <bits/stdc++.h> using namespace std; 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]; } sort(a, a + n); int cnt = 0; for (int i = n - 1; i >= 0; i--) { if (sum < (a[i] * 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], sum = 0; for (int i = 0; i < n; i++) { cin >> a[i]; sum += a[i]; } sort(a, a + n); int cnt = 0; for (int i = n - 1; i >= 0; i--) { if (sum <= (a[i] * 4 * m)) cnt++; } if (cnt >= m) co...
[["-", 8, 9, 0, 57, 15, 339, 51, 16, 17, 18], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 17, 19]]
1
132
#include <bits/stdc++.h> using namespace std; int main() { int n, m, num; cin >> n >> m; set<int> s1; set<int>::iterator it; int i; for (i = 1; i <= n; i++) { cin >> num; s1.insert(num); } int sum = 0; for (it = s1.begin(); it != s1.end(); it++) { sum = sum + *it; } // cout<<sum<<endl;...
#include <bits/stdc++.h> using namespace std; int main() { int n, m, num; cin >> n >> m; set<int> s1; set<int>::iterator it; int i; for (i = 1; i <= n; i++) { cin >> num; s1.insert(num); } int sum = 0; for (it = s1.begin(); it != s1.end(); it++) { sum = sum + *it; } // cout<<sum<<endl;...
[["-", 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, 22], ["+", 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, 31, 2, 63, 40], ["+", 3, 4, 0, 16, 31, 2, 3, 4, 0, 25], ["+", 51, 2, 3, 4, 0, 16,...
1
179
#include <bits/stdc++.h> using namespace std; #define ll long long #define vec vector<ll> #define sortv(a) \ ; \ sort(a.begin(), a.end()); #define rev(a) ...
#include <bits/stdc++.h> using namespace std; #define ll long long #define vec vector<ll> #define sortv(a) \ ; \ sort(a.begin(), a.end()); #define rev(a) ...
[["-", 0, 14, 8, 9, 0, 1, 0, 11, 31, 22], ["-", 0, 14, 8, 9, 0, 1, 0, 11, 17, 90], ["+", 0, 30, 0, 14, 8, 9, 0, 57, 0, 121], ["+", 0, 14, 8, 9, 0, 57, 15, 339, 0, 24], ["-", 0, 30, 0, 14, 8, 9, 0, 1, 0, 35], ["-", 0, 30, 0, 14, 8, 9, 0, 57, 0, 121], ["-", 0, 14, 8, 9, 0, 57, 15, 339, 0, 24], ["+", 0, 57, 15, 339, 51, 1...
1
177
/* 飲んだ魔剤で家が建つ。 created at: 2020-04-05 18:13:02 */ #include <bits/stdc++.h> using namespace std; #define all(x) (x).begin(), (x).end() #define rev(x) greater<x>() #define MOD 1000000007 #define INF 1000000000 typedef long long LL; typedef long double LD; bool compare_by_b(pair<int, int> a, pair<int, int> b) ...
/* 飲んだ魔剤で家が建つ。 created at: 2020-04-05 18:13:02 */ #include <bits/stdc++.h> using namespace std; #define all(x) (x).begin(), (x).end() #define rev(x) greater<x>() #define MOD 1000000007 #define INF 1000000000 typedef long long LL; typedef long double LD; bool compare_by_b(pair<int, int> a, pair<int, int> b) ...
[["-", 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, 22], ["+", 49, 50, 51, 16, 31, 74, 39, 77, 39, 40], ["+", 0, 43, 49, 50, 51, 16, 31, 74, 0, 25], ["-", 51, 2, 3, 4, 0, 16, 12, 23, 0, 25]]
1
596
<?php $input = explode(" ",trim(fgets(STDIN))); $items = $input[0]; $target = $input[1]; $list = explode(" ",trim(fgets(STDIN))); $count = 0; $sum = 0; foreach($list as $value) { $sum+=$value; } $limit = $sum / 4 * $target; foreach($list as $value) { if ($value >= $limit) { $count++; } } echo $target <= ...
<?php $input = explode(" ",trim(fgets(STDIN))); $items = $input[0]; $target = $input[1]; $list = explode(" ",trim(fgets(STDIN))); $count = 0; $sum = 0; foreach($list as $value) { $sum+=$value; } $limit = $sum * (1 / (4 * $target)); foreach($list as $value) { if ($value >= $limit) { $count++; } } echo $ta...
[["+", 0, 493, 0, 1, 0, 11, 12, 16, 17, 48], ["+", 0, 1, 0, 11, 12, 16, 12, 23, 0, 24], ["+", 0, 11, 12, 16, 12, 23, 0, 16, 31, 612], ["+", 12, 16, 12, 23, 0, 16, 12, 23, 0, 24], ["+", 12, 16, 12, 23, 0, 16, 12, 23, 0, 25], ["+", 0, 1, 0, 11, 12, 16, 12, 23, 0, 25]]
6
131
#include <algorithm> #include <iostream> #include <list> #include <map> #include <queue> #include <set> #include <stack> #include <string> #include <unordered_map> #include <unordered_set> #include <vector> using namespace std; int main() { int N, M; cin >> N >> M; vector<int> A(N); int total = 0; for (int ...
#include <algorithm> #include <iostream> #include <list> #include <map> #include <queue> #include <set> #include <stack> #include <string> #include <unordered_map> #include <unordered_set> #include <vector> using namespace std; int main() { int N, M; cin >> N >> M; vector<int> A(N); int total = 0; for (int ...
[["+", 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
158
#include <bits/stdc++.h> using namespace std; int main() { int N, M; cin >> N >> M; int total = 0; vector<int> A(N); for (int i = 0; i < N; i++) { cin >> A.at(i); total += A.at(i); } double less = total * 1.0 / 4 * M; int count = 0; for (int i = 0; i < N; i++) { if (A.at(i) >= less)...
#include <bits/stdc++.h> using namespace std; int main() { int N, M; cin >> N >> M; int total = 0; vector<int> A(N); for (int i = 0; i < N; i++) { cin >> A.at(i); total += A.at(i); } double less = total * 1.0 / (4 * M); int count = 0; for (int i = 0; i < N; i++) { if (A.at(i) >= les...
[["+", 0, 43, 49, 50, 51, 16, 12, 23, 0, 24], ["+", 0, 43, 49, 50, 51, 16, 12, 23, 0, 25]]
1
146
N, M = map(int, input().split()) A = list(map(int, input().split())) sumA = sum(A) filteredA = list(filter(lambda x: x < (sumA / (4*M)), A)) if M <= len(filteredA): print('Yes') else: print("No")
N, M = map(int, input().split()) A = list(map(int, input().split())) sumA = sum(A) filteredA = list(filter(lambda x: x >= (sumA / (4*M)), A)) if M <= len(filteredA): print('Yes') else: print("No")
[["-", 0, 652, 3, 4, 0, 670, 8, 666, 667, 18], ["+", 0, 652, 3, 4, 0, 670, 8, 666, 667, 20]]
5
85
import java.util.Arrays; import java.util.Collections; import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner scan = new Scanner(System.in); int n = Integer.parseInt(scan.next()); int m = Integer.parseInt(scan.next()); Integer[] a = new Integer[n]; for ...
import java.util.Arrays; import java.util.Collections; import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner scan = new Scanner(System.in); int n = Integer.parseInt(scan.next()); int m = Integer.parseInt(scan.next()); Integer[] a = new Integer[n]; for (...
[["-", 49, 200, 51, 16, 31, 23, 0, 16, 17, 72], ["+", 49, 200, 51, 16, 31, 23, 0, 16, 17, 33]]
3
216
n, m = map(int, input().split()) l = list(map(int, input().split())) a = sum(l) s = int(a / (4*m)) l.sort(reverse = True) if l[m-1] < s: print('No') else: print('Yes')
n, m = map(int, input().split()) l = list(map(int, input().split())) a = sum(l) s = a / (4*m) l.sort(reverse = True) if l[m-1] < s: print('No') else: print('Yes')
[["-", 0, 656, 0, 1, 0, 662, 12, 652, 63, 22], ["-", 0, 1, 0, 662, 12, 652, 3, 4, 0, 24], ["-", 12, 652, 3, 4, 0, 657, 12, 23, 0, 25]]
5
83
n,m=map(int,input().split()) a=list(map(int,input().split())) cnt=sum(a)//(4*m) tmp=0 for i in range(len(a)): if a[i]>=cnt: tmp+=1 if tmp>=m: print("Yes") else: print("No")
n,m=map(int,input().split()) a=list(map(int,input().split())) cnt=sum(a)/(4*m) tmp=0 for i in range(len(a)): if a[i]>=cnt: tmp+=1 if tmp>=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
89
n, m = map(int, input().split()) l = list(map(int, input().split())) count = 0 for i in range(n): if l[i] >= int(sum(l) * (1 / (4 * m))): count += 1 if count >= m: print("Yes") else: print("No")
n, m = map(int, input().split()) l = list(map(int, input().split())) count = 0 for i in range(n): if l[i] >= sum(l) * (1 / (4 * m)): count += 1 if count >= m: print("Yes") else: print("No")
[["-", 8, 196, 0, 57, 15, 666, 0, 652, 63, 22], ["-", 0, 57, 15, 666, 0, 652, 3, 4, 0, 24], ["-", 0, 657, 12, 23, 0, 657, 12, 23, 0, 25]]
5
90
#include <bits/stdc++.h> using namespace std; int n, m, a[1005], sum; int main() { cin >> n >> m; for (int i = 0; i < n; ++i) { cin >> a[i]; sum += a[i]; } sort(a, a + n); sum = (int)ceil((double)(sum * 1.0 / (4 * m))); if (a[n - 1 - m] >= sum) printf("Yes"); else printf("No"); return...
#include <bits/stdc++.h> using namespace std; int n, m, a[1005], sum; int main() { cin >> n >> m; for (int i = 0; i < n; ++i) { cin >> a[i]; sum += a[i]; } sort(a, a + n); sum = (int)ceil((double)(sum * 1.0 / (4 * m))); if (a[n - m] >= sum) printf("Yes"); else printf("No"); return 0; ...
[["-", 31, 69, 341, 342, 0, 16, 31, 16, 12, 13], ["-", 51, 16, 31, 69, 341, 342, 0, 16, 17, 33]]
1
123
/* Author: Wasi Ur Rahman RMSTU */ #include <bits/stdc++.h> using namespace std; #define fast \ ios::sync_with_stdio(false); \ cin.tie(0) int pos[27] = {0}; int main() { fast; int n, m; ...
/* Author: Wasi Ur Rahman RMSTU */ #include <bits/stdc++.h> using namespace std; #define fast \ ios::sync_with_stdio(false); \ cin.tie(0) int pos[27] = {0}; int main() { fast; int n, m; ...
[["-", 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
160
N,M=map(int,input().split()) A=list(map(int,input().split())) a=sum(A) A.sort() if A[N-M-1]<a/(4*M): print("No") else: print("Yes")
N,M=map(int,input().split()) A=list(map(int,input().split())) a=sum(A) A.sort() if A[N-M]<a/(4*M): print("No") else: print("Yes")
[["-", 0, 57, 15, 666, 0, 206, 206, 657, 17, 33], ["-", 0, 57, 15, 666, 0, 206, 206, 657, 12, 612]]
5
76
n,m = map(int, input().split()) a = list(map(int, input().split())) s = sum(a) min_num = s//(4*m) res = "No" count = 0 for x in a: if x >= min_num: count += 1 if count >= m: res = "Yes" break print(res)
n,m = map(int, input().split()) a = list(map(int, input().split())) s = sum(a) min_num = float(s)/(4*m) res = "No" count = 0 for x in a: if x >= min_num: count += 1 if count >= m: res = "Yes" break print(res)
[["+", 0, 1, 0, 662, 12, 657, 31, 652, 63, 22], ["+", 0, 662, 12, 657, 31, 652, 3, 4, 0, 24], ["-", 0, 656, 0, 1, 0, 662, 12, 657, 17, 676], ["+", 0, 662, 12, 657, 31, 652, 3, 4, 0, 25], ["+", 0, 656, 0, 1, 0, 662, 12, 657, 17, 85]]
5
84
#include <algorithm> #include <functional> #include <numeric> #include <stdio.h> #include <string.h> #include <vector> using namespace std; int main() { int n, m; scanf("%d %d", &n, &m); vector<int> a; int x; for (int i = 0; i < n; ++i) { scanf("%d", &x); a.push_back(x); } sort(a.begin(), a.en...
#include <algorithm> #include <functional> #include <numeric> #include <stdio.h> #include <string.h> #include <vector> using namespace std; int main() { int n, m; scanf("%d %d", &n, &m); vector<int> a; int x; for (int i = 0; i < n; ++i) { scanf("%d", &x); a.push_back(x); } sort(a.begin(), a.en...
[["-", 8, 9, 0, 57, 15, 339, 51, 16, 17, 47], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 17, 18], ["-", 64, 1, 0, 2, 3, 4, 0, 5, 0, 6], ["+", 64, 1, 0, 2, 3, 4, 0, 5, 0, 6], ["-", 0, 1, 0, 2, 3, 4, 0, 5, 0, 6], ["+", 0, 1, 0, 2, 3, 4, 0, 5, 0, 6]]
1
157
#include <bits/stdc++.h> #define rep(i, a) for (int i = (int)0; i < (int)a; ++i) #define rrep(i, a) for (int i = (int)a - 1; i >= 0; --i) #define REP(i, a, b) for (int i = (int)a; i < (int)b; ++i) #define RREP(i, a, b) for (int i = (int)a - 1; i >= b; --i) #define pb push_back #define eb emplace_back #define all(x) x.b...
#include <bits/stdc++.h> #define rep(i, a) for (int i = (int)0; i < (int)a; ++i) #define rrep(i, a) for (int i = (int)a - 1; i >= 0; --i) #define REP(i, a, b) for (int i = (int)a; i < (int)b; ++i) #define RREP(i, a, b) for (int i = (int)a - 1; i >= b; --i) #define pb push_back #define eb emplace_back #define all(x) x.b...
[["-", 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, 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], ["-", 51, 16, 12, 16, 12, 23, 0, 16, 31, 13], ["+", 51, 16, 1...
1
423
#include <bits/stdc++.h> #define fi first #define se second #define REP(i, a, b) for (int i = (a); i <= (b); ++i) #define FOR(i, a, b) for (int i = (a); i < (b); ++i) #define FORD(i, a, b) for (int i = (a); i > (b); --i) #define REPD(i, a, b) for (int i = (a); i >= (b); --i) #define TR(it, a) for (__typeof(a.begin()) i...
#include <bits/stdc++.h> #define fi first #define se second #define REP(i, a, b) for (int i = (a); i <= (b); ++i) #define FOR(i, a, b) for (int i = (a); i < (b); ++i) #define FORD(i, a, b) for (int i = (a); i > (b); --i) #define REPD(i, a, b) for (int i = (a); i >= (b); --i) #define TR(it, a) for (__typeof(a.begin()) i...
[["-", 64, 9, 0, 1, 0, 16, 12, 5, 0, 6], ["+", 64, 9, 0, 1, 0, 16, 12, 5, 0, 6], ["-", 8, 9, 0, 1, 0, 16, 12, 5, 0, 6], ["+", 8, 9, 0, 1, 0, 16, 12, 5, 0, 6]]
1
407
#include <iostream> using namespace std; const int N = 110; int n, m; int a[N]; int main() { cin >> n >> m; int sum = 0; for (int i = 1; i <= n; i++) { cin >> a[i]; sum += a[i]; } int cnt = 0; for (int i = 1; i <= n; i++) { if (a[i] > sum * m / 4) cnt++; } if (cnt >= m) cout ...
#include <iostream> using namespace std; const int N = 110; int n, m; int a[N]; int main() { cin >> n >> m; int sum = 0; for (int i = 1; i <= n; i++) { cin >> a[i]; sum += a[i]; } int cnt = 0; for (int i = 1; i <= n; i++) { if (a[i] * 4 * m >= sum) cnt++; } if (cnt >= m) cout...
[["-", 8, 9, 0, 57, 15, 339, 51, 16, 17, 47], ["-", 15, 339, 51, 16, 12, 16, 31, 16, 31, 22], ["-", 15, 339, 51, 16, 12, 16, 31, 16, 12, 22], ["-", 0, 57, 15, 339, 51, 16, 12, 16, 17, 85], ["+", 0, 57, 15, 339, 51, 16, 31, 16, 17, 48], ["+", 0, 57, 15, 339, 51, 16, 31, 16, 12, 22], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 1...
1
131
import java.util.Arrays; 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(); if (m > n) { System.out.println("No"); sc.close(); return; } int sum = 0; int[...
import java.util.Arrays; 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(); if (m > n) { System.out.println("No"); sc.close(); return; } int sum = 0; int[...
[["-", 0, 7, 502, 503, 49, 200, 51, 16, 17, 33], ["-", 0, 7, 502, 503, 49, 200, 51, 16, 12, 499]]
3
226
// HYSO SERIOUS? WHY SO SERIOUS RIOUS? WHY //SO SERIOUS? WHYSO SERIO ERIOUS? WHY SO SERIOUS ? WHY WHY SO SERIOUS? WHY //SOSERIOUSWHYS OSERIOUS? WHY SO SERIOU SERIOUS ERIOUS? WHY SO //SERIOUS? WHYS WHY SO SERIOUS? WHY SOSERIOUS? WHYSOSERIOUS? WHY SO SER...
// HYSO SERIOUS? WHY SO SERIOUS RIOUS? WHY //SO SERIOUS? WHYSO SERIO ERIOUS? WHY SO SERIOUS ? WHY WHY SO SERIOUS? WHY //SOSERIOUSWHYS OSERIOUS? WHY SO SERIOU SERIOUS ERIOUS? WHY SO //SERIOUS? WHYS WHY SO SERIOUS? WHY SOSERIOUS? WHYSOSERIOUS? WHY SO SER...
[["-", 0, 57, 15, 339, 51, 16, 12, 2, 63, 22], ["+", 0, 57, 15, 339, 51, 16, 12, 2, 63, 22]]
1
329
#include <algorithm> #include <cassert> #include <iostream> #include <map> #include <queue> #include <set> #include <vector> using namespace std; typedef long long ll; template <class T> inline bool chmax(T &a, T b) { if (a < b) { a = b; return true; } return false; } template <class T> inline bool ch...
#include <algorithm> #include <cassert> #include <iostream> #include <map> #include <queue> #include <set> #include <vector> using namespace std; typedef long long ll; template <class T> inline bool chmax(T &a, T b) { if (a < b) { a = b; return true; } return false; } template <class T> inline bool ch...
[["+", 31, 23, 0, 16, 31, 16, 12, 23, 0, 24], ["+", 0, 16, 31, 16, 12, 23, 0, 16, 31, 13], ["+", 0, 16, 31, 16, 12, 23, 0, 16, 17, 48], ["+", 31, 23, 0, 16, 31, 16, 12, 23, 0, 25]]
1
245
N,M = map(int,input().split()) #A = list(input().split()) A =list(map(int, input().split())) B = sorted(A)[::-1] T=0 for i in range(N): T=T+B[i] #print(B) #print(B[M-1]) #print('total',T) #print(B[M-1]) if B[M-1]>T/4/M: print('Yes') else: print('No')
N,M = map(int,input().split()) #A = list(input().split()) A =list(map(int, input().split())) B = sorted(A)[::-1] T=0 for i in range(N): T=T+B[i] #print(B) #print(B[M-1]) #print('total',T) #print(B[M-1]) if B[M-1]>=T/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
97
// problem: "https://atcoder.jp/contests/abc161/tasks/abc161_b" #include <bits/stdc++.h> using namespace std; int main() { int n, m; cin >> n >> m; int i; vector<int> V(n); for (i = 0; i != n; i++) cin >> V[i]; sort(V.begin(), V.end(), greater<int>()); int s = 0; for (i = 0; i != n; i++) s...
// problem: "https://atcoder.jp/contests/abc161/tasks/abc161_b" #include <bits/stdc++.h> using namespace std; int main() { int n, m; cin >> n >> m; int i; vector<int> V(n); for (i = 0; i != n; i++) cin >> V[i]; sort(V.begin(), V.end(), greater<int>()); int s = 0; for (i = 0; i != n; i++) s...
[["-", 51, 16, 12, 16, 12, 23, 0, 16, 31, 13], ["+", 51, 16, 12, 16, 12, 23, 0, 16, 31, 13]]
1
136
#include <bits/stdc++.h> using namespace std; int main() { int N, M; cin >> N >> M; vector<int> product(N); int sum = 0; for (int i = 0; i < N; i++) { int a; cin >> a; product.at(i) = a; sum += a; } int count = 0; for (int i = 0; i < N; i++) { if (product.at(i) >= sum / (4 * M)) { ...
#include <bits/stdc++.h> using namespace std; int main() { int N, M; cin >> N >> M; vector<int> product(N); double sum = 0; for (int i = 0; i < N; i++) { int a; cin >> a; product.at(i) = a; sum += a; } int count = 0; for (int i = 0; i < N; i++) { if (product.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]]
1
153
#include <bits/stdc++.h> using namespace std; #define REP(i, s) for (int i = 0; i < s; ++i) #define ALL(v) (v).begin(), (v).end() #define COUT(x) cout << #x << " = " << (x) << " (L" << __LINE__ << ")" << endl #define EACH(i, s) \ for (__typeof__((s).begin()...
#include <bits/stdc++.h> using namespace std; #define REP(i, s) for (int i = 0; i < s; ++i) #define ALL(v) (v).begin(), (v).end() #define COUT(x) cout << #x << " = " << (x) << " (L" << __LINE__ << ")" << endl #define EACH(i, s) \ for (__typeof__((s).begin()...
[["-", 0, 30, 0, 14, 8, 9, 0, 43, 39, 40], ["+", 0, 30, 0, 14, 8, 9, 0, 43, 39, 40]]
1
576
#include <algorithm> #include <assert.h> #include <bitset> #include <cfloat> #include <complex> #include <deque> #include <fstream> #include <functional> #include <iomanip> #include <iostream> #include <limits.h> #include <list> #include <map> #include <math.h> #include <queue> #include <random> #include <set> #include...
#include <algorithm> #include <assert.h> #include <bitset> #include <cfloat> #include <complex> #include <deque> #include <fstream> #include <functional> #include <iomanip> #include <iostream> #include <limits.h> #include <list> #include <map> #include <math.h> #include <queue> #include <random> #include <set> #include...
[["-", 0, 30, 0, 14, 8, 9, 0, 43, 39, 40], ["+", 0, 30, 0, 14, 8, 9, 0, 43, 39, 40]]
1
204
//#define _CRT_SECURE_NO_WARNINGS #include "bits/stdc++.h" #define rep(i, n) for (ll(i) = 0; (i) < (ll)(n); (i)++) #define all(x) (x).begin(), (x).end() #define MOD 1000000007LL #define INF (1LL << 60LL) #define int long long #define MAX_N (100001) typedef long long ll; using namespace std; signed main() { ios::s...
//#define _CRT_SECURE_NO_WARNINGS #include "bits/stdc++.h" #define rep(i, n) for (ll(i) = 0; (i) < (ll)(n); (i)++) #define all(x) (x).begin(), (x).end() #define MOD 1000000007LL #define INF (1LL << 60LL) #define int long long #define MAX_N (100001) typedef long long ll; using namespace std; signed main() { ios::s...
[["-", 8, 9, 0, 57, 15, 339, 51, 16, 17, 47], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 17, 20]]
1
183
n,m=map(int,input().split()) a=list(map(int,input().split())) ma=sum(a) a.sort() for i in range(m): if(a[i]<ma/(4*m)): print("No") exit() print("Yes")
n,m=map(int,input().split()) a=list(map(int,input().split())) ma=sum(a) a.sort() for i in range(m): if(a[-i-1]<ma/(4*m)): print("No") exit() print("Yes")
[["+", 0, 666, 0, 206, 206, 657, 31, 664, 17, 33], ["+", 15, 23, 0, 666, 0, 206, 206, 657, 17, 33], ["+", 15, 23, 0, 666, 0, 206, 206, 657, 12, 612]]
5
83
def popularVote(): n, m = list(map(int, input().split())) item_votes = list(map(int, input().split())) total = sum(item_votes) selected = [] isSelected = False req = 1 / (4 * m) for item in item_votes: if item / total >= req: selected.append(item) if len(select...
def popularVote(): n, m = list(map(int, input().split())) item_votes = list(map(int, input().split())) total = sum(item_votes) selected = [] isSelected = False req = 1 / (4 * m) for item in item_votes: if item / total >= req: selected.append(item) if len(select...
[["-", 0, 7, 8, 196, 0, 57, 15, 666, 0, 22], ["+", 0, 7, 8, 196, 0, 57, 15, 666, 0, 22]]
5
112
#include <algorithm> #include <climits> #include <complex> #include <iostream> #include <vector> using namespace std; int main() { int n, m; cin >> n >> m; vector<int> a(n); int s = 0; for (int i = 0; i < n; ++i) { cin >> a.at(i); s += a.at(i); } int cnt = 0; for (int j = 0; j < n; ++j) {...
#include <algorithm> #include <climits> #include <complex> #include <iostream> #include <vector> using namespace std; int main() { int n, m; cin >> n >> m; vector<int> a(n); int s = 0; for (int i = 0; i < n; ++i) { cin >> a.at(i); s += a.at(i); } int cnt = 0; for (int j = 0; j < n; ++j) {...
[["+", 15, 339, 51, 16, 12, 16, 31, 16, 31, 13], ["+", 15, 339, 51, 16, 12, 16, 31, 16, 17, 48]]
1
141
import java.util.*; import java.util.stream.Collectors; public class Main { public static void main(String args[]) { Scanner sc = new Scanner(System.in); int N = sc.nextInt(); int M = sc.nextInt(); List<Integer> A = new ArrayList<>(N); for (int i = 0; i < N; i++) { A.add(sc.nextInt()); ...
import java.util.*; import java.util.stream.Collectors; public class Main { public static void main(String args[]) { Scanner sc = new Scanner(System.in); int N = sc.nextInt(); int M = sc.nextInt(); List<Integer> A = new ArrayList<>(N); for (int i = 0; i < N; i++) { A.add(sc.nextInt()); ...
[["-", 500, 492, 3, 4, 0, 218, 8, 16, 17, 47], ["+", 500, 492, 3, 4, 0, 218, 8, 16, 17, 19]]
3
184
#include <bits/stdc++.h> using namespace std; int n, m, a[105]; double c, s; int main() { cin >> n >> m; for (register int i = 1; i <= n; i++) cin >> a[i], s += a[i]; for (register int i = 1; i <= n; i++) if (a[i] >= int(s / (4 * m))) c++; if (c >= m) cout << "Yes\n"; else cout << "No\n"...
#include <bits/stdc++.h> using namespace std; int n, m, a[105]; double c, s; int main() { cin >> n >> m; for (register int i = 1; i <= n; i++) cin >> a[i], s += a[i]; for (register int i = 1; i <= n; i++) if (a[i] >= (s / (4 * m))) c++; if (c >= m) cout << "Yes\n"; else cout << "No\n"; ...
[["-", 8, 57, 15, 339, 51, 16, 12, 2, 63, 40]]
1
122
import numpy as np tmp = input().split(" ") allItem, trendingItem = int(tmp[0]), int(tmp[1]) votes = input().split(" ") votesInt = np.asarray([int(s) for s in votes]) votesTotal = np.sum(votesInt) standard = votesTotal // (4 * trendingItem) + 1 clearList = votesInt[votesInt >= standard] result = 'Yes' if len(clear...
import numpy as np tmp = input().split(" ") allItem, trendingItem = int(tmp[0]), int(tmp[1]) votes = input().split(" ") votesInt = np.asarray([int(s) for s in votes]) votesTotal = np.sum(votesInt) standard = votesTotal / (4 * trendingItem) clearList = votesInt[votesInt >= standard] result = 'Yes' if len(clearList)...
[["-", 0, 1, 0, 662, 12, 657, 31, 657, 17, 676], ["+", 0, 656, 0, 1, 0, 662, 12, 657, 17, 85], ["-", 0, 656, 0, 1, 0, 662, 12, 657, 17, 72], ["-", 0, 656, 0, 1, 0, 662, 12, 657, 12, 612]]
5
111
#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); int sum = 0; rep(i, n) { cin >> a[i]; sum += a[i]; } int count = 0; rep(i, n) { if (a[i] * (4 * m) >= sum) { count++; } } ...
#include <bits/stdc++.h> using namespace std; #define rep(i, n) for (int i = 0; i < (int)(n); i++) int main() { int n, m; cin >> n >> m; vector<int> a(n); int sum = 0; rep(i, n) { cin >> a[i]; sum += a[i]; } int count = 0; rep(i, n) { if (a[i] * (4 * m) >= sum) { count++; } } ...
[["-", 8, 9, 0, 57, 15, 339, 51, 16, 12, 22], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 12, 22]]
1
127
#include <iostream> using namespace std; #define MAX 100 int main() { int i, N, M, a, A[MAX]; int cnt = 0; int total = 0; cin >> N >> M; for (i = 0; i < N; i++) { cin >> A[i]; total += A[i]; } int thres = total / 4.0 / M; for (i = 0; i < N; i++) { if (A[i] >= thres) cnt++; } if...
#include <iostream> using namespace std; #define MAX 100 int main() { int i, N, M, a, A[MAX]; int cnt = 0; int total = 0; cin >> N >> M; for (i = 0; i < N; i++) { cin >> A[i]; total += A[i]; } float thres = total / 4.0 / M; for (i = 0; i < N; i++) { if (A[i] >= thres) cnt++; } ...
[["-", 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> using namespace std; int main() { int N, M, sum = 0; cin >> N >> M; vector<int> A; for (int i = 0; i < N; ++i) { int a; cin >> a; A.push_back(a); sum += a; } double check = ceil(sum / (4 * M)); int cnt = 0; for (int i = 0; i < N; ++i) { if (A[i] >= check...
#include <bits/stdc++.h> using namespace std; int main() { int N, M, sum = 0; cin >> N >> M; vector<int> A; for (int i = 0; i < N; ++i) { int a; cin >> a; A.push_back(a); sum += a; } double check = ceil(sum / (4.0 * M)); int cnt = 0; for (int i = 0; i < N; ++i) { if (A[i] >= che...
[["-", 3, 4, 0, 16, 12, 23, 0, 16, 31, 13], ["+", 3, 4, 0, 16, 12, 23, 0, 16, 31, 13]]
1
141
#include <iostream> using namespace std; 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 selectedProduct = 0; for (int i = 0; i < N; i++) { if (A[i] >= sum / (4 * M)) { selectedProduct++; } } if (selectedPr...
#include <iostream> using namespace std; 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 selectedProduct = 0; for (int i = 0; i < N; i++) { if (A[i] >= (double)sum / (4 * M)) { selectedProduct++; } } if (se...
[["+", 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
134
#include <bits/stdc++.h> using namespace std; using ll = long long; #define REP(i, n) for (int i = 0; i < (n); i++) #define ALL(x) x.begin(), x.end() int main() { cin.tie(0); ios_base::sync_with_stdio(false); int n, m; cin >> n >> m; priority_queue<int> que; int total_vote = 0; REP(i, n) { int ...
#include <bits/stdc++.h> using namespace std; using ll = long long; #define REP(i, n) for (int i = 0; i < (n); i++) #define ALL(x) x.begin(), x.end() int main() { cin.tie(0); ios_base::sync_with_stdio(false); int n, m; cin >> n >> m; priority_queue<int> que; int total_vote = 0; REP(i, n) { int ...
[["+", 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]]
1
154
#include <bits/stdc++.h> using namespace std; using ll = long long; using pii = pair<int, int>; #define ff first #define ss second #define pb push_back #define sz size() const int N = 1e5 + 5; const int MOD = 1e9 + 7; int main() { int n, m; cin >> n >> m; std::vector<int> v(n); int tot = 0; for (int i =...
#include <bits/stdc++.h> using namespace std; using ll = long long; using pii = pair<int, int>; #define ff first #define ss second #define pb push_back #define sz size() const int N = 1e5 + 5; const int MOD = 1e9 + 7; int main() { int n, m; cin >> n >> m; std::vector<int> v(n); int tot = 0; for (int i =...
[["-", 0, 57, 64, 1, 0, 16, 12, 5, 0, 6], ["+", 0, 57, 64, 1, 0, 16, 12, 5, 0, 6]]
1
199
#include <iostream> using namespace std; int main() { int n, m; cin >> n >> m; int data[n]; double sum = 0; for (int i = 0; i < n; i++) { cin >> data[i]; sum += data[i]; } sum /= (4 * m); for (int i = 0; i < n; i++) if (data[i] > sum) m--; cout << ((m > 0) ? "No" : "Yes"); }
#include <iostream> using namespace std; int main() { int n, m; cin >> n >> m; int data[n]; double sum = 0; for (int i = 0; i < n; i++) { cin >> data[i]; sum += data[i]; } sum /= (4 * m); for (int i = 0; i < n; i++) if (data[i] >= sum) m--; cout << ((m > 0) ? "No" : "Yes"); }
[["-", 0, 7, 8, 57, 15, 339, 51, 16, 17, 47], ["+", 0, 7, 8, 57, 15, 339, 51, 16, 17, 20]]
1
116
#include <algorithm> #include <iostream> #include <numeric> #include <vector> using namespace std; int main() { int n, m; cin >> n >> m; vector<int> vec(n); for (auto &v : vec) cin >> v; sort(vec.begin(), vec.end(), greater<int>()); int vsum = accumulate(vec.begin(), vec.end(), 0); bool flag = tr...
#include <algorithm> #include <iostream> #include <numeric> #include <vector> using namespace std; int main() { int n, m; cin >> n >> m; vector<int> vec(n); for (auto &v : vec) cin >> v; sort(vec.begin(), vec.end(), greater<int>()); int vsum = accumulate(vec.begin(), vec.end(), 0); bool flag = tr...
[["-", 15, 339, 51, 16, 12, 16, 31, 16, 12, 13], ["+", 15, 339, 51, 16, 12, 16, 31, 16, 12, 13]]
1
144
#include <stdio.h> int main(void) { int s[100]; int N, M; scanf("%d %d", &N, &M); int i; int all = 0; for (i = 0; i < N; i++) { scanf("%d", &s[i]); all += s[i]; } int buf = 0; for (i = 0; i < N; i++) { if (s[i] * 4 * M > all) buf++; } if (buf > M) { printf("Yes\n"); } else...
#include <stdio.h> int main(void) { int s[100]; int N, M; scanf("%d %d", &N, &M); int i; int all = 0; for (i = 0; i < N; i++) { scanf("%d", &s[i]); all += s[i]; } int buf = 0; for (i = 0; i < N; i++) { if (s[i] * 4 * M >= all) buf++; } if (buf >= M) { printf("Yes\n"); } el...
[["-", 8, 9, 0, 57, 15, 23, 0, 16, 17, 47], ["+", 8, 9, 0, 57, 15, 23, 0, 16, 17, 20]]
0
142
#include <iostream> using namespace std; 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; double lim = (double)sum / (4 * M); for (int i = 0; i < N; i++) { if (lim < a[i]) count++; if (count >= M) { ...
#include <iostream> using namespace std; 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; double lim = (double)sum / (4 * M); for (int i = 0; i < N; i++) { if (lim <= a[i]) count++; if (count >= M) { ...
[["-", 8, 9, 0, 57, 15, 339, 51, 16, 17, 18], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 17, 19]]
1
136
N,M=map(int,input().split()) A = list(map(int, input().split())) select=0 for i in range(N-1): if A[i]>sum(A)*(1/(4*M)): select+=1 def ans(M,select): if M<=select: return 'Yes' else: return 'No' print(ans(M,select))
N,M=map(int,input().split()) A = list(map(int, input().split())) select=0 for i in range(len(A)): if A[i]>=sum(A)*(1/(4*M)): select+=1 def ans(M,select): if M<=select: return 'Yes' else: return 'No' print(ans(M,select))
[["-", 0, 7, 12, 652, 3, 4, 0, 657, 31, 22], ["-", 0, 7, 12, 652, 3, 4, 0, 657, 17, 33], ["-", 0, 7, 12, 652, 3, 4, 0, 657, 12, 612], ["+", 0, 7, 12, 652, 3, 4, 0, 652, 63, 22], ["+", 12, 652, 3, 4, 0, 652, 3, 4, 0, 24], ["+", 12, 652, 3, 4, 0, 652, 3, 4, 0, 22], ["+", 12, 652, 3, 4, 0, 652, 3, 4, 0, 25], ["-", 0, 7, 8...
5
102
#include <bits/stdc++.h> using namespace std; #define IOS \ ios::sync_with_stdio(0); \ cin.tie(0); \ cout.tie(0); #define endl "\...
#include <bits/stdc++.h> using namespace std; #define IOS \ ios::sync_with_stdio(0); \ cin.tie(0); \ cout.tie(0); #define endl "\...
[["+", 8, 9, 0, 1, 0, 11, 12, 2, 63, 22], ["-", 12, 23, 0, 16, 12, 23, 0, 16, 31, 13], ["+", 3, 4, 0, 16, 12, 23, 0, 16, 31, 13], ["+", 0, 16, 12, 23, 0, 16, 12, 74, 0, 24], ["+", 12, 23, 0, 16, 12, 74, 39, 77, 39, 40], ["+", 0, 16, 12, 23, 0, 16, 12, 74, 0, 25]]
1
196
/* --> WHEN IT'S OBVIOUS THAT THE GOAL CANNOT BE REACHED, DON'T ADJUST THE GOALS, ADJUST THE ACTION STEPS. --> THE WAY YOU CONQUER SELF-DOUBT IS BY DOING THINGS THAT MAKE YOU UNCOMFORTABLE. --> IT IS DURING OUR DARKEST MOMENTS WE MUST FOCUS TO SEE LIGHT. */ #include <algorithm> #include <climits> #in...
/* --> WHEN IT'S OBVIOUS THAT THE GOAL CANNOT BE REACHED, DON'T ADJUST THE GOALS, ADJUST THE ACTION STEPS. --> THE WAY YOU CONQUER SELF-DOUBT IS BY DOING THINGS THAT MAKE YOU UNCOMFORTABLE. --> IT IS DURING OUR DARKEST MOMENTS WE MUST FOCUS TO SEE LIGHT. */ #include <algorithm> #include <climits> #in...
[["-", 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, 338, 39, 40], ["+", 0, 30, 0, 14, 8, 9, 0, 338, 39, 40]]
1
409
from sys import stdin N, M = [int(_) for _ in stdin.readline().rstrip().split()] A = sorted([int(_) for _ in stdin.readline().rstrip().split()], reverse=True) if A[M-1] >= sum(A) // (4*M): print('Yes') else: print('No')
from sys import stdin N, M = [int(_) for _ in stdin.readline().rstrip().split()] A = sorted([int(_) for _ in stdin.readline().rstrip().split()], reverse=True) if A[M-1] >= sum(A) / (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
94
import bisect N, M = map(int, input().split()) A = list(map(int, input().split())) A.sort(reverse = True) thr = sum(A) / (4*M) ans = 0 for i in A: if i >= thr: ans+=1 else: break if ans > M: print('Yes') else: print('No')
import bisect N, M = map(int, input().split()) A = list(map(int, input().split())) A.sort(reverse = True) thr = sum(A) / (4*M) ans = 0 for i in A: if i >= thr: ans+=1 else: break if ans >= 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
93
#pragma GCC optimize("O3") #include <algorithm> #include <bitset> #include <cassert> #include <cfloat> #include <climits> #include <cmath> #include <complex> #include <cstdio> #include <cstring> #include <ctime> #include <deque> #include <fstream> #include <functional> #include <iomanip> #include <iostream> #include <l...
#pragma GCC optimize("O3") #include <algorithm> #include <bitset> #include <cassert> #include <cfloat> #include <climits> #include <cmath> #include <complex> #include <cstdio> #include <cstring> #include <ctime> #include <deque> #include <fstream> #include <functional> #include <iomanip> #include <iostream> #include <l...
[["-", 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, 31, 13], ["+", 0, 43, 49, 50, 51, 16, 31, 16, 17, 48]]
1
344
#include <bits/stdc++.h> using namespace std; typedef long long unsigned int ll; #define EPS (1e-7) #define INF (1e9) #define PI (acos(-1)) #define rep(i, start, end) for (int i = start; i < (int)(end); ++i) double a[101]; int main() { int n, m; cin >> n >> m; rep(i, 0, n) cin >> a[i]; int sum = 0; rep(i, 0,...
#include <bits/stdc++.h> using namespace std; typedef long long unsigned int ll; #define EPS (1e-7) #define INF (1e9) #define PI (acos(-1)) #define rep(i, start, end) for (int i = start; i < (int)(end); ++i) double a[101]; int main() { double n, m; cin >> n >> m; rep(i, 0, n) cin >> a[i]; double sum = 0; rep...
[["-", 0, 30, 0, 14, 8, 9, 0, 43, 39, 40], ["+", 0, 30, 0, 14, 8, 9, 0, 43, 39, 40], ["-", 0, 57, 15, 339, 51, 16, 31, 2, 63, 40], ["-", 15, 339, 51, 16, 31, 2, 3, 4, 0, 24], ["-", 15, 339, 51, 16, 31, 2, 3, 4, 0, 25]]
1
158
import numpy as np N, M = map(int, input().split()) As = np.array(input().split(), dtype=int) s = As.sum() th = s / (4 * M) print("Yes") if (As > th).sum() >= M else print("No")
import numpy as np N, M = map(int, input().split()) As = np.array(input().split(), dtype=int) s = As.sum() th = s / (4 * M) print("Yes") if (As >= th).sum() >= M else print("No")
[["-", 0, 652, 63, 319, 500, 23, 0, 666, 667, 47], ["+", 0, 652, 63, 319, 500, 23, 0, 666, 667, 20]]
5
79
#include <iostream> using namespace std; int main() { int A[100], N, M, i, sum = 0, count = 0; cin >> N >> M; for (i = 0; i < N; ++i) { cin >> A[i]; sum += A[i]; } sum /= 4 * M; for (i = 0; i < N; ++i) { if (A[i] >= sum) ++count; } if (count >= M) cout << "Yes\n"; else cout...
#include <iostream> using namespace std; int main() { int A[100], N, M, i, count = 0; float sum = 0; cin >> N >> M; for (i = 0; i < N; ++i) { cin >> A[i]; sum += A[i]; } sum /= (4 * M); for (i = 0; i < N; ++i) { if (A[i] >= sum) ++count; } if (count >= M) cout << "Yes\n"; els...
[["-", 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], ["+", 8, 9, 0, 1, 0, 11, 12, 23, 0, 24], ["+", 8, 9, 0, 1, 0, 11, 12, 23, 0, 25]]
1
124
#include <algorithm> #include <iostream> #include <vector> using namespace std; int main() { int N, M, sum = 0; double k; cin >> N >> M; int ans = N; vector<double> a(N); for (int i = 0; i < N; i++) { cin >> a[i]; sum += a[i]; } for (int i = 0; i < N; i++) { if (4 * M * a[i] >= sum) { ...
#include <algorithm> #include <iostream> #include <vector> using namespace std; int main() { int N, M, sum = 0, k; cin >> N >> M; int ans = 0; vector<int> a(N); for (int i = 0; i < N; i++) { cin >> a[i]; sum += a[i]; } for (int i = 0; i < N; i++) { if (4 * M * a[i] >= sum) { ans++; ...
[["-", 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, 0, 21], ["-", 0, 14, 8, 9, 0, 43, 49, 50, 51, 22], ["+", 0, 14, 8, 9, 0, 43, 49, 50, 51, 13], ["-", 0, 43, 39, 344, 3, 347, 0, 77, 39, 40], ["+", 0, 43, 39, 344, 3, 347, 0, 77, 39, 40]]
1
135