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
import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.util.Arrays; import java.util.StringTokenizer; public class Main { public static void main(String[] args) throws IOException { // TODO Auto-generated method stub BufferedReader bfr = new BufferedReader(n...
import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.util.Arrays; import java.util.StringTokenizer; public class Main { public static void main(String[] args) throws IOException { // TODO Auto-generated method stub BufferedReader bfr = new BufferedReader(n...
[["+", 0, 16, 12, 23, 0, 16, 31, 74, 0, 24], ["+", 12, 23, 0, 16, 31, 74, 39, 511, 0, 512], ["+", 0, 16, 12, 23, 0, 16, 31, 74, 0, 25]]
3
252
#include <bits/stdc++.h> typedef long long ll; using namespace std; int main() { int n, m; cin >> n >> m; double a[105]; int sou = 0; for (int i = 0; i < n; i++) { cin >> a[i]; sou += a[i]; } int ans = 0; double hantei = sou / (4 * m); for (int i = 0; i < n; i++) { if (a[i] >= hantei) { ...
#include <bits/stdc++.h> typedef long long ll; using namespace std; int main() { int n, m; cin >> n >> m; double a[105]; double sou = 0.0; for (int i = 0; i < n; i++) { cin >> a[i]; sou += a[i]; } int ans = 0; double hantei = sou / (4 * m); for (int i = 0; i < n; i++) { if (a[i] >= hantei)...
[["-", 0, 30, 0, 14, 8, 9, 0, 43, 39, 40], ["+", 0, 30, 0, 14, 8, 9, 0, 43, 39, 40], ["-", 0, 14, 8, 9, 0, 43, 49, 50, 51, 13], ["+", 0, 14, 8, 9, 0, 43, 49, 50, 51, 13]]
1
142
#include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < n; i++) #define pb push_back using namespace std; typedef long long ll; int main() { ll n, m; cin >> n >> m; vector<ll> a(n); ll sum = 0; rep(i, n) { cin >> a[i]; sum += a[i]; } sum /= (4 * m); ll count = 0; rep(i, n) { if (a[...
#include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < n; i++) #define pb push_back using namespace std; typedef long long ll; int main() { ll n, m; cin >> n >> m; vector<ll> a(n); ll sum = 0; rep(i, n) { cin >> a[i]; sum += a[i]; } sum--; sum /= (4 * m); ll count = 0; rep(i, n) { ...
[["+", 0, 14, 8, 9, 0, 1, 0, 27, 17, 68], ["+", 0, 30, 0, 14, 8, 9, 0, 1, 0, 35], ["+", 0, 14, 8, 9, 0, 1, 0, 11, 31, 22]]
1
135
n, m = map(int, input().split()) a = list(map(int, input().split())) total = sum(a) c = 0 for i in a: if i >= (total//(4*m)): c += 1 if c >= m: print("Yes") else: print("No")
n, m = map(int, input().split()) a = list(map(int, input().split())) total = sum(a) c = 0 for i in a: if i >= total/(4*m): c += 1 if c >= m: print("Yes") else: print("No")
[["-", 8, 196, 0, 57, 15, 666, 0, 23, 0, 24], ["-", 0, 57, 15, 666, 0, 23, 0, 657, 17, 676], ["+", 8, 196, 0, 57, 15, 666, 0, 657, 17, 85], ["-", 15, 666, 0, 23, 0, 657, 12, 23, 0, 25]]
5
82
N, M = map(int, input().split()) A = list(map(int, input().split())) SUM = sum(A) count = 0 for a in A: if a >= SUM // (4*M): count += 1 if M == count: print("Yes") exit() print("No")
N, M = map(int, input().split()) A = list(map(int, input().split())) SUM = sum(A) count = 0 for a in A: if a >= SUM / (4*M): count += 1 if M == count: print("Yes") exit() print("No")
[["-", 8, 196, 0, 57, 15, 666, 0, 657, 17, 676], ["+", 8, 196, 0, 57, 15, 666, 0, 657, 17, 85]]
5
81
#include <bits/stdc++.h> #define REP(i, n) for (int(i) = 0; (i) < (n); (i)++) #define REPR(i, n) for (int(i) = (n); (i) >= 0; (i)--) #define FOR(i, m, n) for (int(i) = (m); (i) < (n); (i)++) #define INF 1e9 #define ALL(v) v.begin(), v.end() using namespace std; typedef long long ll; bool compare_by_b(pair<int, int> a,...
#include <bits/stdc++.h> #define REP(i, n) for (int(i) = 0; (i) < (n); (i)++) #define REPR(i, n) for (int(i) = (n); (i) >= 0; (i)--) #define FOR(i, m, n) for (int(i) = (m); (i) < (n); (i)++) #define INF 1e9 #define ALL(v) v.begin(), v.end() using namespace std; typedef long long ll; bool compare_by_b(pair<int, int> a,...
[["-", 8, 9, 0, 57, 15, 339, 51, 16, 17, 47], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 17, 20]]
1
218
#include <bits/stdc++.h> using namespace std; int main() { int N, M; cin >> N >> M; vector<int> A(N); int sum = 0; for (int i = 0; i < N; i++) { cin >> A.at(i); sum += A.at(i); } sort(A.begin(), A.end(), greater<int>()); if (4 * M * A.at(M) < sum) { cout << "No" << endl; } else { cout ...
#include <bits/stdc++.h> using namespace std; int main() { int N, M; cin >> N >> M; vector<int> A(N); int sum = 0; for (int i = 0; i < N; i++) { cin >> A.at(i); sum += A.at(i); } sort(A.begin(), A.end(), greater<int>()); if (4 * M * A.at(M - 1) < sum) { cout << "No" << endl; } else { c...
[["+", 31, 16, 12, 2, 3, 4, 0, 16, 17, 33], ["+", 31, 16, 12, 2, 3, 4, 0, 16, 12, 13]]
1
132
#include <bits/stdc++.h> using namespace std; #define rep(i, n) for (int i = 0; i < (int)n; i++) int main(void) { int n; int m; cin >> n >> m; int c = 0; int a[n]; double sum = 0; rep(i, n) { cin >> a[i]; sum += a[i]; } sum /= 4 * m; rep(i, n) if (sum < a[i]) c++; if (c >= m) puts("Ye...
#include <bits/stdc++.h> using namespace std; #define rep(i, n) for (int i = 0; i < (int)n; i++) int main(void) { int n; int m; cin >> n >> m; int c = 0; int a[n]; double sum = 0; rep(i, n) { cin >> a[i]; sum += a[i]; } sum /= 4 * m; rep(i, n) if (sum <= a[i]) c++; if (c >= m) puts("Y...
[["-", 8, 9, 0, 57, 15, 339, 51, 16, 17, 18], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 17, 19]]
1
122
N, M= list(map(int, input().split())) A = list(map(int, input().split())) total = sum(A) if len([i for i in A if i >= int(total/(4*M))])>= M: print("Yes") else: print("No")
N, M= list(map(int, input().split())) A = list(map(int, input().split())) total = sum(A) if len([i for i in A if i >= total/(4*M)])>= M: print("Yes") else: print("No")
[["-", 0, 658, 0, 678, 0, 666, 0, 652, 63, 22], ["-", 0, 678, 0, 666, 0, 652, 3, 4, 0, 24], ["-", 0, 652, 3, 4, 0, 657, 12, 23, 0, 25]]
5
83
#include <bits/stdc++.h> #define REP(i, n) for (int i = 0; i < n; i++) #define REPR(i, n) for (int i = n - 1; i >= 0; i--) #define FOR(i, m, n) for (int i = m; i <= n; i++) #define FORR(i, m, n) for (int i = m; i >= n; i--) #define SORT(v, n) sort(v, v + n); #define VSORT(v) sort(v.begin(), v.end()); #define VSORTR(v)...
#include <bits/stdc++.h> #define REP(i, n) for (int i = 0; i < n; i++) #define REPR(i, n) for (int i = n - 1; i >= 0; i--) #define FOR(i, m, n) for (int i = m; i <= n; i++) #define FORR(i, m, n) for (int i = m; i >= n; i--) #define SORT(v, n) sort(v, v + n); #define VSORT(v) sort(v.begin(), v.end()); #define VSORTR(v)...
[["+", 51, 16, 31, 69, 341, 342, 0, 16, 17, 33], ["+", 51, 16, 31, 69, 341, 342, 0, 16, 12, 13]]
1
241
#include <bits/stdc++.h> using namespace std; #define fast ios_base::sync_with_stdio(false), cin.tie(NULL), cout.tie(NULL) #define mod 1000000007 #define endl "\n" #define all(a) (a).begin(), (a).end() #define lp(i, a, b) for (i = a; i < b; i++) #define lpr(i, a, b) for (i = a; i >= b; i--) #define F first #define S s...
#include <bits/stdc++.h> using namespace std; #define fast ios_base::sync_with_stdio(false), cin.tie(NULL), cout.tie(NULL) #define mod 1000000007 #define endl "\n" #define all(a) (a).begin(), (a).end() #define lp(i, a, b) for (i = a; i < b; i++) #define lpr(i, a, b) for (i = a; i >= b; i--) #define F first #define S s...
[["-", 12, 23, 0, 41, 15, 23, 0, 16, 17, 47], ["+", 12, 23, 0, 41, 15, 23, 0, 16, 17, 20]]
1
234
#include <bits/stdc++.h> using namespace std; #define int long long #define pb push_back #define pii pair<int, int> #define vi vector<int> #define vii vector<pii> #define mi map<int, int> #define mii map<pii, int> #define all(a) (a).begin(), (a).end() #define sz(x) (int)x.size() #define endl "\n" #define repp(i, a, b)...
#include <bits/stdc++.h> using namespace std; #define int long long #define pb push_back #define pii pair<int, int> #define vi vector<int> #define vii vector<pii> #define mi map<int, int> #define mii map<pii, int> #define all(a) (a).begin(), (a).end() #define sz(x) (int)x.size() #define endl "\n" #define repp(i, a, b)...
[["-", 0, 52, 8, 9, 0, 1, 0, 2, 63, 22], ["+", 0, 52, 8, 9, 0, 1, 0, 2, 63, 22]]
1
270
#include "bits/stdc++.h" using namespace std; typedef unsigned long long ll; using Graph = vector<vector<int>>; //グラフ型 void dfs(const Graph &G, int v /*根*/, vector<bool> &seen) { seen[v] = true; // vを訪問済にする for (auto next_v : G[v]) { //訪問済にしたvとつながっている場所を順番に探す if (seen[next_v]) continue; //もし探索済...
#include "bits/stdc++.h" using namespace std; typedef unsigned long long ll; using Graph = vector<vector<int>>; //グラフ型 void dfs(const Graph &G, int v /*根*/, vector<bool> &seen) { seen[v] = true; // vを訪問済にする for (auto next_v : G[v]) { //訪問済にしたvとつながっている場所を順番に探す if (seen[next_v]) continue; //もし探索済...
[["-", 0, 30, 0, 14, 8, 9, 0, 43, 39, 40], ["+", 0, 30, 0, 14, 8, 9, 0, 43, 39, 78], ["+", 0, 57, 15, 339, 51, 16, 12, 2, 63, 40], ["+", 15, 339, 51, 16, 12, 2, 3, 4, 0, 24], ["+", 12, 2, 3, 4, 0, 16, 12, 2, 63, 40], ["+", 3, 4, 0, 16, 12, 2, 3, 4, 0, 25]]
1
445
#include <algorithm> #include <cstdlib> #include <iostream> #include <vector> using namespace std; template <class T> inline bool chmin(T &a, T b) { if (a > b) { a = b; return true; } return false; } template <class T> inline bool chmax(T &a, T b) { if (a < b) { a = b; return true; } return...
#include <algorithm> #include <cstdlib> #include <iostream> #include <vector> using namespace std; template <class T> inline bool chmin(T &a, T b) { if (a > b) { a = b; return true; } return false; } template <class T> inline bool chmax(T &a, T b) { if (a < b) { a = b; return true; } return...
[["-", 0, 30, 0, 14, 8, 9, 0, 43, 39, 40], ["+", 0, 30, 0, 14, 8, 9, 0, 43, 39, 40]]
1
237
#include <algorithm> #include <cmath> #include <iostream> using namespace std; const int MAX = 1e6; const int INF = 2e9; typedef long long ll; int a[101]; int main() { ios_base::sync_with_stdio(false); cin.tie(0); int n, m; cin >> n >> m; int total = 0; for (int i = 0; i < n; ++i) { cin >> a[i]; ...
#include <algorithm> #include <cmath> #include <iostream> using namespace std; const int MAX = 1e6; const int INF = 2e9; typedef long long ll; int a[101]; int main() { ios_base::sync_with_stdio(false); cin.tie(0); int n, m; cin >> n >> m; int total = 0; for (int i = 0; i < n; ++i) { cin >> a[i]; ...
[["-", 8, 9, 0, 43, 49, 50, 51, 2, 63, 22], ["-", 51, 2, 3, 4, 0, 16, 31, 23, 0, 24], ["-", 0, 43, 49, 50, 51, 2, 3, 4, 0, 25]]
1
198
N,M = map(int, input().split()) list = list(map(int, input().split())) num = 0 for i in list: if i >= sum(list)/(4*M): num+=1 print(num) if num >= M: print('Yes') else: print('No')
N,M = map(int, input().split()) list = list(map(int, input().split())) num = 0 for i in list: if i >= sum(list)/(4*M): num+=1 if num >= M: print('Yes') else: print('No')
[["-", 36, 36, 0, 656, 0, 1, 0, 652, 63, 22], ["-", 0, 656, 0, 1, 0, 652, 3, 4, 0, 24], ["-", 0, 656, 0, 1, 0, 652, 3, 4, 0, 22], ["-", 0, 656, 0, 1, 0, 652, 3, 4, 0, 25]]
5
81
#include <algorithm> #include <iostream> #include <string> #include <vector> using namespace std; int main() { int N, M; cin >> N >> M; vector<int> A; int a; int sum = 0; for (int i = 0; i < N; i++) { cin >> a; A.push_back(a); sum += a; } sort(A.begin(), A.end()); int hantei = 1; for (in...
#include <algorithm> #include <iostream> #include <string> #include <vector> using namespace std; int main() { int N, M; cin >> N >> M; vector<int> A; double a; double sum = 0; for (int i = 0; i < N; i++) { cin >> a; A.push_back(a); sum += a; } sort(A.begin(), A.end()); int hantei = 1; f...
[["-", 0, 30, 0, 14, 8, 9, 0, 43, 39, 40], ["+", 0, 30, 0, 14, 8, 9, 0, 43, 39, 40]]
1
169
def main(): mylist = [] for i in range(2): mylist.append(input()) N, M = list(map(int, mylist[0].split())) votes = list(map(int, mylist[1].split())) v_sum = sum(votes) votes.sort(reverse=True) print(votes) flag = True for i in range(M): if votes[i] < v_sum / (4 * M...
def main(): mylist = [] for i in range(2): mylist.append(input()) N, M = list(map(int, mylist[0].split())) votes = list(map(int, mylist[1].split())) v_sum = sum(votes) votes.sort(reverse=True) flag = True for i in range(M): if votes[i] < v_sum / (4 * M): fl...
[["-", 0, 14, 8, 196, 0, 1, 0, 652, 63, 22], ["-", 8, 196, 0, 1, 0, 652, 3, 4, 0, 24], ["-", 8, 196, 0, 1, 0, 652, 3, 4, 0, 22], ["-", 8, 196, 0, 1, 0, 652, 3, 4, 0, 25]]
5
136
N, M = map(int,input().split()) AA = list(map(int,input().split())) AA.sort() SUM = sum(AA) TH = SUM/4/M if AA[-M]>TH: print('Yes') else: print('No')
N, M = map(int,input().split()) AA = list(map(int,input().split())) AA.sort() SUM = sum(AA) TH = SUM/4/M if AA[-M]>=TH: print('Yes') else: print('No')
[["-", 36, 36, 0, 656, 0, 57, 15, 666, 667, 47], ["+", 36, 36, 0, 656, 0, 57, 15, 666, 667, 20]]
5
74
#include <algorithm> #include <iomanip> #include <iostream> #include <math.h> #include <queue> #include <stdlib.h> #include <string> #include <vector> using namespace std; #define PI 3.14159265358979 typedef unsigned long long ll; #define rep(i, n) for (int i = 0; i < n; i++) #include <set> //--------------------------...
#include <algorithm> #include <iomanip> #include <iostream> #include <math.h> #include <queue> #include <stdlib.h> #include <string> #include <vector> using namespace std; #define PI 3.14159265358979 typedef unsigned long long ll; #define rep(i, n) for (int i = 0; i < n; i++) #include <set> //--------------------------...
[["+", 51, 16, 31, 69, 341, 342, 0, 16, 17, 33], ["+", 51, 16, 31, 69, 341, 342, 0, 16, 12, 13]]
1
156
#include <algorithm> #include <bitset> #include <cmath> #include <iostream> #include <list> #include <map> #include <math.h> #include <numeric> #include <queue> #include <set> #include <stack> #include <stdio.h> #include <string> #include <tuple> #include <vector> // ceil(a/b) (a + (b - 1))/ b using namespace std; #d...
#include <algorithm> #include <bitset> #include <cmath> #include <iostream> #include <list> #include <map> #include <math.h> #include <numeric> #include <queue> #include <set> #include <stack> #include <stdio.h> #include <string> #include <tuple> #include <vector> // ceil(a/b) (a + (b - 1))/ b using namespace std; #d...
[["-", 0, 30, 0, 14, 8, 9, 0, 43, 39, 40], ["+", 0, 30, 0, 14, 8, 9, 0, 43, 39, 40]]
1
268
n,m=map(int,input().split()) a=list(map(int, input().split())) num=sum(a) tmp=float(num)/float(4.0*m) count=0 for i in range(n): if a[i]>=tmp: count+=1 if count==m: print("Yes") else: print("No")
n,m=map(int,input().split()) a=list(map(int, input().split())) num=sum(a) tmp=float(num)/float(4.0*m) count=0 for i in range(n): if a[i]>=tmp: count+=1 if count>=m: print("Yes") else: print("No")
[["-", 36, 36, 0, 656, 0, 57, 15, 666, 667, 60], ["+", 36, 36, 0, 656, 0, 57, 15, 666, 667, 20]]
5
93
# https://atcoder.jp/contests/abc161/tasks/abc161_b N, M = map(int, input().split()) A = list(map(int, input().split())) total = sum(A) limit = total / (4 * M) count = 0 for a in A: count += (a > limit) if count >= M: print("Yes") else: print("No")
# https://atcoder.jp/contests/abc161/tasks/abc161_b N, M = map(int, input().split()) A = list(map(int, input().split())) total = sum(A) limit = total / (4 * M) count = 0 for a in A: count += (a >= limit) if count >= M: print("Yes") else: print("No")
[["-", 0, 1, 0, 677, 12, 23, 0, 666, 667, 47], ["+", 0, 1, 0, 677, 12, 23, 0, 666, 667, 20]]
5
83
M, N = map(int, input().split()) A = list(map(int, input().split())) A.sort(reverse=True) print("Yes" if A[M-1] * 4 * M >= sum(A) else "No")
N, M = map(int, input().split()) A = list(map(int, input().split())) A.sort(reverse=True) print("Yes" if A[M-1] * 4 * M >= sum(A) else "No")
[["-", 0, 656, 0, 1, 0, 662, 31, 684, 0, 22], ["-", 0, 656, 0, 1, 0, 662, 31, 684, 0, 21], ["+", 0, 656, 0, 1, 0, 662, 31, 684, 0, 21], ["+", 0, 656, 0, 1, 0, 662, 31, 684, 0, 22]]
5
67
#include <iostream> #include <vector> using namespace std; int main() { int N, M; cin >> N >> M; vector<int> A(N); int vote = 0; for (auto &&a : A) { cin >> a; vote += a; } int m = 0; for (auto a : A) { if (vote / (4 * M) <= a) { m++; } } cout << (m < M ? "No" : "Yes") << en...
#include <iostream> #include <vector> using namespace std; int main() { int N, M; cin >> N >> M; vector<int> A(N); int vote = 0; for (auto &&a : A) { cin >> a; vote += a; } int m = 0; for (auto a : A) { if ((double)vote / (4 * M) <= a) { m++; } } cout << (m < M ? "No" : "Yes...
[["+", 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
106
#include <algorithm> #include <bitset> #include <cassert> #include <cctype> #include <climits> #include <cmath> #include <cstdio> #include <cstdlib> #include <cstring> #include <ctime> #include <deque> #include <functional> #include <iostream> #include <list> #include <map> #include <numeric> #include <queue> #include ...
#include <algorithm> #include <bitset> #include <cassert> #include <cctype> #include <climits> #include <cmath> #include <cstdio> #include <cstdlib> #include <cstring> #include <ctime> #include <deque> #include <functional> #include <iostream> #include <list> #include <map> #include <numeric> #include <queue> #include ...
[["-", 12, 16, 12, 16, 12, 23, 0, 16, 31, 13], ["+", 12, 16, 12, 16, 12, 23, 0, 16, 31, 13]]
1
267
#include <algorithm> #include <iostream> using namespace std; int main() { int n, m, sum = 0; int a[110]; cin >> n >> m; for (int i = 0; i < n; i++) { cin >> a[i]; } sort(a, a + n, greater<int>()); for (int i = 0; i < n; i++) { sum += a[i]; } if (a[m] * 4 * m < sum) cout << "No" << endl; ...
#include <algorithm> #include <iostream> using namespace std; int main() { int n, m, sum = 0; int a[110]; cin >> n >> m; for (int i = 0; i < n; i++) { cin >> a[i]; } sort(a, a + n, greater<int>()); for (int i = 0; i < n; i++) { sum += a[i]; } if (a[m - 1] * 4 * m < sum) cout << "No" << end...
[["+", 31, 16, 31, 69, 341, 342, 0, 16, 17, 33], ["+", 31, 16, 31, 69, 341, 342, 0, 16, 12, 13]]
1
127
#include <bits/stdc++.h> using namespace std; int main() { int n, m; cin >> n >> m; int a[n], total = 0; for (int i = 0; i < n; i++) { cin >> a[i]; total += a[i]; } double votes[n], counter = 0; for (int i = 0; i < n; i++) { votes[i] = (double)a[i] / (double)total; if (votes[i] >= 1.0 / ...
#include <bits/stdc++.h> using namespace std; int main() { int n, m; cin >> n >> m; int a[n], total = 0; for (int i = 0; i < n; i++) { cin >> a[i]; total += a[i]; } double votes[n], counter = 0; for (int i = 0; i < n; i++) { votes[i] = (double)a[i] / (double)total; if (votes[i] >= 1.0 / ...
[["-", 0, 57, 64, 1, 0, 16, 12, 5, 0, 6], ["+", 0, 57, 64, 1, 0, 16, 12, 5, 0, 6], ["-", 75, 76, 0, 1, 0, 16, 12, 5, 0, 6], ["+", 75, 76, 0, 1, 0, 16, 12, 5, 0, 6]]
1
152
#include <bits/stdc++.h> using namespace std; int main() { std::ios_base::sync_with_stdio(false); // cin.tie(0); set<int> p; int n, m, ans = 0; double sum = 0; cin >> n >> m; int a[n]; for (int i = 0; i < n; i++) { cin >> a[i]; sum += a[i]; p.insert(a[i]); } sum = sum / (4 * m); for (a...
#include <bits/stdc++.h> using namespace std; int main() { std::ios_base::sync_with_stdio(false); // cin.tie(0); set<int> p; int n, m, ans = 0; double sum = 0; cin >> n >> m; int a[n]; for (int i = 0; i < n; i++) { cin >> a[i]; sum += a[i]; p.insert(a[i]); } sum = sum / (4 * m); for (a...
[["-", 8, 9, 0, 57, 15, 339, 51, 16, 17, 47], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 17, 20]]
1
149
NM = list(map(int, input().split())) N = NM[0] M = NM[1] vote = list(map(int, input().split())) vote.sort() voteSum = 0 for j in vote: voteSum += j if vote[-M]/voteSum > 1/(4*M): print('Yes') else: print('No')
NM = list(map(int, input().split())) N = NM[0] M = NM[1] vote = list(map(int, input().split())) vote.sort() voteSum = 0 for j in vote: voteSum += j if vote[-M]/voteSum >= 1/(4*M): print('Yes') else: print('No')
[["-", 36, 36, 0, 656, 0, 57, 15, 666, 667, 47], ["+", 36, 36, 0, 656, 0, 57, 15, 666, 667, 20]]
5
93
N, M = map(int, input().split()) l = input().split() l = [int(i) for i in l] l.sort(reverse=True) val = sum(l) deadline = val//(4*M) if l[M-1] >= deadline: print("Yes") else: print("No")
N, M = map(int, input().split()) l = input().split() l = [int(i) for i in l] l.sort(reverse=True) val = sum(l) deadline = val/(4*M) if l[M-1] >= deadline: print("Yes") else: print("No")
[["-", 0, 656, 0, 1, 0, 662, 12, 657, 17, 676], ["+", 0, 656, 0, 1, 0, 662, 12, 657, 17, 85]]
5
84
#include <stdio.h> #include <stdlib.h> int compare(const void *n1, const void *n2) { if (*(int *)n1 < *(int *)n2) return 1; else if (*(int *)n1 > *(int *)n2) return -1; else return 0; } int main(void) { int n, m, sum = 0; int a[100] = {0}; scanf("%d%d", &n, &m); for (int i = 0; i < n; i++) ...
#include <stdio.h> #include <stdlib.h> int compare(const void *n1, const void *n2) { if (*(int *)n1 < *(int *)n2) return 1; else if (*(int *)n1 > *(int *)n2) return -1; else return 0; } int main(void) { int n, m, sum = 0; int a[100] = {0}; scanf("%d%d", &n, &m); for (int i = 0; i < n; i++) ...
[["-", 0, 16, 12, 16, 12, 23, 0, 16, 31, 13], ["+", 0, 16, 12, 16, 12, 23, 0, 16, 31, 13]]
0
189
#include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < (n); ++i) using namespace std; using ll = long long; #define ALL(a) (a).begin(), (a).end() #define PB push_back int main() { int N, M; cin >> N >> M; vector<int> A(1100); int sum = 0; rep(i, N) { cin >> A.at(i); sum += A.at(i); } int...
#include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < (n); ++i) using namespace std; using ll = long long; #define ALL(a) (a).begin(), (a).end() #define PB push_back int main() { int N, M; cin >> N >> M; vector<int> A(1100); int sum = 0; rep(i, N) { cin >> A.at(i); sum += A.at(i); } int...
[["-", 8, 9, 0, 57, 15, 339, 51, 16, 17, 18], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 17, 19]]
1
152
import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner scanner = new Scanner(System.in); int N = scanner.nextInt(); int M = scanner.nextInt(); double sum = 0; int[] votes = new int[N]; for (int i = 0; i < N; i++) { int vote = scanner.nextInt(); ...
import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner scanner = new Scanner(System.in); int N = scanner.nextInt(); int M = scanner.nextInt(); double sum = 0; int[] votes = new int[N]; for (int i = 0; i < N; i++) { int vote = scanner.nextInt(); ...
[["-", 8, 196, 0, 57, 15, 15, 0, 16, 17, 47], ["+", 8, 196, 0, 57, 15, 15, 0, 16, 17, 20]]
3
185
#include <bits/stdc++.h> using namespace std; typedef long long ll; int main() { int m, n, sum = 0; cin >> n >> m; int a[1000]; for (int i = 0; i < n; i++) { cin >> a[i]; sum = sum + a[i]; } int ans = 0; for (int i = 0; i < n; i++) { if (double(a[i]) < double(sum / (4 * m))) { continue...
#include <bits/stdc++.h> using namespace std; typedef long long ll; int main() { int m, n, sum = 0; cin >> n >> m; int a[1000]; for (int i = 0; i < n; i++) { cin >> a[i]; sum = sum + a[i]; } int ans = 0; for (int i = 0; i < n; i++) { if (double(a[i]) < double(double(sum) / double((4 * m)))) ...
[["+", 12, 2, 3, 4, 0, 16, 31, 2, 63, 40], ["+", 3, 4, 0, 16, 31, 2, 3, 4, 0, 24], ["+", 3, 4, 0, 16, 31, 2, 3, 4, 0, 25], ["+", 12, 2, 3, 4, 0, 16, 12, 2, 63, 40], ["+", 3, 4, 0, 16, 12, 2, 3, 4, 0, 24], ["+", 0, 16, 12, 2, 3, 4, 0, 23, 0, 25]]
1
149
#include <bits/stdc++.h> using namespace std; int main() { int n, m; cin >> n >> m; int arr[n]; long long int sum = 0; for (int i = 0; i < n; i++) { cin >> arr[i]; sum += arr[i]; } sort(arr, arr + n, greater<int>()); long long int t = 4 * m; sum = sum / t; if (arr[m - 1] >= sum) cout <<...
#include <bits/stdc++.h> using namespace std; int main() { int n, m; cin >> n >> m; int arr[n]; double sum = 0; for (int i = 0; i < n; i++) { cin >> arr[i]; sum += arr[i]; } sort(arr, arr + n, greater<int>()); long long int t = 4 * m; sum = sum / t; if (arr[m - 1] >= sum) cout << "Yes" ...
[["-", 0, 14, 8, 9, 0, 43, 39, 86, 0, 96], ["-", 0, 14, 8, 9, 0, 43, 39, 86, 39, 40], ["+", 0, 30, 0, 14, 8, 9, 0, 43, 39, 40]]
1
128
# coding : utf-8 N, M = list(map(int, input().split())) arr = list(map(int, input().split())) border = int(sum(arr) / (4*M)) count = 0 for arr_i in arr: if(arr_i >= border): count+=1 if(count >= M): print('Yes') else: print('No')
# coding : utf-8 N, M = list(map(int, input().split())) arr = list(map(int, input().split())) border = sum(arr) / (4*M) count = 0 for arr_i in arr: if(arr_i >= border): count+=1 if(count >= 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], ["-", 12, 652, 3, 4, 0, 657, 12, 23, 0, 25]]
5
91
#include <algorithm> #include <iostream> #include <string> #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 ans = 0; for (int i = 0; i < N; i++) { if (A[i] >= sum / (4 *...
#include <algorithm> #include <iostream> #include <string> #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 ans = 0; for (int i = 0; i < N; i++) { if (A[i] >= sum ...
[["-", 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 = list(map(int, input().split())) count = 0 for i in range(N): bool_over = a[i] > (sum(a)/(4*M)) if(bool_over): count +=1 if(M <= count): print('Yes') else: print('No')
N,M = map(int, input().split()) a = list(map(int, input().split())) count = 0 for i in range(N): bool_over = a[i] >= (sum(a)/(4*M)) if(bool_over): count +=1 if(M <= count): print('Yes') else: print('No')
[["-", 8, 196, 0, 1, 0, 662, 12, 666, 667, 47], ["+", 8, 196, 0, 1, 0, 662, 12, 666, 667, 20]]
5
92
n, m = map(int, input().split()) a = input().split() max = 0 for ai in a: max += int(ai) ss = max / (4 * m) rs = 0 for ai in a: if int(ai) > ss: rs += 1 if rs >= m: print('Yes') else: print('No')
n, m = map(int, input().split()) a = input().split() max = 0 for ai in a: max += int(ai) ss = max / (4 * m) rs = 0 for ai in a: if float(ai) >= ss: rs += 1 if rs >= m: print('Yes') else: print('No')
[["-", 8, 196, 0, 57, 15, 666, 0, 652, 63, 22], ["+", 8, 196, 0, 57, 15, 666, 0, 652, 63, 22], ["-", 0, 7, 8, 196, 0, 57, 15, 666, 667, 47], ["+", 0, 7, 8, 196, 0, 57, 15, 666, 667, 20]]
5
86
n, m = map(int, input().split()) a = list(map(int, input().split())) votes = sum(a) a.sort(reverse=True) ans = 'Yes' for i in range(m): if a[i] < votes // (4 * m): ans = 'No' break print(ans)
n, m = map(int, input().split()) a = list(map(int, input().split())) votes = sum(a) a.sort(reverse=True) ans = 'Yes' for i in range(m): if a[i] < votes / (4 * m): ans = 'No' break print(ans)
[["-", 8, 196, 0, 57, 15, 666, 0, 657, 17, 676], ["+", 8, 196, 0, 57, 15, 666, 0, 657, 17, 85]]
5
84
#include <algorithm> #include <iostream> #include <vector> using namespace std; int main() { int n, m, sum = 0, count = 0; cin >> n >> m; vector<int> a(n); for (int i = 0; i < n; i++) { cin >> a[i]; sum += a[i]; } sum = sum / (4 * m); for (int i = 0; i < n; i++) { if (a[i] >= sum) coun...
#include <algorithm> #include <iostream> #include <vector> using namespace std; int main() { double n, m, sum = 0; int count = 0; cin >> n >> m; vector<double> a(n); for (int i = 0; i < n; i++) { cin >> a[i]; sum += a[i]; } sum = sum / (4 * m); for (int i = 0; i < n; i++) { if (a[i] >= sum...
[["-", 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], ["-", 0, 43, 39, 344, 3, 347, 0, 77, 39, 40], ["+", 0, 43, 39, 344, 3, 347, 0, 77, 39, 40]]
1
139
#include <bits/stdc++.h> #define eps 1e-9 #define MOD 1000000007; #define INV_10 299473306; using namespace std; int main() { ios::sync_with_stdio(0); cin.tie(0); cout.tie(0); 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]; } sort...
#include <bits/stdc++.h> #define eps 1e-9 #define MOD 1000000007; #define INV_10 299473306; using namespace std; int main() { ios::sync_with_stdio(0); cin.tie(0); cout.tie(0); 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]; } sort...
[["-", 8, 9, 0, 57, 15, 339, 51, 16, 17, 47], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 17, 20]]
1
172
#include <bits/stdc++.h> #define rep(X, N) for (ll X = 0; X < (N); X++) #define PI (acos(-1.0)) #define pback push_back #define mpair make_pair #define MODN 1000000007 #define ALL(V) (V).begin(), (V).end() #define INT_MAX_HALF (INT_MAX / 2) #define EPS (1e-10) using namespace std; typedef long long ll; int main() { ...
#include <bits/stdc++.h> #define rep(X, N) for (ll X = 0; X < (N); X++) #define PI (acos(-1.0)) #define pback push_back #define mpair make_pair #define MODN 1000000007 #define ALL(V) (V).begin(), (V).end() #define INT_MAX_HALF (INT_MAX / 2) #define EPS (1e-10) using namespace std; typedef long long ll; int main() { ...
[["-", 0, 57, 15, 339, 51, 16, 31, 16, 17, 72], ["+", 0, 57, 15, 339, 51, 16, 31, 16, 17, 33]]
1
177
N,M = map(int ,input().split()) A = [int(c) for c in input().split()] A.sort() s = sum(A) ans = 0 for c in A: if c>=s//(4*M): ans += 1 if ans>=M: print('Yes') else: print('No')
N,M = map(int ,input().split()) A = [int(c) for c in input().split()] A.sort() s = sum(A) ans = 0 for c in A: if c>=s/(4*M): ans += 1 if ans>=M: print('Yes') else: print('No')
[["-", 8, 196, 0, 57, 15, 666, 0, 657, 17, 676], ["+", 8, 196, 0, 57, 15, 666, 0, 657, 17, 85]]
5
86
#include <algorithm> #include <cassert> #include <cctype> #include <cmath> #include <cstdio> #include <cstdlib> #include <cstring> #include <iostream> #include <map> #include <queue> #include <set> #include <sstream> #include <stack> #include <string> #include <tuple> #include <vector> using namespace std; #define al...
#include <algorithm> #include <cassert> #include <cctype> #include <cmath> #include <cstdio> #include <cstdlib> #include <cstring> #include <iostream> #include <map> #include <queue> #include <set> #include <sstream> #include <stack> #include <string> #include <tuple> #include <vector> using namespace std; #define al...
[["-", 0, 30, 0, 14, 8, 9, 0, 43, 39, 40], ["+", 0, 30, 0, 14, 8, 9, 0, 43, 39, 78], ["-", 0, 43, 39, 344, 3, 347, 0, 77, 39, 40], ["+", 0, 43, 39, 344, 3, 347, 0, 77, 39, 78], ["-", 8, 9, 0, 57, 15, 339, 51, 16, 17, 47], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 17, 20]]
1
224
#include <algorithm> #include <bits/stdc++.h> #include <cmath> #include <cstdio> #include <iostream> #include <map> #include <queue> #include <set> #include <utility> #include <vector> #define fir first #define sec second #define sz(s) (s).size() #define pb push_back #define get(n) scanf("%d", &n); #define gets(s) ...
#include <algorithm> #include <bits/stdc++.h> #include <cmath> #include <cstdio> #include <iostream> #include <map> #include <queue> #include <set> #include <utility> #include <vector> #define fir first #define sec second #define sz(s) (s).size() #define pb push_back #define get(n) scanf("%d", &n); #define gets(s) ...
[["-", 8, 9, 0, 1, 0, 11, 12, 16, 31, 22], ["-", 8, 9, 0, 1, 0, 11, 12, 16, 17, 85], ["+", 8, 9, 0, 1, 0, 11, 12, 2, 63, 22], ["+", 0, 1, 0, 11, 12, 2, 3, 4, 0, 22], ["+", 0, 1, 0, 11, 12, 2, 3, 4, 0, 21]]
1
1,116
#include <cstdio> using namespace std; int arr[1010]; int main() { int n, m; scanf("%d %d", &n, &m); int sum = 0; for (int i = 0; i < n; i++) { scanf("%d", &arr[i]); sum += arr[i]; } int num = 0; for (int i = 0; i < n; i++) { if (arr[i] >= sum / 4 / m) { num++; } } if (num >= m) ...
#include <cstdio> using namespace std; double arr[1010]; int main() { int n; double m; scanf("%d %lf", &n, &m); double sum = 0; for (int i = 0; i < n; i++) { scanf("%lf", &arr[i]); sum += arr[i]; } int num = 0; for (int i = 0; i < n; i++) { if (arr[i] >= sum / 4 / m) { num++; } }...
[["-", 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, 0, 21], ["+", 0, 30, 0, 14, 8, 9, 0, 43, 0, 35], ["+", 0, 30, 0, 14, 8, 9, 0, 43, 39, 40], ["-", 0, 1, 0, 2, 3, 4, 0, 5, 0, 6], ["+", 0, 1, 0, 2, 3, 4, 0, 5, 0, 6], ["-", 0, 30, 0, 14, 8, 9, 0, 43...
1
146
#include <bits/stdc++.h> using namespace std; using lint = long long int; #define FOR(i, begin, end) \ for (int i = (begin), i##_end_ = (end); i < i##_end_; i++) #define IFOR(i, begin, end) \ for (int i = (end)-1,...
#include <bits/stdc++.h> using namespace std; using lint = long long int; #define FOR(i, begin, end) \ for (int i = (begin), i##_end_ = (end); i < i##_end_; i++) #define IFOR(i, begin, end) \ for (int i = (end)-1,...
[["-", 75, 76, 0, 9, 0, 1, 0, 11, 17, 90], ["+", 75, 76, 0, 9, 0, 1, 0, 11, 17, 32], ["+", 0, 1, 0, 11, 12, 16, 31, 16, 31, 22], ["+", 0, 1, 0, 11, 12, 16, 31, 16, 17, 85], ["+", 0, 11, 12, 16, 31, 16, 12, 23, 0, 24], ["+", 0, 11, 12, 16, 31, 16, 12, 23, 0, 25]]
1
206
def main(): x, y = map(int, input().split()) tokuhyou = [int(t) for t in input().split()] th = sum(tokuhyou) / (4 * y) count = 0 for i in tokuhyou: if i > th: count += 1 if count >= y: print('Yes') else: print('No') main()
def main(): x, y = map(int, input().split()) tokuhyou = [int(t) for t in input().split()] th = sum(tokuhyou) / (4 * y) count = 0 for i in tokuhyou: if i >= th: count += 1 if count >= y: print('Yes') else: print('No') main()
[["-", 0, 7, 8, 196, 0, 57, 15, 666, 667, 47], ["+", 0, 7, 8, 196, 0, 57, 15, 666, 667, 20]]
5
89
n, m = map(int, input().split()) a = [int(s) for s in input().split()] thr = sum(a) / (4 * m) cnt = 0 for val in a: if val > thr: cnt += 1 print("Yes" if cnt >= m else "No")
n, m = map(int, input().split()) a = [int(s) for s in input().split()] thr = sum(a) / (4 * m) cnt = 0 for val in a: if val >= thr: cnt += 1 print("Yes" if cnt >= m else "No")
[["-", 0, 7, 8, 196, 0, 57, 15, 666, 667, 47], ["+", 0, 7, 8, 196, 0, 57, 15, 666, 667, 20]]
5
76
n,m = map(int, input().split()) A = list(map(int, input().split())) A.sort(reverse=True) total = sum(A) limit = total //(4*m) cannot = 0 for i in range(m): if A[i]<limit: cannot=1 break if cannot: print('No') else: print('Yes')
n,m = map(int, input().split()) A = list(map(int, input().split())) A.sort(reverse=True) total = sum(A) limit = total/(4*m) cannot = 0 for i in range(m): if A[i]<limit: cannot=1 break if cannot: print('No') else: print('Yes')
[["-", 0, 656, 0, 1, 0, 662, 12, 657, 17, 676], ["+", 0, 656, 0, 1, 0, 662, 12, 657, 17, 85]]
5
96
#include <bits/stdc++.h> // 290 C div 2 // https://codeforces.com/problemset/problem/510/C using namespace std; #define int long long #define faster ios_base::sync_with_stdio(false), cin.tie(NULL), cout.tie(NULL) #define cint \ int t; ...
#include <bits/stdc++.h> // 290 C div 2 // https://codeforces.com/problemset/problem/510/C using namespace std; #define int long long #define faster ios_base::sync_with_stdio(false), cin.tie(NULL), cout.tie(NULL) #define cint \ int t; ...
[["-", 0, 30, 0, 14, 8, 9, 0, 43, 39, 40], ["+", 0, 30, 0, 14, 8, 9, 0, 43, 39, 40], ["-", 8, 9, 0, 57, 15, 339, 51, 16, 17, 47], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 17, 20]]
1
334
#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; int a[n]; int suma = 0; rep(i, n) { cin >> a[i]; suma += a[i]; } sort(a, a + n, greater<>()); string ans = "Yes"; r...
#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; int a[n]; int suma = 0; rep(i, n) { cin >> a[i]; suma += a[i]; } sort(a, a + n, greater<>()); string ans = "Yes"; r...
[["+", 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], ["+", 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
137
#include <bits/stdc++.h> using namespace std; #define ll long long int #define pii pair<int, int> #define pb push_back #define INF INT_MAX #define mod 1000000007ll #define fi first #define se second #define f(i, p, q) for (int i = p; i < q; i++) #define si(a) scanf("%d", &a) #define sii(a, b) scanf("%d %d", &a, &b) #de...
#include <bits/stdc++.h> using namespace std; #define ll long long int #define pii pair<int, int> #define pb push_back #define INF INT_MAX #define mod 1000000007ll #define fi first #define se second #define f(i, p, q) for (int i = p; i < q; i++) #define si(a) scanf("%d", &a) #define sii(a, b) scanf("%d %d", &a, &b) #de...
[["-", 0, 30, 0, 14, 8, 9, 0, 43, 39, 78], ["+", 0, 30, 0, 14, 8, 9, 0, 43, 39, 40], ["-", 0, 9, 0, 57, 15, 339, 51, 16, 17, 47], ["+", 0, 9, 0, 57, 15, 339, 51, 16, 17, 20]]
1
257
/*** 𝕒𝕜𝕤𝕙𝕒𝕪𝕜𝕦𝕞𝕒𝕣𝟡𝟡 ***/ #include <bits/stdc++.h> #include <ext/pb_ds/assoc_container.hpp> using namespace std; using namespace __gnu_pbds; template <typename T> using id_set = tree<T, null_type, less<T>, rb_tree_tag, tree_order_statistics_node_update>; template <typename T> using id_setp = tree<pair...
/*** 𝕒𝕜𝕤𝕙𝕒𝕪𝕜𝕦𝕞𝕒𝕣𝟡𝟡 ***/ #include <bits/stdc++.h> #include <ext/pb_ds/assoc_container.hpp> using namespace std; using namespace __gnu_pbds; template <typename T> using id_set = tree<T, null_type, less<T>, rb_tree_tag, tree_order_statistics_node_update>; template <typename T> using id_setp = tree<pair...
[["-", 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, 78], ["-", 51, 23, 0, 16, 12, 23, 0, 16, 31, 13], ["+", 51, 23, 0, 16, 12, 23, 0, 16, 31, 13]]
1
325
N, M = map(int, input().split()) A = list(map(int, input().split())) to = sum(A) cnt = 0 for a in A: if a>=(to * (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())) to = sum(A) cnt = 0 for a in A: if a>=(to * (1/(4*M))): cnt += 1 if cnt >= M: print('Yes') else: print('No')
[["-", 0, 1, 0, 652, 3, 4, 0, 557, 0, 6], ["+", 0, 1, 0, 652, 3, 4, 0, 557, 0, 6]]
5
86
#include <algorithm> #include <cmath> #include <cstdio> #include <cstring> #include <iostream> #include <map> #include <queue> #include <vector> using namespace std; #define ll long long #define db double #define clr(a, b) memset(a, b, sizeof(a)) const int maxn = 5e5 + 10; const int inf = 0x7ffffff; db x[maxn]; void...
#include <algorithm> #include <cmath> #include <cstdio> #include <cstring> #include <iostream> #include <map> #include <queue> #include <vector> using namespace std; #define ll long long #define db double #define clr(a, b) memset(a, b, sizeof(a)) const int maxn = 5e5 + 10; const int inf = 0x7ffffff; db x[maxn]; void...
[["-", 8, 9, 0, 57, 15, 339, 51, 16, 17, 47], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 17, 20]]
1
208
#include <bits/stdc++.h> using namespace std; int main() { int N, M, S = 0; cin >> N >> M; int A[N]; for (int i = 0; i < N; i++) { cin >> A[i]; S += A[i]; } sort(A, A + N); reverse(A, A + N); if (A[M - 1] >= S / 4) cout << "Yes" << endl; else cout << "No" << endl; }
#include <bits/stdc++.h> using namespace std; int main() { int N, M, S = 0; cin >> N >> M; int A[N]; for (int i = 0; i < N; i++) { cin >> A[i]; S += A[i]; } sort(A, A + N); reverse(A, A + N); if (A[M - 1] * 4 * M >= S) cout << "Yes" << endl; else cout << "No" << endl; }
[["+", 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], ["-", 0, 57, 15, 339, 51, 16, 12, 16, 17, 85], ["-", 0, 57, 15, 339, 51, 16, 12, 16, 12, 13]]
1
111
n, m = map(int, input().split()) a = list(map(int, input().split())) s = sum(a) c = 0 for i in a: if i > (1/(4*m))*s: c += 1 if c >= m: print ("Yes") else: print ("No")
n, m = map(int, input().split()) a = list(map(int, input().split())) s = sum(a) c = 0 for i in a: if i >= (1/(4*m))*s: c += 1 if c >= 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
84
#include <bits/stdc++.h> using namespace std; typedef long long ll; #define rep(i, a, b) for (ll i = (a); i < (b); i++) #define REP(i, n) rep(i, 0, n) void solve() { int n, m; cin >> n >> m; int a[n]; int sum = 0; REP(i, n) { cin >> a[i]; sum += a[i]; } sum = sum / 4 / m; int ans = 0; REP(i, ...
#include <bits/stdc++.h> using namespace std; typedef long long ll; #define rep(i, a, b) for (ll i = (a); i < (b); i++) #define REP(i, n) rep(i, 0, n) void solve() { int n, m; cin >> n >> m; int a[n]; double sum = 0; REP(i, n) { cin >> a[i]; sum += a[i]; } sum = sum / 4 / m; double ans = 0; R...
[["-", 0, 30, 0, 14, 8, 9, 0, 43, 39, 40], ["+", 0, 30, 0, 14, 8, 9, 0, 43, 39, 40]]
1
157
#include <bits/stdc++.h> using namespace std; #define rep(i, n) for (int i = 0; i < n; i++) int main() { int n, m; cin >> n >> m; int sum = 0; int a[n]; int count = 0; rep(i, n) { int A; cin >> A; a[i] = A; sum += A; } rep(i, n) { if (a[i] >= 1. / (4. * sum)) count++; } ...
#include <bits/stdc++.h> using namespace std; #define rep(i, n) for (int i = 0; i < n; i++) int main() { int n, m; cin >> n >> m; int sum = 0; int a[n]; int count = 0; rep(i, n) { int A; cin >> A; a[i] = A; sum += A; } rep(i, n) { if (a[i] >= sum / (4. * m)) count++; } ...
[["-", 0, 57, 15, 339, 51, 16, 12, 16, 31, 13], ["+", 0, 57, 15, 339, 51, 16, 12, 16, 31, 22], ["-", 51, 16, 12, 16, 12, 23, 0, 16, 12, 22], ["+", 51, 16, 12, 16, 12, 23, 0, 16, 12, 22]]
1
129
#include <bits/stdc++.h> using namespace std; #define mem(a, b) memset(a, b, sizeof(a)) #define pii pair<int, int> #define int long long const int inf = 0x3f3f3f3f; const int maxn = 201110; const int M = 1e9 + 7; int n, m, k, ok; int a[maxn]; signed main() { cin >> n >> m; int sum = 0; for (int i = 1; i <= n; i...
#include <bits/stdc++.h> using namespace std; #define mem(a, b) memset(a, b, sizeof(a)) #define pii pair<int, int> #define int long long const int inf = 0x3f3f3f3f; const int maxn = 201110; const int M = 1e9 + 7; int n, m, k, ok; int a[maxn]; signed main() { // freopen("data.in", "r", stdin); cin >> n >> m; int...
[["-", 8, 9, 0, 57, 15, 339, 51, 16, 17, 18], ["-", 0, 57, 15, 339, 51, 16, 12, 16, 31, 22], ["-", 0, 57, 15, 339, 51, 16, 12, 16, 17, 85], ["-", 15, 339, 51, 16, 12, 16, 12, 23, 0, 24], ["+", 15, 339, 51, 16, 31, 16, 31, 16, 17, 48], ["-", 15, 339, 51, 16, 12, 16, 12, 23, 0, 25], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 17...
1
155
#!usr/bin/env python3 import sys import math import string import collections import fractions import random from operator import itemgetter import itertools from collections import deque import copy import heapq import bisect MOD = 10 ** 9 + 7 INF = float('inf') input = lambda: sys.stdin.readline().strip() sys.setre...
#!usr/bin/env python3 import sys import math import string import collections import fractions import random from operator import itemgetter import itertools from collections import deque import copy import heapq import bisect MOD = 10 ** 9 + 7 INF = float('inf') input = lambda: sys.stdin.readline().strip() sys.setre...
[["-", 0, 662, 12, 652, 3, 4, 0, 206, 0, 70], ["-", 12, 652, 3, 4, 0, 206, 206, 663, 0, 612], ["-", 12, 652, 3, 4, 0, 206, 206, 663, 0, 102], ["-", 12, 652, 3, 4, 0, 206, 206, 663, 0, 22], ["-", 0, 662, 12, 652, 3, 4, 0, 206, 0, 73]]
5
147
N, M = map(int, input().split()) A = list(map(int, input().split())) total = sum(A) if sorted(A, reverse=True)[M-1] > total/(4*M): print("Yes") else: print("No")
N, M = map(int, input().split()) A = list(map(int, input().split())) total = sum(A) if sorted(A, reverse=True)[M-1] >= total/(4*M): print("Yes") else: print("No")
[["-", 36, 36, 0, 656, 0, 57, 15, 666, 667, 47], ["+", 36, 36, 0, 656, 0, 57, 15, 666, 667, 20]]
5
76
#include <algorithm> //next_permutation #include <iostream> #include <set> #include <stdio.h> //printf("%.*f\n",*********); #include <string> //char('a'=32+'A') #include <vector> //s.erase(n),vector //to_string,string,substr #include <cmath> //min,max #include <complex> #include <iomanip> #includ...
#include <algorithm> //next_permutation #include <iostream> #include <set> #include <stdio.h> //printf("%.*f\n",*********); #include <string> //char('a'=32+'A') #include <vector> //s.erase(n),vector //to_string,string,substr #include <cmath> //min,max #include <complex> #include <iomanip> #includ...
[["-", 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, 39, 78], ["+", 0, 30, 0, 14, 8, 9, 0, 43, 39, 78]]
1
686
N,M=map(int,input().split()) A=list(map(int,input().split())) S=sum(A) c=0 for i in A: if S<i*4*M: c+=1 print("Yes" if c>=M else "No")
N,M=map(int,input().split()) A=list(map(int,input().split())) S=sum(A) c=0 for i in A: if S<=i*4*M: c+=1 print("Yes" if c>=M else "No")
[["-", 0, 7, 8, 196, 0, 57, 15, 666, 667, 18], ["+", 0, 7, 8, 196, 0, 57, 15, 666, 667, 19]]
5
73
#include <bits/stdc++.h> #include <cstring> #include <limits.h> #include <stdio.h> #include <string> using namespace std; typedef long long ll; typedef long double ld; #define fast \ ios_base::sync_with_stdio(false); ...
#include <bits/stdc++.h> #include <cstring> #include <limits.h> #include <stdio.h> #include <string> using namespace std; typedef long long ll; typedef long double ld; #define fast \ ios_base::sync_with_stdio(false); ...
[["+", 12, 16, 31, 23, 0, 16, 31, 16, 17, 72], ["+", 31, 23, 0, 16, 31, 16, 12, 16, 31, 13], ["+", 31, 23, 0, 16, 31, 16, 12, 16, 17, 48], ["+", 31, 23, 0, 16, 31, 16, 12, 16, 12, 22], ["+", 51, 16, 12, 16, 31, 23, 0, 16, 17, 33], ["+", 51, 16, 12, 16, 31, 23, 0, 16, 12, 13]]
1
655
N, M = gets.chomp.split(' ').map(&:to_i) A = gets.chomp.split(' ').map(&:to_i) sum_a = A.inject(&:+) A.sort! {|x,y| y<=>x} puts A[M - 1] < sum_a / 4 / M ? 'No' : 'Yes'
N, M = gets.chomp.split(' ').map(&:to_i) A = gets.chomp.split(' ').map(&:to_i) sum_a = A.inject(&:+) A.sort! {|x,y| y<=>x} puts A[M - 1] < sum_a / 4.0 / M ? 'No' : 'Yes'
[["-", 0, 754, 15, 738, 12, 738, 31, 738, 12, 612], ["+", 0, 754, 15, 738, 12, 738, 31, 738, 12, 531]]
4
81
#include <algorithm> #include <cmath> #include <cstdio> #include <cstring> #include <deque> #include <fstream> #include <iomanip> #include <iostream> #include <map> #include <queue> #include <set> #include <sstream> #include <stack> #include <string> #include <vector> #define IOS ...
#include <algorithm> #include <cmath> #include <cstdio> #include <cstring> #include <deque> #include <fstream> #include <iomanip> #include <iostream> #include <map> #include <queue> #include <set> #include <sstream> #include <stack> #include <string> #include <vector> #define IOS ...
[["-", 0, 30, 0, 14, 8, 9, 0, 43, 39, 40], ["+", 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, 17, 48]]
1
220
#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 th = total / 4 / m; sort(a.begin(), ...
#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]; } double th = total / (4.0 * m); sort(a.be...
[["-", 0, 30, 0, 14, 8, 9, 0, 43, 39, 40], ["+", 0, 30, 0, 14, 8, 9, 0, 43, 39, 40], ["-", 0, 43, 49, 50, 51, 16, 31, 16, 17, 85], ["-", 0, 43, 49, 50, 51, 16, 31, 16, 12, 13], ["+", 0, 43, 49, 50, 51, 16, 12, 23, 0, 24], ["+", 49, 50, 51, 16, 12, 23, 0, 16, 31, 13], ["+", 49, 50, 51, 16, 12, 23, 0, 16, 17, 48], ["+", ...
1
155
// This program is written by Brian Peng. #pragma GCC optimize("Ofast", "inline", "no-stack-protector") #include <bits/stdc++.h> using namespace std; #define Rd(a) (a = read()) #define Gc(a) (a = getchar()) #define Pc(a) putchar(a) int read() { int x; char c(getchar()); bool k; while (!isdigit(c) && c ^ '-') ...
// This program is written by Brian Peng. #pragma GCC optimize("Ofast", "inline", "no-stack-protector") #include <bits/stdc++.h> using namespace std; #define Rd(a) (a = read()) #define Gc(a) (a = getchar()) #define Pc(a) putchar(a) int read() { int x; char c(getchar()); bool k; while (!isdigit(c) && c ^ '-') ...
[["+", 3, 4, 0, 41, 15, 16, 12, 2, 63, 22], ["+", 0, 41, 15, 16, 12, 2, 3, 4, 0, 24], ["-", 15, 16, 12, 16, 12, 23, 0, 16, 31, 13], ["+", 3, 4, 0, 16, 12, 23, 0, 16, 31, 13], ["+", 12, 2, 3, 4, 0, 16, 12, 23, 0, 25]]
1
382
#include <algorithm> #include <iostream> #include <string> #include <vector> #define rep(i, n) for (int i = 0; i < (n); i++) using namespace std; typedef long long ll; int main() { int n, m; cin >> n >> m; vector<int> a(n); rep(i, n) cin >> a[i]; int sum = 0; rep(i, n) sum += a[i]; sort(a.rbegin(), a.ren...
#include <algorithm> #include <iostream> #include <string> #include <vector> #define rep(i, n) for (int i = 0; i < (n); i++) using namespace std; typedef long long ll; int main() { int n, m; cin >> n >> m; vector<double> a(n); rep(i, n) cin >> a[i]; double sum = 0; rep(i, n) sum += a[i]; sort(a.rbegin(),...
[["-", 0, 43, 39, 344, 3, 347, 0, 77, 39, 40], ["+", 0, 43, 39, 344, 3, 347, 0, 77, 39, 40], ["-", 0, 30, 0, 14, 8, 9, 0, 43, 39, 40], ["+", 0, 30, 0, 14, 8, 9, 0, 43, 39, 40]]
1
136
#include <bits/stdc++.h> using namespace std; int main() { int m, n; cin >> n >> m; vector<int> v(n); int sum = 0; for (int i = 0; i < n; ++i) { cin >> v[i]; sum += v[i]; } int cur = sum / (4 * m); int cnt = 0; for (int i = 0; i < n; ++i) { cnt += v[i] >= cur; } if (cnt >= m) ...
#include <bits/stdc++.h> using namespace std; int main() { int m, n; cin >> n >> m; vector<double> v(n); double sum = 0; for (int i = 0; i < n; ++i) { cin >> v[i]; sum += v[i]; } double cur = sum / (4 * m); int cnt = 0; for (int i = 0; i < n; ++i) { cnt += v[i] >= cur; } if (cn...
[["-", 0, 43, 39, 344, 3, 347, 0, 77, 39, 40], ["+", 0, 43, 39, 344, 3, 347, 0, 77, 39, 40], ["-", 0, 30, 0, 14, 8, 9, 0, 43, 39, 40], ["+", 0, 30, 0, 14, 8, 9, 0, 43, 39, 40]]
1
132
#include <bits/stdc++.h> using namespace std; int main() { int N, M, sum = 0, ans = 0; cin >> N >> M; vector<int> A(N), B(N); for (int i = 0; i < N; i++) { cin >> A.at(i); sum += A.at(i); } for (int i = 0; i < N; i++) { if (A.at(i) >= sum / (4 * M)) { B.at(i) = 1; } else { B.at(...
#include <bits/stdc++.h> using namespace std; int main() { double N, M, sum = 0, ans = 0; cin >> N >> M; vector<double> A(N), B(N); for (int i = 0; i < N; i++) { cin >> A.at(i); sum += A.at(i); } for (int i = 0; i < N; i++) { if (A.at(i) >= sum / (4 * M)) { B.at(i) = 1; } else { ...
[["-", 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
171
#include <bits/stdc++.h> #include <ext/pb_ds/assoc_container.hpp> #include <ext/pb_ds/tree_policy.hpp> #include <ext/pb_ds/trie_policy.hpp> using namespace std; using namespace __gnu_pbds; typedef tree<int, null_type, less<int>, rb_tree_tag, tree_order_statistics_node_update> pbds; typedef trie<string,...
#include <bits/stdc++.h> #include <ext/pb_ds/assoc_container.hpp> #include <ext/pb_ds/tree_policy.hpp> #include <ext/pb_ds/trie_policy.hpp> using namespace std; using namespace __gnu_pbds; typedef tree<int, null_type, less<int>, rb_tree_tag, tree_order_statistics_node_update> pbds; typedef trie<string,...
[["-", 49, 50, 51, 2, 3, 4, 0, 16, 17, 85], ["+", 0, 43, 49, 50, 51, 2, 3, 4, 0, 21]]
1
702
a,b=[int(i) for i in input().split()] arr=[int(i) for i in input().split()] tot=sum(arr) p=(tot/(4*b)) arr.sort() if arr[-b]>p: print('Yes') else: print('No')
a,b=[int(i) for i in input().split()] arr=[int(i) for i in input().split()] tot=sum(arr) p=(tot/(4*b)) arr.sort() if arr[-b]>=p: 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
83
#include <algorithm> #include <cmath> #include <iostream> #include <map> #include <stdio.h> #include <vector> using namespace std; #define int long long #define double long double #define rep(s, i, n) for (int i = s; i < n; i++) #define c(n) cout << n << endl; #define ic(n) ...
#include <algorithm> #include <cmath> #include <iostream> #include <map> #include <stdio.h> #include <vector> using namespace std; #define int long long #define double long double #define rep(s, i, n) for (int i = s; i < n; i++) #define c(n) cout << n << endl; #define ic(n) ...
[["-", 0, 9, 0, 57, 15, 339, 51, 16, 17, 18], ["-", 0, 57, 15, 339, 51, 16, 12, 16, 31, 22], ["-", 0, 57, 15, 339, 51, 16, 12, 16, 17, 85], ["-", 15, 339, 51, 16, 12, 16, 12, 23, 0, 24], ["+", 15, 339, 51, 16, 31, 16, 31, 16, 17, 48], ["-", 15, 339, 51, 16, 12, 16, 12, 23, 0, 25], ["+", 0, 9, 0, 57, 15, 339, 51, 16, 17...
1
957
/*//////////////////////////////////////*/ /*/ NULLCT$ (`・ω・´) <<"Be accept!!" /*/ /*//////////////////////////////////////*/ #include <algorithm> #include <iostream> #include <math.h> #include <queue> #include <stdio.h> #include <string> #include <vector> #define rep(counter, limit) for (int counter = 0; counter < l...
/*//////////////////////////////////////*/ /*/ NULLCT$ (`・ω・´) <<"Be accept!!" /*/ /*//////////////////////////////////////*/ #include <algorithm> #include <iostream> #include <math.h> #include <queue> #include <stdio.h> #include <string> #include <vector> #define rep(counter, limit) for (int counter = 0; counter < l...
[["-", 0, 16, 12, 16, 12, 23, 0, 16, 31, 13], ["+", 0, 16, 12, 16, 12, 23, 0, 16, 31, 13], ["-", 12, 23, 0, 16, 12, 23, 0, 16, 31, 13], ["+", 12, 23, 0, 16, 12, 23, 0, 16, 31, 13]]
1
339
N, M = map(int, input().split()) A=list(map(int,input().split())) count=0 count2=0 flag=False for i in range(N): count+=A[i] for i in range(N): if A[i]>count*1/(4*M) and flag==False: count2+=1 if count2>=M: flag=True break if flag: print("Yes") else: print("No")
N, M = map(int, input().split()) A=list(map(int,input().split())) count=0 count2=0 flag=False for i in range(N): count+=A[i] for i in range(N): if A[i]>=count*1/(4*M) and flag==False: count2+=1 if count2>=M: flag=True break if flag: print("Yes") else: print("No")
[["-", 8, 196, 0, 57, 15, 679, 31, 666, 667, 47], ["+", 8, 196, 0, 57, 15, 679, 31, 666, 667, 20]]
5
113
#include <bits/stdc++.h> #define ll long long #define fast \ cin.tie(0); \ cout.tie(0); #define order ios::sync_with_stdio(0); using namespace std; int t; ll n, m, sm, a[1009]; int main...
#include <bits/stdc++.h> #define ll long long #define fast \ cin.tie(0); \ cout.tie(0); #define order ios::sync_with_stdio(0); using namespace std; int t; ll n, m, sm, a[1009]; int main...
[["+", 64, 1, 0, 11, 12, 16, 31, 16, 31, 13], ["+", 64, 1, 0, 11, 12, 16, 31, 16, 17, 48], ["+", 64, 1, 0, 11, 12, 16, 31, 16, 12, 22], ["+", 0, 57, 64, 1, 0, 11, 12, 16, 17, 33]]
1
167
N,M = [int(i) for i in input().split()] A = [int(i) for i in input().split()] sumA = sum(A) pop_cnt = 0 for a in A: if a > (sumA/(4*M)): pop_cnt += 1 if pop_cnt >= M: print("Yes") else: print("No")
N,M = [int(i) for i in input().split()] A = [int(i) for i in input().split()] sumA = sum(A) pop_cnt = 0 for a in A: if a >= (sumA/(4*M)): pop_cnt += 1 if pop_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
87
#include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < (int)(n); i++) #define repi(i, a, b) for (int i = int(a); i < int(b); ++i) typedef long long ll; long long mod = 1e9 + 7; const long long INF = 1LL << 60; using namespace std; template <class T> inline bool chmin(T &a, T b) { if (a > b) { a = b; ...
#include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < (int)(n); i++) #define repi(i, a, b) for (int i = int(a); i < int(b); ++i) typedef long long ll; long long mod = 1e9 + 7; const long long INF = 1LL << 60; using namespace std; template <class T> inline bool chmin(T &a, T b) { if (a > b) { a = b; ...
[["-", 8, 9, 0, 57, 15, 339, 51, 16, 17, 19], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 17, 18]]
1
247
#!/usr/bin/env python3 import sys DEBUG = False def read(t): return t(sys.stdin.readline().rstrip()) def read_list(t, sep = " "): return [t(s) for s in sys.stdin.readline().rstrip().split(sep)] def dprint(*args, **kwargs): if DEBUG: print(*args, **kwargs) return def main(): n, m = r...
#!/usr/bin/env python3 import sys DEBUG = False def read(t): return t(sys.stdin.readline().rstrip()) def read_list(t, sep = " "): return [t(s) for s in sys.stdin.readline().rstrip().split(sep)] def dprint(*args, **kwargs): if DEBUG: print(*args, **kwargs) return def main(): n, m = r...
[["-", 0, 14, 8, 196, 0, 57, 15, 666, 667, 47], ["+", 0, 14, 8, 196, 0, 57, 15, 666, 667, 20]]
5
162
#include <bits/stdc++.h> using namespace std; #define ll long long #define ld long double #define pb push_back #define pf push_front #define mp make_pair #define pll pair<ll, ll> #define vl vector<ll> #define sl set<ll> #define vll vector<pll> #define ml map<ll, ll> #define mll map<pll, ll> #define all(a) a.begin(), a...
#include <bits/stdc++.h> using namespace std; #define ll long long #define ld long double #define pb push_back #define pf push_front #define mp make_pair #define pll pair<ll, ll> #define vl vector<ll> #define sl set<ll> #define vll vector<pll> #define ml map<ll, ll> #define mll map<pll, ll> #define all(a) a.begin(), a...
[["-", 0, 9, 0, 57, 15, 339, 51, 16, 17, 19], ["+", 0, 9, 0, 57, 15, 339, 51, 16, 17, 18]]
1
252
#include <bits/stdc++.h> using namespace std; typedef long long ll; #define FOR(var, begin, end) for (int var = (begin); var <= (end); var++) #define RFOR(var, begin, end) for (int var = (begin); var >= (end); var--) #define REP(var, length) FOR(var, 0, length - 1) #define RREP(var, length) RFOR(var, length - 1, 0) #de...
#include <bits/stdc++.h> using namespace std; typedef long long ll; #define FOR(var, begin, end) for (int var = (begin); var <= (end); var++) #define RFOR(var, begin, end) for (int var = (begin); var >= (end); var--) #define REP(var, length) FOR(var, 0, length - 1) #define RREP(var, length) RFOR(var, length - 1, 0) #de...
[["+", 15, 339, 51, 16, 12, 16, 12, 2, 63, 40]]
1
731
#include <algorithm> #include <climits> #include <iostream> #include <map> #include <math.h> #include <numeric> #include <queue> #include <set> #include <vector> #define fi first #define se second #define pb push_back #define pii pair<int, int> #define ll long long #define mkp make_pair #define pll pair<ll, ll> #define...
#include <algorithm> #include <climits> #include <iostream> #include <map> #include <math.h> #include <numeric> #include <queue> #include <set> #include <vector> #define fi first #define se second #define pb push_back #define pii pair<int, int> #define ll long long #define mkp make_pair #define pll pair<ll, ll> #define...
[["-", 0, 30, 0, 14, 8, 9, 0, 43, 39, 40], ["+", 0, 30, 0, 14, 8, 9, 0, 43, 39, 40]]
1
236
#include <algorithm> #include <cstring> #include <iostream> using namespace std; /* run this program using the console pauser or add your own getch, * system("pause") or input loop */ #define rep(i, a, b) for (int i = a; i <= b; i++) #define rep2(i, a, b) for (int i = a; i >= b; i--) #define ll long long int a[1005]; ...
#include <algorithm> #include <cstring> #include <iostream> using namespace std; /* run this program using the console pauser or add your own getch, * system("pause") or input loop */ #define rep(i, a, b) for (int i = a; i <= b; i++) #define rep2(i, a, b) for (int i = a; i >= b; i--) #define ll long long int a[1005]; ...
[["-", 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
150
#include <bits/stdc++.h> #pragma GCC optimize("O3") #pragma GCC target("sse4") using namespace std; #define FOR(a, b) for (int a = 0; a < b; a++) #define F0R(a, b, c) for (int a = b; a <= c; a++) #define f first #define s second #define m0(x) memset(x, 0, sizeof(x)) typedef pair<int, int> pi; typedef long long ll; t...
#include <bits/stdc++.h> #pragma GCC optimize("O3") #pragma GCC target("sse4") using namespace std; #define FOR(a, b) for (int a = 0; a < b; a++) #define F0R(a, b, c) for (int a = b; a <= c; a++) #define f first #define s second #define m0(x) memset(x, 0, sizeof(x)) typedef pair<int, int> pi; typedef long long ll; t...
[["-", 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
200
// Created by Kira #include <bits/stdc++.h> using namespace std; #define IOS \ cin.sync_with_stdio(0); \ cin.tie(0); \ cout.tie...
// Created by Kira #include <bits/stdc++.h> using namespace std; #define IOS \ cin.sync_with_stdio(0); \ cin.tie(0); \ cout.tie...
[["-", 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
236
import sys sys.setrecursionlimit(10**6) from math import floor,ceil,sqrt,factorial,log from heapq import heappop, heappush, heappushpop from collections import Counter,defaultdict,deque from itertools import accumulate,permutations,combinations,product,combinations_with_replacement from bisect import bisect_left,bisect...
import sys sys.setrecursionlimit(10**6) from math import floor,ceil,sqrt,factorial,log from heapq import heappop, heappush, heappushpop from collections import Counter,defaultdict,deque from itertools import accumulate,permutations,combinations,product,combinations_with_replacement from bisect import bisect_left,bisect...
[["-", 36, 36, 0, 656, 0, 57, 15, 666, 0, 22], ["+", 36, 36, 0, 656, 0, 57, 15, 666, 0, 22]]
5
358
#include <bits/stdc++.h> using namespace std; //<<setprecision(30) #define rep(i, n) for (ll i = 0; i < (ll)(n); i++) #define rep1(i, n) for (ll i = 1; i <= (ll)(n); i++) #define INF 1000000000000 #define MOD 1000000007 using ll = long long; using Graph = vector<vector<int>>; int main() { int N, M; cin >> N >> M; ...
#include <bits/stdc++.h> using namespace std; //<<setprecision(30) #define rep(i, n) for (ll i = 0; i < (ll)(n); i++) #define rep1(i, n) for (ll i = 1; i <= (ll)(n); i++) #define INF 1000000000000 #define MOD 1000000007 using ll = long long; using Graph = vector<vector<int>>; int main() { int N, M; cin >> N >> M; ...
[["-", 31, 16, 31, 2, 3, 4, 0, 16, 17, 33], ["-", 31, 16, 31, 2, 3, 4, 0, 16, 12, 13]]
1
152
N,M=list(map(int,input().split(' '))) A=list(map(int,input().split(' '))) k=0 for i in range(0,N): if A[i]/sum(A)>1/(4*M): k=k+1 if k>M-1: print('Yes') else: print('No')
N,M=list(map(int,input().split(' '))) A=list(map(int,input().split(' '))) k=0 for i in range(0,N): if A[i]/sum(A)>=1/(4*M): k=k+1 if k>M-1: 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
100
#include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < (n); i++) #define pb push_back #define all(v) v.begin(), v.end() #define fi first #define se second #define bigger (char)toupper #define smaller (char)tolower using namespace std; typedef pair<int, int> pii; typedef vector<int> vi; typedef vector<vi> vii; t...
#include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < (n); i++) #define pb push_back #define all(v) v.begin(), v.end() #define fi first #define se second #define bigger (char)toupper #define smaller (char)tolower using namespace std; typedef pair<int, int> pii; typedef vector<int> vi; typedef vector<vi> vii; t...
[["-", 0, 30, 0, 14, 8, 9, 0, 43, 39, 40], ["+", 0, 30, 0, 14, 8, 9, 0, 43, 39, 40]]
1
210
#include <algorithm> #include <cmath> #include <cstdio> #include <cstring> #include <iostream> #include <queue> #include <set> #include <stack> #include <string> #include <vector> using namespace std; typedef long long ll; int main() { // freopen("a.in","r",stdin); ios::sync_with_stdio(false); cin.tie(0); int n...
#include <algorithm> #include <cmath> #include <cstdio> #include <cstring> #include <iostream> #include <queue> #include <set> #include <stack> #include <string> #include <vector> using namespace std; typedef long long ll; int main() { // freopen("a.in","r",stdin); ios::sync_with_stdio(false); cin.tie(0); int 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, 31, 16, 31, 13], ["+", 0, 43, 49, 50, 51, 16, 31, 16, 17, 48]]
1
182
n,m = gets.split.map(&:to_i) a = gets.split.map(&:to_i).sort.reverse sum = a.inject(:+) puts a[m-1] >= sum / (4 * m) ? "Yes" : "No"
n,m = gets.split.map(&:to_i) a = gets.split.map(&:to_i).sort.reverse sum = a.inject(:+) puts a[m-1] >= (sum.to_f / (4 * m)) ? "Yes" : "No"
[["+", 3, 4, 0, 754, 15, 738, 12, 739, 0, 24], ["+", 15, 738, 12, 739, 0, 738, 31, 652, 17, 131], ["+", 15, 738, 12, 739, 0, 738, 31, 652, 735, 22], ["+", 15, 738, 12, 739, 0, 738, 12, 739, 0, 25]]
4
59
// Problem : B - Popular Vote // Contest : AtCoder Beginner Contest 161 // URL : https://atcoder.jp/contests/abc161/tasks/abc161_b // Memory Limit : 1024 MB // Time Limit : 2000 ms // Powered by CP Editor (https://github.com/cpeditor/cp-editor) #include <bits/stdc++.h> using namespace std; #pragma GCC optimize("Ofast...
// Problem : B - Popular Vote // Contest : AtCoder Beginner Contest 161 // URL : https://atcoder.jp/contests/abc161/tasks/abc161_b // Memory Limit : 1024 MB // Time Limit : 2000 ms // Powered by CP Editor (https://github.com/cpeditor/cp-editor) #include <bits/stdc++.h> using namespace std; #pragma GCC optimize("Ofast...
[["-", 31, 16, 12, 69, 341, 342, 0, 16, 17, 33], ["-", 31, 16, 12, 69, 341, 342, 0, 16, 12, 13]]
1
702
n, m = map(int, input().split()) A = list(map(int, input().split())) sa = sum(A) print('Yes' if len([a for a in A if a>=sa/(4*m)])>m else 'No')
n, m = map(int, input().split()) A = list(map(int, input().split())) sa = sum(A) print('Yes' if len([a for a in A if a>=sa/(4*m)])>=m else 'No')
[["-", 0, 652, 3, 4, 0, 41, 0, 666, 667, 47], ["+", 0, 652, 3, 4, 0, 41, 0, 666, 667, 20]]
5
72
N, M = map(int, input().split()) A = list(map(int, input().split())) s = sum(A) ans = 0 for i in A: if 4 * M * i < s: ans += 1 print("Yes") if ans >= M else print("No")
N, M = map(int, input().split()) A = list(map(int, input().split())) s = sum(A) ans = 0 for i in A: if 4 * M * i >= s: ans += 1 print("Yes") if ans >= M else print("No")
[["-", 0, 7, 8, 196, 0, 57, 15, 666, 667, 18], ["+", 0, 7, 8, 196, 0, 57, 15, 666, 667, 20]]
5
76
#include <bits/stdc++.h> using namespace std; #define ll long long int #define pb push_back #define fi first #define se second #define mp make_pair #define mt make_tuple #define all(A) A.begin(), A.end() #define sz(A) (int)A.size() typedef vector<int> vi; typedef vector<ll> vl; typedef pair<int, int> pii; const ll mod...
#include <bits/stdc++.h> using namespace std; #define ll long long int #define pb push_back #define fi first #define se second #define mp make_pair #define mt make_tuple #define all(A) A.begin(), A.end() #define sz(A) (int)A.size() typedef vector<int> vi; typedef vector<ll> vl; typedef pair<int, int> pii; const ll mod...
[["-", 8, 9, 0, 57, 15, 339, 51, 16, 17, 47], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 17, 20]]
1
213