buggy_code stringlengths 11 625k | fixed_code stringlengths 17 625k | bug_type stringlengths 2 4.45k | language int64 0 8 | token_count int64 5 200k |
|---|---|---|---|---|
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (n); i++)
using P = pair<int, int>;
using ll = long long;
int main() {
int n;
double m;
cin >> n >> m;
int a[n];
rep(i, n) cin >> a[i];
double max = 0;
rep(i, n) { max += a[i]; }
int ans = 0;
rep(i, n) {
if (max /... | #include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (n); i++)
using P = pair<int, int>;
using ll = long long;
int main() {
int n;
double m;
cin >> n >> m;
int a[n];
rep(i, n) cin >> a[i];
double max = 0;
rep(i, n) { max += a[i]; }
int ans = 0;
rep(i, n) {
if (max /... | [["-", 8, 9, 0, 57, 15, 339, 51, 16, 17, 18], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 17, 19]] | 1 | 139 |
#include <bits/stdc++.h>
using namespace std;
#define ll long long
int main() {
ios::sync_with_stdio(false);
cin.tie(nullptr);
int n, m;
cin >> n >> m;
vector<int> v(n);
int sum = 0;
for (int i = 0; i < n; i++) {
int num;
cin >> num;
v.at(i) = num;
sum += num;
}
int cnt = 0;
for (i... | #include <bits/stdc++.h>
using namespace std;
#define ll long long
int main() {
ios::sync_with_stdio(false);
cin.tie(nullptr);
int n, m;
cin >> n >> m;
vector<int> v(n);
int sum = 0;
for (int i = 0; i < n; i++) {
int num;
cin >> num;
v.at(i) = num;
sum += num;
}
int cnt = 0;
for (i... | [["-", 8, 9, 0, 57, 15, 339, 51, 16, 17, 47], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 17, 20]] | 1 | 155 |
import java.io.*;
import java.util.*;
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[] ary = new int[n];
int total = 0;
for (int i = 0; i < n; i++) {
ary[i] = sc.nextInt()... | import java.io.*;
import java.util.*;
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[] ary = new int[n];
int total = 0;
for (int i = 0; i < n; i++) {
ary[i] = sc.nextInt()... | [["+", 0, 57, 15, 15, 0, 16, 31, 74, 0, 24], ["+", 15, 15, 0, 16, 31, 74, 39, 511, 0, 512], ["+", 0, 57, 15, 15, 0, 16, 31, 74, 0, 25], ["+", 15, 15, 0, 16, 12, 16, 31, 74, 0, 24], ["+", 0, 16, 12, 16, 31, 74, 39, 511, 0, 512], ["+", 15, 15, 0, 16, 12, 16, 31, 74, 0, 25]] | 3 | 163 |
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using Graph = vector<vector<int>>;
const ll LINF = 1e18;
const int INF = 1e9;
const ll MOD = 1000000007;
template <class T> inline bool chmin(T &a, T b) {
if (a > b) {
a = b;
return true;
}
return false;
}
template <class T> inline bool... | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
using Graph = vector<vector<int>>;
const ll LINF = 1e18;
const int INF = 1e9;
const ll MOD = 1000000007;
template <class T> inline bool chmin(T &a, T b) {
if (a > b) {
a = b;
return true;
}
return false;
}
template <class T> inline bool... | [["-", 8, 9, 0, 57, 15, 339, 51, 16, 17, 47], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 17, 20]] | 1 | 294 |
import numpy as np
S = input().split(" ")
N = int(S[0])
M = int(S[1])
ARR = np.array([int(s) for s in input().split(" ")])
criterion = np.sum(ARR) / (4 * M)
res = ARR > criterion
result = np.sum(res)
if result >= M:
print("Yes")
else:
print("No")
| import numpy as np
S = input().split(" ")
N = int(S[0])
M = int(S[1])
ARR = np.array([int(s) for s in input().split(" ")])
criterion = np.sum(ARR) / (4 * M)
res = ARR >= criterion
result = np.sum(res)
if result >= M:
print("Yes")
else:
print("No")
| [["-", 0, 656, 0, 1, 0, 662, 12, 666, 667, 47], ["+", 0, 656, 0, 1, 0, 662, 12, 666, 667, 20]] | 5 | 106 |
#include <bits/stdc++.h>
typedef long long int ll;
typedef long double ld;
using namespace std;
int main() {
ll n, m;
cin >> n >> m;
ld a[n];
ll ans = 0;
ll sum = 0;
for (ll i = 0; i < n; ++i) {
cin >> a[i];
sum += a[i];
}
ld flag = sum / (4 * m);
for (ll i = 0; i < n; ++i) {
if (flag <= ... | #include <bits/stdc++.h>
typedef long long int ll;
typedef long double ld;
using namespace std;
int main() {
ll n;
ld m;
cin >> n >> m;
ld a[n];
ld ans = 0;
ld sum = 0;
for (ll i = 0; i < n; ++i) {
cin >> a[i];
sum += a[i];
}
ld flag = sum / (4 * m);
for (ll i = 0; i < n; ++i) {
if (fla... | [["-", 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], ["-", 0, 30, 0, 14, 8, 9, 0, 43, 39, 78]] | 1 | 148 |
/* D-"Median of Medians" */
/* */
// include <bits/stdc++.h>
#include <algorithm>
#include <cmath>
#include <deque>
#include <functional>
#include <iostream>
#include <map>
#include <math.h>
#include <string>
#include <vector>
#define ll long long
#define rep(i, n) for (int i = 0; i < (n); i++)
using namespace std;
i... | /* D-"Median of Medians" */
/* */
// include <bits/stdc++.h>
#include <algorithm>
#include <cmath>
#include <deque>
#include <functional>
#include <iostream>
#include <map>
#include <math.h>
#include <string>
#include <vector>
#define ll long long
#define rep(i, n) for (int i = 0; i < (n); i++)
using namespace std;
i... | [["-", 0, 30, 0, 14, 8, 9, 0, 43, 0, 21], ["+", 0, 30, 0, 14, 8, 9, 0, 43, 0, 35], ["+", 0, 30, 0, 14, 8, 9, 0, 43, 39, 40]] | 1 | 137 |
#include <bits/stdc++.h>
using namespace std;
int main() {
ios::sync_with_stdio(false);
cin.tie(NULL);
cout.tie(NULL);
int n, m;
cin >> n >> m;
long long sum = 0;
int cnt = 0;
vector<long long> a(n);
for (int i = 0; i < n; ++i) {
cin >> a[i];
sum += a[i];
}
for (int i = 0; i < n; ++i) {
... | #include <bits/stdc++.h>
using namespace std;
int main() {
ios::sync_with_stdio(false);
cin.tie(NULL);
cout.tie(NULL);
long long n, m;
cin >> n >> m;
long long sum = 0;
int cnt = 0;
vector<long long> a(n);
for (int i = 0; i < n; ++i) {
cin >> a[i];
sum += a[i];
}
for (int i = 0; i < n; +... | [["-", 0, 30, 0, 14, 8, 9, 0, 43, 39, 40], ["+", 0, 14, 8, 9, 0, 43, 39, 86, 0, 96], ["-", 12, 23, 0, 16, 31, 16, 31, 16, 12, 22], ["+", 12, 23, 0, 16, 31, 16, 31, 16, 12, 22]] | 1 | 149 |
N, M = map(int, input().split())
A = list(map(int, input().split()))
A.sort(reverse=True)
s = sum(A)
c = s / (4 * M)
if A[M] < c:
print('No')
else:
print('Yes')
| N, M = map(int, input().split())
A = list(map(int, input().split()))
A.sort(reverse=True)
s = sum(A)
c = s / (4 * M)
if A[M - 1] < c:
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 | 78 |
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define ll long long
#define INF 1000000000000000000
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... | #include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define ll long long
#define INF 1000000000000000000
int main() {
int N;
double M;
cin >> N >> M;
vector<int> A(N);
double sum = 0;
rep(i, N) {
cin >> A[i];
sum += A[i];
}
int count = 0;
rep(i,... | [["-", 0, 30, 0, 14, 8, 9, 0, 43, 0, 21], ["+", 0, 30, 0, 14, 8, 9, 0, 43, 0, 35], ["+", 0, 30, 0, 14, 8, 9, 0, 43, 39, 40], ["-", 0, 30, 0, 14, 8, 9, 0, 43, 39, 40]] | 1 | 129 |
// __/\\\\____________/\\\\______/\\\\\\\\\______/\\\________/\\\___/\\\\\\\\/\\____/\\\\\\\\\\_|
// _\/\\\\\\________/\\\\\\____/\\\\\\\\\\\\\___\/\\\________/\\\__\/\\\____\/\\\__\////\\\///__|
// _\/\\\//\\\____/\\\//\\\___/\\\/////////\\\__\/\\\________/\\\__\/\\\____\/\\\\____\/\\\_____|
// _\/\\\\///\\\... | // __/\\\\____________/\\\\______/\\\\\\\\\______/\\\________/\\\___/\\\\\\\\/\\____/\\\\\\\\\\_|
// _\/\\\\\\________/\\\\\\____/\\\\\\\\\\\\\___\/\\\________/\\\__\/\\\____\/\\\__\////\\\///__|
// _\/\\\//\\\____/\\\//\\\___/\\\/////////\\\__\/\\\________/\\\__\/\\\____\/\\\\____\/\\\_____|
// _\/\\\\///\\\... | [["-", 0, 57, 15, 339, 51, 16, 31, 16, 31, 22], ["+", 0, 57, 15, 339, 51, 16, 31, 16, 31, 22]] | 1 | 277 |
import java.util.Scanner;
public class Main {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int N, M;
N = sc.nextInt();
M = sc.nextInt();
int a[] = new int[N];
int count = 0;
int total = 0;
for (int i = 0; i < N; i++) {
a[i] = sc.nextInt();
... | import java.util.Scanner;
public class Main {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int N, M;
N = sc.nextInt();
M = sc.nextInt();
int a[] = new int[N];
int count = 0;
int total = 0;
for (int i = 0; i < N; i++) {
a[i] = sc.nextInt();
... | [["-", 8, 196, 0, 57, 15, 15, 0, 16, 17, 47], ["+", 8, 196, 0, 57, 15, 15, 0, 16, 17, 20]] | 3 | 178 |
#include <bits/stdc++.h>
#define int long long
#define rep(i, l, r) for (int i = l; i <= r; i++)
#define per(i, r, l) for (int i = r; i >= l; i--)
#define IMAX 0x3f3f3f3f
#define LLMAX 0x3f3f3f3f3f3f3f3f
using namespace std;
typedef long long ll;
typedef double db;
inline int read() {
int x = 0, f = 1;
char c = get... | #include <bits/stdc++.h>
#define int long long
#define rep(i, l, r) for (int i = l; i <= r; i++)
#define per(i, r, l) for (int i = r; i >= l; i--)
#define IMAX 0x3f3f3f3f
#define LLMAX 0x3f3f3f3f3f3f3f3f
using namespace std;
typedef long long ll;
typedef double db;
inline int read() {
int x = 0, f = 1;
char c = get... | [["-", 8, 9, 0, 57, 15, 339, 51, 16, 17, 19], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 17, 18]] | 1 | 240 |
n,m = map(int, input().split())
lis = list(map(int, input().split()))
total = sum(lis)
count = 0
for e in lis:
if e>=(1/(4*m)):
count += 1
if count >= m:
print("Yes")
else:
print("No") | n,m = map(int, input().split())
lis = list(map(int, input().split()))
total = sum(lis)
count = 0
for e in lis:
if e>=(1/(4*m))*total:
count += 1
if count >= m:
print("Yes")
else:
print("No")
| [["+", 8, 196, 0, 57, 15, 666, 0, 657, 17, 48], ["+", 8, 196, 0, 57, 15, 666, 0, 657, 12, 22]] | 5 | 82 |
#include <algorithm>
#include <array>
#include <cmath>
#include <complex>
#include <cstdio>
#include <cstring>
#include <deque>
#include <functional>
#include <iomanip>
#include <iostream>
#include <list>
#include <map>
#include <numeric>
#include <queue>
#include <random>
#include <set>
#include <sstream>
#include <st... | #include <algorithm>
#include <array>
#include <cmath>
#include <complex>
#include <cstdio>
#include <cstring>
#include <deque>
#include <functional>
#include <iomanip>
#include <iostream>
#include <list>
#include <map>
#include <numeric>
#include <queue>
#include <random>
#include <set>
#include <sstream>
#include <st... | [["-", 3, 4, 0, 2, 3, 4, 0, 16, 17, 47], ["+", 3, 4, 0, 2, 3, 4, 0, 16, 17, 20]] | 1 | 814 |
def main():
N,M = map(int,input().split())
A = list(map(int,input().split()))
m_count = sum(x > sum(A)/(4*M) for x in A)
if M <= m_count:
print("Yes")
else:
print("No")
if __name__ == '__main__':
main()
| def main():
N,M = map(int,input().split())
A = list(map(int,input().split()))
m_count = sum(x >= sum(A)/(4*M) for x in A)
if M <= m_count:
print("Yes")
else:
print("No")
if __name__ == '__main__':
main()
| [["-", 0, 662, 12, 652, 3, 668, 8, 666, 667, 47], ["+", 0, 662, 12, 652, 3, 668, 8, 666, 667, 20]] | 5 | 88 |
import numpy as np
N, M = list(map(int, input().split()))
A = list(map(int, input().split()))
total_vote = np.sum(A)
threshold = total_vote/(4*M)
A.sort(reverse = True)
if A[M] > threshold:
print('Yes')
else:
print('No') | import numpy as np
N, M = list(map(int, input().split()))
A = list(map(int, input().split()))
total_vote = np.sum(A)
threshold = total_vote/(4*M)
A.sort(reverse = True)
if A[M-1] >= threshold:
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], ["-", 36, 36, 0, 656, 0, 57, 15, 666, 667, 47], ["+", 36, 36, 0, 656, 0, 57, 15, 666, 667, 20]] | 5 | 87 |
/* ***********************************************
Author :taciturnity
Created Time :2020/2/21 8:23:51
File Name :TEST.cpp
************************************************ */
#include <algorithm>
#include <bitset>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <iostream>
... | /* ***********************************************
Author :taciturnity
Created Time :2020/2/21 8:23:51
File Name :TEST.cpp
************************************************ */
#include <algorithm>
#include <bitset>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <iostream>
... | [["-", 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, 78], ["+", 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 | 320 |
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();
int[] a = new int[n];
int sum = 0;
for (int i = 0; i < n; i++) {
a[i] = sc.nextInt();
s... | 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();
int[] a = new int[n];
int sum = 0;
for (int i = 0; i < n; i++) {
a[i] = sc.nextInt();
s... | [["-", 0, 195, 8, 196, 0, 7, 15, 16, 17, 20], ["+", 0, 195, 8, 196, 0, 7, 15, 16, 17, 47], ["-", 8, 196, 0, 57, 15, 15, 0, 16, 17, 19], ["+", 8, 196, 0, 57, 15, 15, 0, 16, 17, 18]] | 3 | 183 |
#include <algorithm>
#include <cctype>
#include <cfloat>
#include <climits>
#include <cmath>
#include <iomanip>
#include <iostream>
#include <memory>
#include <string>
#include <vector>
#define ll long long
#define ull unsigned long long
#define uint unsigned
#define l_double long double
#define vtr vector
#define PB p... | #include <algorithm>
#include <cctype>
#include <cfloat>
#include <climits>
#include <cmath>
#include <iomanip>
#include <iostream>
#include <memory>
#include <string>
#include <vector>
#define ll long long
#define ull unsigned long long
#define uint unsigned
#define l_double long double
#define vtr vector
#define PB p... | [["-", 0, 30, 0, 14, 8, 9, 0, 43, 39, 40], ["+", 0, 30, 0, 14, 8, 9, 0, 43, 39, 40]] | 1 | 363 |
#include <algorithm>
#include <cmath>
#include <cstdio>
#include <cstring>
#include <iostream>
#include <map>
#include <queue>
#include <stack>
typedef long long ll;
using namespace std;
int main() {
int a[50000];
int n, m;
double sum = 0;
int k = 0;
cin >> n >> m;
for (int i = 1; i <= n; i++) {
cin >... | #include <algorithm>
#include <cmath>
#include <cstdio>
#include <cstring>
#include <iostream>
#include <map>
#include <queue>
#include <stack>
typedef long long ll;
using namespace std;
int main() {
int a[50000];
int n, m;
double sum = 0;
int k = 0;
cin >> n >> m;
for (int i = 1; i <= n; i++) {
cin >... | [["-", 8, 9, 0, 57, 15, 339, 51, 16, 17, 47], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 17, 20]] | 1 | 154 |
#include <algorithm>
#include <iostream>
#include <vector>
#define rep(i, N) for (int i = 0; i < N; ++i)
using namespace std;
int main() {
int n, m;
cin >> n >> m;
vector<int> a;
int totalVal = 0;
rep(i, n) {
int val;
cin >> val;
a.push_back(val);
totalVal += val;
}
sort(a.begin(), a.e... | #include <algorithm>
#include <iostream>
#include <vector>
#define rep(i, N) for (int i = 0; i < N; ++i)
using namespace std;
int main() {
int n, m;
cin >> n >> m;
vector<int> a;
int totalVal = 0;
rep(i, n) {
int val;
cin >> val;
a.push_back(val);
totalVal += val;
}
sort(a.begin(), a.e... | [["+", 51, 16, 12, 16, 31, 2, 3, 4, 0, 25], ["-", 12, 2, 3, 4, 0, 16, 12, 23, 0, 25]] | 1 | 141 |
#include <bits/stdc++.h>
using namespace std;
#define FASTIO \
std::ios::sync_with_stdio(false); \
cin.tie(NULL); \
cout.tie(NULL);
int a[10000... |
#include <bits/stdc++.h>
using namespace std;
#define FASTIO \
std::ios::sync_with_stdio(false); \
cin.tie(NULL); \
cout.tie(NULL);
int a[10000... | [["+", 8, 9, 0, 1, 0, 11, 12, 2, 63, 22], ["+", 0, 1, 0, 11, 12, 2, 3, 4, 0, 24], ["-", 0, 11, 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 | 140 |
#include <bits/stdc++.h>
using namespace std;
int main() {
int n, m;
cin >> n >> m;
int sum = 0;
int a[n];
for (int i = 0; i < n; i++) {
cin >> a[i];
sum += a[i];
}
sort(a, a + n, greater<int>());
int count = 0;
int limit = sum / (4 * m);
for (int i = 0; i < n; i++) {
if (a[i] < limit) ... | #include <bits/stdc++.h>
using namespace std;
int main() {
int n;
double m;
cin >> n >> m;
double sum = 0;
double a[n];
for (int i = 0; i < n; i++) {
cin >> a[i];
sum += a[i];
}
sort(a, a + n, greater<double>());
int count = 0;
double limit = sum / (4 * m);
for (int i = 0; i < n; i++) {
... | [["-", 0, 30, 0, 14, 8, 9, 0, 43, 0, 21], ["+", 0, 30, 0, 14, 8, 9, 0, 43, 0, 35], ["+", 0, 30, 0, 14, 8, 9, 0, 43, 39, 40], ["-", 0, 30, 0, 14, 8, 9, 0, 43, 39, 40], ["-", 0, 2, 63, 346, 3, 347, 0, 77, 39, 40], ["+", 0, 2, 63, 346, 3, 347, 0, 77, 39, 40]] | 1 | 148 |
#include <algorithm>
#include <iostream>
#include <stdio.h>
#include <string>
#include <vector>
using namespace std;
int main() {
int n, m, sum = 0;
cin >> n >> m;
vector<int> a(n);
for (int i = 0; i < n; i++) {
cin >> a[i];
sum += a[i];
}
sort(a.begin(), a.end(), greater<int>());
for (int i = ... | #include <algorithm>
#include <iostream>
#include <stdio.h>
#include <string>
#include <vector>
using namespace std;
int main() {
int n, m;
double sum = 0;
cin >> n >> m;
vector<int> a(n);
for (int i = 0; i < n; i++) {
cin >> a[i];
sum += a[i];
}
sort(a.begin(), a.end(), greater<int>());
for ... | [["-", 0, 30, 0, 14, 8, 9, 0, 43, 0, 21], ["+", 0, 30, 0, 14, 8, 9, 0, 43, 0, 35], ["+", 0, 30, 0, 14, 8, 9, 0, 43, 39, 40]] | 1 | 145 |
#include <algorithm>
#include <cmath>
#include <iomanip>
#include <iostream>
#include <numeric>
#include <string>
#include <vector>
std::string solve(int n, int m, std::vector<int> &counts) {
auto sum = std::accumulate(counts.begin(), counts.end(), 0);
std::sort(counts.begin(), counts.end(),
[](int lhs... | #include <algorithm>
#include <cmath>
#include <iomanip>
#include <iostream>
#include <numeric>
#include <string>
#include <vector>
std::string solve(int n, int m, std::vector<int> &counts) {
auto sum = std::accumulate(counts.begin(), counts.end(), 0);
std::sort(counts.begin(), counts.end(),
[](int lhs... | [["-", 3, 4, 0, 16, 12, 23, 0, 16, 31, 13], ["+", 3, 4, 0, 16, 12, 23, 0, 16, 31, 13]] | 1 | 195 |
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define repr(i, n) for (int i = (int)(n); i >= 0; i--)
#define all(v) v.begin(), v.end()
typedef long long ll;
int main() {
int N, M;
cin >> N >> M;
vector<int> vec(N);
rep(i, N) { cin >> vec[i]; }
sort(all(vec... | #include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define repr(i, n) for (int i = (int)(n); i >= 0; i--)
#define all(v) v.begin(), v.end()
typedef long long ll;
int main() {
double N, M;
cin >> N >> M;
vector<double> vec(N);
rep(i, N) { cin >> vec[i]; }
sort(a... | [["-", 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 | 136 |
#include <bits/stdc++.h>
#define int long long
#define rep(i, m, n) for (int i = m; i < n; i++)
#define repr(i, n, m) for (int i = n; i >= m; i--)
#define mod 1000000007
#define float long double
#define pb push_back
#define mp make_pair
#define print(v) \
... | #include <bits/stdc++.h>
#define int long long
#define rep(i, m, n) for (int i = m; i < n; i++)
#define repr(i, n, m) for (int i = n; i >= m; i--)
#define mod 1000000007
#define float long double
#define pb push_back
#define mp make_pair
#define print(v) \
... | [["+", 8, 9, 0, 43, 49, 50, 51, 2, 63, 22], ["+", 0, 43, 49, 50, 51, 2, 3, 4, 0, 24], ["+", 51, 2, 3, 4, 0, 16, 31, 74, 0, 24], ["+", 3, 4, 0, 16, 31, 74, 39, 77, 39, 40], ["+", 51, 2, 3, 4, 0, 16, 31, 74, 0, 25], ["+", 51, 2, 3, 4, 0, 16, 12, 23, 0, 25]] | 1 | 291 |
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (n); ++i)
#define REP(i, d, n) for (int i = (d); i < (n); ++i)
#define all(v) v.begin(), v.end()
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) ... | #include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (n); ++i)
#define REP(i, d, n) for (int i = (d); i < (n); ++i)
#define all(v) v.begin(), v.end()
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) ... | [["+", 49, 50, 51, 16, 31, 23, 0, 16, 17, 33], ["+", 49, 50, 51, 16, 31, 23, 0, 16, 12, 13]] | 1 | 173 |
// SeeAlso:
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef vector<int> vi;
typedef vector<ll> vl;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
#define MAX 100000
#define NIL -1
#define MOD 1000000007
typedef int _loop_int;
#define rep(i, n) for (int i = 0; i < n; i++)
#define ... | // SeeAlso:
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef vector<int> vi;
typedef vector<ll> vl;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
#define MAX 100000
#define NIL -1
#define MOD 1000000007
typedef int _loop_int;
#define rep(i, n) for (int i = 0; i < n; i++)
#define ... | [["-", 8, 9, 0, 57, 15, 339, 51, 16, 17, 47], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 17, 20]] | 1 | 385 |
#include <bits/stdc++.h>
using namespace std;
#define ll long long
int main() {
ios_base::sync_with_stdio(false);
cin.tie(NULL);
int n, m;
cin >> n >> m;
vector<int> a(n);
int sum = 0;
for (int i = 0; i < n; ++i)
cin >> a[i];
sum = accumulate(a.begin(), a.end(), 0);
// cout<<sum;
sort(a.rbegin(... | #include <bits/stdc++.h>
using namespace std;
#define ll long long
int main() {
ios_base::sync_with_stdio(false);
cin.tie(NULL);
int n, m;
cin >> n >> m;
vector<int> a(n);
int sum = 0;
for (int i = 0; i < n; ++i)
cin >> a[i];
sum = accumulate(a.begin(), a.end(), 0);
// cout<<sum;
sort(a.rbegin(... | [["+", 8, 9, 0, 1, 0, 11, 12, 2, 63, 22], ["+", 0, 1, 0, 11, 12, 2, 3, 4, 0, 24], ["-", 0, 11, 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 | 173 |
import math
n,m = list(map(int, input().split(" ")))
sequence = list(map(int, input().split(" ")))
threshold = math.ceil(sum(sequence) // (4*m))
sequence.sort(reverse = True)
index = 0
while m > 0:
if sequence[index] >= threshold:
m -= 1
index += 1
else:
break
if m == 0:
print("Yes")
else:
print("No") | import math
n,m = list(map(int, input().split(" ")))
sequence = list(map(int, input().split(" ")))
threshold = math.ceil(sum(sequence) / (4*m))
sequence.sort(reverse = True)
index = 0
while m > 0:
if sequence[index] >= threshold:
m -= 1
index += 1
else:
break
if m == 0:
print("Yes")
else:
print("No") | [["-", 0, 662, 12, 652, 3, 4, 0, 657, 17, 676], ["+", 0, 662, 12, 652, 3, 4, 0, 657, 17, 85]] | 5 | 113 |
#include <algorithm>
#include <cmath>
#include <functional>
#include <iomanip>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <string>
#include <tuple>
#include <utility>
#include <vector>
#define LL long long
#define trio tuple<int, int, int>
using namespace std;
int N, M, A[111], tf = ... | #include <algorithm>
#include <cmath>
#include <functional>
#include <iomanip>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <string>
#include <tuple>
#include <utility>
#include <vector>
#define LL long long
#define trio tuple<int, int, int>
using namespace std;
int N, M, A[111], tf = ... | [["-", 15, 339, 51, 16, 12, 74, 51, 23, 0, 24], ["+", 51, 16, 12, 16, 12, 74, 39, 77, 39, 40], ["+", 15, 339, 51, 16, 12, 16, 12, 74, 0, 25], ["+", 51, 16, 12, 16, 12, 74, 51, 23, 0, 24], ["-", 12, 74, 51, 23, 0, 16, 12, 23, 0, 25]] | 1 | 174 |
import numpy as np
n, m = list(map(int, input().split()))
a = np.array(list(map(int, input().split())))
total = np.sum(a)
#print(len(a[a>=total//(4*m)]))
if len(a[a>=total//(4*m)])>=m:
print('Yes')
else:
print('No') | import numpy as np
n, m = list(map(int, input().split()))
a = np.array(list(map(int, input().split())))
total = np.sum(a)
#print(len(a[a>=total/(4*m)]))
if len(a[a>=total/(4*m)])>=m:
print('Yes')
else:
print('No') | [["-", 3, 4, 0, 206, 206, 666, 0, 657, 17, 676], ["+", 3, 4, 0, 206, 206, 666, 0, 657, 17, 85]] | 5 | 87 |
N, M = map(int, input().split())
A = list(map(int, input().split()))
if len([c for c in A if c > sum(A) / (4 * M)]) >= M:
print("Yes")
else:
print("No") | N, M = map(int, input().split())
A = list(map(int, input().split()))
if len([c for c in A if c >= sum(A) / (4 * M)]) >= M:
print("Yes")
else:
print("No") | [["-", 3, 4, 0, 658, 0, 678, 0, 666, 667, 47], ["+", 3, 4, 0, 658, 0, 678, 0, 666, 667, 20]] | 5 | 74 |
#include <bits/stdc++.h>
using namespace std;
#define ll long long int
int main() {
ll m, n;
cin >> n >> m;
ll arr[n], sum = 0;
for (ll i = 0; i < n; i++) {
cin >> arr[i];
sum = sum + arr[i];
}
double x = (double)sum / (4 * m);
sort(arr, arr + n);
if (arr[n - m] >= x)
cout << "YES" << endl;
... | #include <bits/stdc++.h>
using namespace std;
#define ll long long int
int main() {
ll m, n;
cin >> n >> m;
ll arr[n], sum = 0;
for (ll i = 0; i < n; i++) {
cin >> arr[i];
sum = sum + arr[i];
}
double x = (double)sum / (4 * m);
sort(arr, arr + n);
if (arr[n - m] >= x)
cout << "Yes" << endl;
... | [["-", 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 | 119 |
#include <bits/stdc++.h>
using namespace std;
int main() {
ios_base::sync_with_stdio(false);
cin.tie(NULL);
int n;
double m;
cin >> n >> m;
double arr[n];
for (double &i : arr)
cin >> i;
double sum = 0;
for (double i : arr)
sum += i;
double temp = (sum / (m * 4.0000));
sort(arr, arr + ... | #include <bits/stdc++.h>
using namespace std;
int main() {
ios_base::sync_with_stdio(false);
cin.tie(NULL);
int n;
double m;
cin >> n >> m;
double arr[n];
for (double &i : arr)
cin >> i;
double sum = 0;
for (double i : arr)
sum += i;
double temp = (sum / (m * 4.0000));
sort(arr, arr + ... | [["-", 51, 16, 31, 69, 341, 342, 0, 16, 12, 13], ["+", 31, 69, 341, 342, 0, 16, 12, 74, 0, 24], ["+", 341, 342, 0, 16, 12, 74, 39, 77, 39, 40], ["+", 31, 69, 341, 342, 0, 16, 12, 74, 0, 25], ["+", 31, 69, 341, 342, 0, 16, 12, 74, 51, 22]] | 1 | 122 |
n,m = map(int,input().split())
A = list(map(int,input().split()))
total = sum(A)
A.sort()
A.reverse()
com = 0
for i in A:
if(i < total/(4*m)):
break
else:
com += 1
if(com>m):
print('Yes')
else:
print('No') | n,m = map(int,input().split())
A = list(map(int,input().split()))
total = sum(A)
A.sort()
A.reverse()
com = 0
for i in A:
if(i < total/(4*m)):
break
else:
com += 1
if(com>=m):
print('Yes')
else:
print('No') | [["-", 0, 656, 0, 57, 15, 23, 0, 666, 667, 47], ["+", 0, 656, 0, 57, 15, 23, 0, 666, 667, 20]] | 5 | 97 |
#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);
}
int count = 0;
for (int i = 0; i < N; i++) {
if (A.at(i) >= sum / (4 * M)) {
count++;
}
}
i... | #include <bits/stdc++.h>
using namespace std;
int main() {
int N;
float M;
cin >> N >> M;
vector<float> A(N);
float sum = 0;
for (int i = 0; i < N; i++) {
cin >> A.at(i);
sum += A.at(i);
}
int count = 0;
for (int i = 0; i < N; i++) {
if (A.at(i) >= sum / (4 * M)) {
count++;
... | [["-", 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]] | 1 | 141 |
#include <bits/stdc++.h>
using namespace std;
int main() {
int n, m;
cin >> n >> m;
int a[n];
double total = 0;
for (int i = 0; i < n; i++) {
cin >> a[i];
total += a[i];
}
total = total / 4 / m;
int ans = 0;
for (int i = 0; i < n; i++) {
if (a[i] >= total)
ans++;
}
if (ans >= 2)... | #include <bits/stdc++.h>
using namespace std;
int main() {
int n, m;
cin >> n >> m;
int a[n];
double total = 0;
for (int i = 0; i < n; i++) {
cin >> a[i];
total += a[i];
}
total = total / 4 / m;
int ans = 0;
for (int i = 0; i < n; i++) {
if (a[i] >= total)
ans++;
}
if (ans >= m)... | [["-", 8, 9, 0, 57, 15, 339, 51, 16, 12, 13], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 12, 22]] | 1 | 131 |
#include <algorithm>
#include <cmath>
#include <iostream>
#include <string>
#include <vector>
typedef long long ll;
#define all(x) (x).begin(), (x).end() // sortなどの引数を省略
#define rep(i, n) for (ll i = 0; i < (ll)(n); i++)
#define max3(x, y, z) max(x, max(y, z))
#ifdef _MSC_FULL_VER //デバッグ出力
#define dout cout
#define de... | #include <algorithm>
#include <cmath>
#include <iostream>
#include <string>
#include <vector>
typedef long long ll;
#define all(x) (x).begin(), (x).end() // sortなどの引数を省略
#define rep(i, n) for (ll i = 0; i < (ll)(n); i++)
#define max3(x, y, z) max(x, max(y, z))
#ifdef _MSC_FULL_VER //デバッグ出力
#define dout cout
#define de... | [["-", 8, 9, 0, 57, 15, 339, 51, 16, 17, 47], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 17, 20]] | 1 | 217 |
#include <algorithm>
#include <cmath>
#include <deque>
#include <iomanip>
#include <iostream>
#include <map>
#include <queue>
#include <random>
#include <set>
#include <stack>
#include <string>
#include <utility>
#include <vector>
using namespace std;
#define rep(i, n) for (int i = 0; i < n; ++i)
#define REP(i, n) for... | #include <algorithm>
#include <cmath>
#include <deque>
#include <iomanip>
#include <iostream>
#include <map>
#include <queue>
#include <random>
#include <set>
#include <stack>
#include <string>
#include <utility>
#include <vector>
using namespace std;
#define rep(i, n) for (int i = 0; i < n; ++i)
#define REP(i, n) for... | [["+", 0, 57, 15, 339, 51, 16, 31, 16, 17, 48], ["+", 0, 57, 15, 339, 51, 16, 31, 16, 12, 22]] | 1 | 226 |
#include <bits/stdc++.h>
using namespace std;
int main() {
int n, m, i, a[1000], dap = 0, sum = 0;
scanf("%d %d", &n, &m);
for (i = 1; i <= n; i++) {
scanf("%d", &a[i]);
sum += a[i];
}
for (i = 1; i <= n; i++) {
if (4 * m * a[i] >= sum)
dap++;
}
if (sum >= m)
printf("Yes");
else
... | #include <bits/stdc++.h>
using namespace std;
int main() {
int n, m, i, a[1000], dap = 0, sum = 0;
scanf("%d %d", &n, &m);
for (i = 1; i <= n; i++) {
scanf("%d", &a[i]);
sum += a[i];
}
for (i = 1; i <= n; i++) {
if ((4 * m * a[i]) >= sum)
dap++;
}
if (dap >= m)
printf("Yes");
els... | [["+", 0, 57, 15, 339, 51, 16, 31, 23, 0, 24], ["+", 0, 57, 15, 339, 51, 16, 31, 23, 0, 25], ["-", 8, 9, 0, 57, 15, 339, 51, 16, 31, 22], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 31, 22]] | 1 | 135 |
#include <bits/stdc++.h>
#define foi(i, k, n) for (int i = (int)k; i < (int)n; ++i)
using namespace std;
using ii = pair<int, int>;
using ll = long long;
constexpr int MAXN = 5 + 1000;
int a[MAXN];
int main() {
ios::sync_with_stdio(false);
cin.tie(nullptr);
cout.tie(nullptr);
int n, m, s = 0;
cin >> n >> m... | #include <bits/stdc++.h>
#define foi(i, k, n) for (int i = (int)k; i < (int)n; ++i)
using namespace std;
using ii = pair<int, int>;
using ll = long long;
constexpr int MAXN = 5 + 1000;
int a[MAXN];
int main() {
ios::sync_with_stdio(false);
cin.tie(nullptr);
cout.tie(nullptr);
int n, m, s = 0;
cin >> n >> m... | [["-", 8, 9, 0, 57, 64, 1, 0, 27, 17, 68], ["+", 8, 9, 0, 57, 64, 1, 0, 27, 17, 29]] | 1 | 195 |
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (n); i++)
using ll = long long;
const ll MOD = 1000000007;
int main() {
int N, M;
cin >> N >> M;
vector<int> A(N);
rep(i, N) cin >> A.at(i);
int total = 0;
rep(i, N) { total += A.at(i); }
total /= (4 * M);
total++;
in... | #include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (n); i++)
using ll = long long;
const ll MOD = 1000000007;
int main() {
int N, M;
cin >> N >> M;
vector<int> A(N);
rep(i, N) cin >> A.at(i);
int total = 0;
rep(i, N) { total += A.at(i); }
total--;
total /= (4 * M);
to... | [["+", 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 | 157 |
#include <algorithm>
#include <cctype>
#include <cmath>
#include <deque>
#include <iomanip>
#include <iostream>
#include <map>
#include <queue>
#include <regex>
#include <set>
#include <stack>
#include <stdio.h>
#include <string>
#include <vector>
#define rep(i, n) for (int i = 0; i < n; i++)
typedef int long long ll;... | #include <algorithm>
#include <cctype>
#include <cmath>
#include <deque>
#include <iomanip>
#include <iostream>
#include <map>
#include <queue>
#include <regex>
#include <set>
#include <stack>
#include <stdio.h>
#include <string>
#include <vector>
#define rep(i, n) for (int i = 0; i < n; i++)
typedef int long long ll;... | [["-", 0, 57, 64, 9, 0, 1, 0, 27, 28, 22], ["+", 0, 57, 64, 9, 0, 1, 0, 27, 28, 22]] | 1 | 312 |
// ░░░░░░░░( •̪●)░░░░░░░░░░░░░░░░░░░░░░░░
// ░░░░░░███████ ]▄▄▄▄▄▄▄▄▃░░░▃░░░░ ▃░
// ▂▄▅█████████▅▄▃▂░░░░░░░░░░░░░░░░░
// [███████████████████].░░░░░░░░░░░░░░
// ◥⊙▲⊙▲⊙▲⊙▲⊙▲⊙▲⊙◤...░░░░░░░░░░░░
// PointBlank's code (⌐■_■)
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
#define repp(i, a, b) for (in... | // ░░░░░░░░( •̪●)░░░░░░░░░░░░░░░░░░░░░░░░
// ░░░░░░███████ ]▄▄▄▄▄▄▄▄▃░░░▃░░░░ ▃░
// ▂▄▅█████████▅▄▃▂░░░░░░░░░░░░░░░░░
// [███████████████████].░░░░░░░░░░░░░░
// ◥⊙▲⊙▲⊙▲⊙▲⊙▲⊙▲⊙◤...░░░░░░░░░░░░
// PointBlank's code (⌐■_■)
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
#define repp(i, a, b) for (in... | [["-", 0, 43, 39, 344, 3, 347, 0, 77, 39, 78], ["+", 0, 43, 39, 344, 3, 347, 0, 77, 39, 40], ["-", 0, 30, 0, 14, 8, 9, 0, 43, 39, 78], ["+", 0, 30, 0, 14, 8, 9, 0, 43, 39, 40]] | 1 | 323 |
#include <bits/stdc++.h>
#define rep(i, n) for (long long i = 0; i < (n); ++i)
const int INF = 2147483647; // int max
const int MOD = 1000000007;
using namespace std;
using ll = long long;
using P = pair<int, int>;
template <class T> inline bool chmin(T &a, T b) {
if (a > b) {
a = b;
return true;
}
return... | #include <bits/stdc++.h>
#define rep(i, n) for (long long i = 0; i < (n); ++i)
const int INF = 2147483647; // int max
const int MOD = 1000000007;
using namespace std;
using ll = long long;
using P = pair<int, int>;
template <class T> inline bool chmin(T &a, T b) {
if (a > b) {
a = b;
return true;
}
return... | [["-", 0, 30, 0, 14, 8, 9, 0, 43, 39, 78], ["+", 0, 30, 0, 14, 8, 9, 0, 43, 39, 40]] | 1 | 236 |
n,m = map(int,input().split())
a = list(map(int,input().split()))
count = 0
sm = sum(a)
for i in a:
if( i >= sm/(4*m)):
count += 1
if(count >= m):
print("YES")
else:
print("NO") | n,m = map(int,input().split())
a = list(map(int,input().split()))
count = 0
sm = sum(a)
for i in a:
if( i >= sm/(4*m)):
count += 1
if(count >= 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 | 84 |
import sys
stdin = sys.stdin
sys.setrecursionlimit(10 ** 7)
def II(): return int(sys.stdin.readline())
def MI(): return map(int, sys.stdin.readline().split())
# 入力全てを整数に変換したものの配列を受け取る
def LI(): return list(map(int, sys.stdin.readline().split()))
# 入力全てを整数に変換して1引いたものの配列を受け取る
def LLI(rows_number): return [LI() for _ in ... | import sys
stdin = sys.stdin
sys.setrecursionlimit(10 ** 7)
def II(): return int(sys.stdin.readline())
def MI(): return map(int, sys.stdin.readline().split())
# 入力全てを整数に変換したものの配列を受け取る
def LI(): return list(map(int, sys.stdin.readline().split()))
# 入力全てを整数に変換して1引いたものの配列を受け取る
def LLI(rows_number): return [LI() for _ in ... | [["-", 36, 36, 0, 656, 0, 57, 15, 666, 667, 47], ["+", 36, 36, 0, 656, 0, 57, 15, 666, 667, 20]] | 5 | 163 |
#include <bits/stdc++.h>
using namespace std;
#define sz(x) int(x.size())
#define pii pair<int, int>
#define Task "abc"
#define For(i, a, b) for (int i = (a), _b = (b); i <= b; ++i)
#define Debug(X) cout << #X << " = " << X << '\n'
#define All(x) (x).begin(), (x).end()
#define mp make_pair
typedef unsigned long long ... | #include <bits/stdc++.h>
using namespace std;
#define sz(x) int(x.size())
#define pii pair<int, int>
#define Task "abc"
#define For(i, a, b) for (int i = (a), _b = (b); i <= b; ++i)
#define Debug(X) cout << #X << " = " << X << '\n'
#define All(x) (x).begin(), (x).end()
#define mp make_pair
typedef unsigned long long ... | [["-", 0, 16, 12, 23, 0, 41, 64, 5, 0, 6], ["+", 0, 16, 12, 23, 0, 41, 64, 5, 0, 6], ["-", 0, 16, 12, 23, 0, 41, 75, 5, 0, 6], ["+", 0, 16, 12, 23, 0, 41, 75, 5, 0, 6]] | 1 | 226 |
#include <algorithm>
#include <iostream>
#include <math.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <vector>
using namespace std;
#define MAX(x, y) (x > y ? x : y)
#define MIN(x, y) (x < y ? x : y)
#define ABS(x) (x > 0 ? x : -(x))
#define INF 2147483647
#define LLINF 9223372036854775807
#d... | #include <algorithm>
#include <iostream>
#include <math.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <vector>
using namespace std;
#define MAX(x, y) (x > y ? x : y)
#define MIN(x, y) (x < y ? x : y)
#define ABS(x) (x > 0 ? x : -(x))
#define INF 2147483647
#define LLINF 9223372036854775807
#d... | [["+", 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 | 473 |
N,M = map(int,input().split())
A = list(map(int,input().split()))
A.sort()
if A[N - M] < 1/(4 * M):
print("No")
else:
print("Yes") | N,M = map(int,input().split())
A = list(map(int,input().split()))
A.sort()
if A[N - M] < sum(A)/(4 * M):
print("No")
else:
print("Yes") | [["-", 0, 656, 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 | 68 |
n, m = map(int, input().split())
arr = list(map(int, input().split()))
votes = sum(arr)
c = n
for i in arr:
if i < votes / (4 * m):
c -= 1
if c >= m:
print ('YES')
else:
print ('NO') |
n, m = map(int, input().split())
arr = list(map(int, input().split()))
votes = sum(arr)
c = n
for i in arr:
if i < votes / (4 * m):
c -= 1
if c >= m:
print ('Yes')
else:
print ('No') | [["-", 0, 1, 0, 652, 3, 4, 0, 557, 0, 6], ["+", 0, 1, 0, 652, 3, 4, 0, 557, 0, 6]] | 5 | 80 |
#include "bits/stdc++.h"
using namespace std;
const int MAX = 700000;
const int MOD = 1000000007;
long long fac[MAX], finv[MAX], inv[MAX];
// テーブルを作る前処理
void COMinit() {
fac[0] = fac[1] = 1;
finv[0] = finv[1] = 1;
inv[1] = 1;
for (int i = 2; i < MAX; i++) {
fac[i] = fac[i - 1] * i % MOD;
inv[i] = MOD ... | #include "bits/stdc++.h"
using namespace std;
const int MAX = 700000;
const int MOD = 1000000007;
long long fac[MAX], finv[MAX], inv[MAX];
// テーブルを作る前処理
void COMinit() {
fac[0] = fac[1] = 1;
finv[0] = finv[1] = 1;
inv[1] = 1;
for (int i = 2; i < MAX; i++) {
fac[i] = fac[i - 1] * i % MOD;
inv[i] = MOD ... | [["-", 8, 9, 0, 57, 15, 339, 51, 16, 17, 47], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 17, 20]] | 1 | 748 |
n,m = map(int, input().split())
a = list(map(int, input().split()))
count = 0
lim = 1/(4*m)
for num in a:
if num >= lim:
count+=1
if count >= m:
print('Yes')
else:
print('No') | n,m = map(int, input().split())
a = list(map(int, input().split()))
count = 0
lim = sum(a)/(4*m)
for num in a:
if num >= lim:
count+=1
if count >= m:
print('Yes')
else:
print('No') | [["-", 0, 656, 0, 1, 0, 662, 12, 657, 31, 612], ["+", 0, 1, 0, 662, 12, 657, 31, 652, 63, 22], ["+", 0, 662, 12, 657, 31, 652, 3, 4, 0, 24], ["+", 0, 662, 12, 657, 31, 652, 3, 4, 0, 22], ["+", 0, 662, 12, 657, 31, 652, 3, 4, 0, 25]] | 5 | 77 |
#include <bits/stdc++.h>
using namespace std;
#define repeat(i, a, b) for (int i = (a), _ = (b); i < _; i++)
#define repeat_back(i, a, b) for (int i = (b)-1, _ = (a); i >= _; i--)
#define mst(a, x) memset(a, x, sizeof(a))
#define vector basic_string
#define fi first
#define se second
#ifndef qwq
int cansel_sync = (ios:... | #include <bits/stdc++.h>
using namespace std;
#define repeat(i, a, b) for (int i = (a), _ = (b); i < _; i++)
#define repeat_back(i, a, b) for (int i = (b)-1, _ = (a); i >= _; i--)
#define mst(a, x) memset(a, x, sizeof(a))
#define vector basic_string
#define fi first
#define se second
#ifndef qwq
int cansel_sync = (ios:... | [["-", 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, 16, 17, 33], ["+", 0, 57, 15, 339, 51, 16, 12, 16, 12, 22]] | 1 | 486 |
#include <bits/stdc++.h>
using namespace std;
#define int long long
#define INF 9223372036854775807
signed main() {
int n, m;
cin >> n >> m;
int a[n];
int sum = 0;
for (int i = 0; i < n; i++) {
cin >> a[i];
sum += a[i];
}
int ans = 0;
for (int i = 0; i < n; i++) {
if (a[i] >= sum / (4 * m))... | #include <bits/stdc++.h>
using namespace std;
#define int long long
#define INF 9223372036854775807
signed main() {
int n;
double m;
cin >> n >> m;
double a[n];
double sum = 0;
for (int i = 0; i < n; i++) {
cin >> a[i];
sum += a[i];
}
double ans = 0;
for (int i = 0; i < n; i++) {
if (a[i]... | [["-", 0, 30, 0, 14, 8, 9, 0, 43, 0, 21], ["+", 0, 30, 0, 14, 8, 9, 0, 43, 0, 35], ["+", 0, 30, 0, 14, 8, 9, 0, 43, 39, 40], ["-", 0, 30, 0, 14, 8, 9, 0, 43, 39, 40]] | 1 | 134 |
// Problem Code: abc161_b
#include <bits/stdc++.h>
using namespace std;
string B(int N, int M, vector<int> &A) {
int n = ceil(accumulate(A.begin(), A.end(), 0.0) / (4 * M));
sort(A.rbegin(), A.rend());
for (int i = 0; i < M; i++)
if (A[i] <= n)
return "No";
return "Yes";
}
int main() {
int N, M;... | // Problem Code: abc161_b
#include <bits/stdc++.h>
using namespace std;
string B(int N, int M, vector<int> &A) {
int n = ceil(accumulate(A.begin(), A.end(), 0.0) / (4 * M));
sort(A.rbegin(), A.rend());
for (int i = 0; i < M; i++)
if (A[i] < n)
return "No";
return "Yes";
}
int main() {
int N, M;
... | [["-", 0, 7, 8, 57, 15, 339, 51, 16, 17, 19], ["+", 0, 7, 8, 57, 15, 339, 51, 16, 17, 18]] | 1 | 163 |
#include <bits/stdc++.h>
using intl = long long;
using ld = long double;
using namespace std;
#define rep(i, n) for (intl i = 0; i < (intl)(n); i++)
#define repd(i, n) for (intl i = (intl)(n); i >= 0; i--)
#define repi(i, a, b) for (intl i = (intl)(a); i < (intl)(b); i++)
#define repid(i, a, b) for (intl i = (intl)(a);... | #include <bits/stdc++.h>
using intl = long long;
using ld = long double;
using namespace std;
#define rep(i, n) for (intl i = 0; i < (intl)(n); i++)
#define repd(i, n) for (intl i = (intl)(n); i >= 0; i--)
#define repi(i, a, b) for (intl i = (intl)(a); i < (intl)(b); i++)
#define repid(i, a, b) for (intl i = (intl)(a);... | [["-", 0, 30, 0, 14, 8, 9, 0, 43, 39, 78], ["+", 0, 30, 0, 14, 8, 9, 0, 43, 39, 78], ["-", 49, 50, 51, 16, 12, 23, 0, 16, 31, 13], ["+", 49, 50, 51, 16, 12, 23, 0, 16, 31, 13]] | 1 | 431 |
#include "bits/stdc++.h"
#define REP(i, num) for (int i = 0; i < (num); ++i)
#define LOOP(i) while (i--)
#define ALL(c) c.begin(), c.end()
#define PRINTALL(c) \
for (auto pitr = c.begin(); pitr != c.end(); ++pitr) { \
cout << *pitr;... | #include "bits/stdc++.h"
#define REP(i, num) for (int i = 0; i < (num); ++i)
#define LOOP(i) while (i--)
#define ALL(c) c.begin(), c.end()
#define PRINTALL(c) \
for (auto pitr = c.begin(); pitr != c.end(); ++pitr) { \
cout << *pitr;... | [["+", 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 | 363 |
n, m = map(int, input().split())
a_list = [int(i) for i in input().split()]
a_sum = sum(a_list)
a_sorted = sorted(a_list)[::-1]
if a_sorted[m-1] > a_sum/m/4:
print('Yes')
else:
print('No') | n, m = map(int, input().split())
a_list = [int(i) for i in input().split()]
a_sum = sum(a_list)
a_sorted = sorted(a_list)[::-1]
if a_sorted[m-1] >= a_sum/m/4:
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 | 80 |
#include <algorithm>
#include <iostream>
#include <queue>
#include <string>
#include <vector>
using namespace std;
typedef pair<int, int> P;
typedef long long ll;
int main() {
int n, m;
int sumV = 0;
cin >> n >> m;
vector<int> a(n);
for (int i = 0; i < n; i++) {
cin >> a[i];
sumV += a[i];
}
... | #include <algorithm>
#include <iostream>
#include <queue>
#include <string>
#include <vector>
using namespace std;
typedef pair<int, int> P;
typedef long long ll;
int main() {
int n, m;
int sumV = 0;
cin >> n >> m;
vector<int> a(n);
for (int i = 0; i < n; i++) {
cin >> a[i];
sumV += a[i];
}
... | [["+", 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 | 148 |
N, M = map(int, input().split())
A = list(map(int, input().split()))
B = [x for x in A if x >= sum(A)//(4*M)]
print("Yes" if len(B) >= M else "No") | N, M = map(int, input().split())
A = list(map(int, input().split()))
B = [x for x in A if x >= sum(A)/(4*M)]
print("Yes" if len(B) >= M else "No") | [["-", 12, 658, 0, 678, 0, 666, 0, 657, 17, 676], ["+", 12, 658, 0, 678, 0, 666, 0, 657, 17, 85]] | 5 | 72 |
n,m = map(int,input().strip().split())
ls = list(map(int,input().strip().split()))
mini = sum(ls)//(4*m)
i = 0
while i<n and m>0:
if ls[i]>=mini:
m -= 1
i += 1
if m<=0:
print("Yes")
else:
print("No")
| n,m = map(int,input().strip().split())
ls = list(map(int,input().strip().split()))
mini = sum(ls)/(4*m)
i = 0
while i<n and m>0:
if ls[i]>=mini:
m -= 1
i += 1
if m<=0:
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 | 98 |
n,m = map(int,input().split())
a = []
a = list(map(int,input().split()))
b = sum(a)/(4.0*m)
c = 0
for i in range(n) :
if a[i]>=b :
c += 1
if c>=m :
print('YES')
else :
print('NO') | n,m = map(int,input().split())
a = []
a = list(map(int,input().split()))
b = sum(a)/(4.0*m)
c = 0
for i in range(n) :
if a[i]>=b :
c += 1
if c>=m :
print('Yes')
else :
print('No')
| [["-", 0, 1, 0, 652, 3, 4, 0, 557, 0, 6], ["+", 0, 1, 0, 652, 3, 4, 0, 557, 0, 6]] | 5 | 90 |
#include <bits/stdc++.h>
#define fr(i, n) for (int i = 0; i < (n); ++i)
#define foor(i, a, b) for (int i = (a); i <= (b); ++i)
#define rf(i, n) for (int i = (n); i-- > 0;)
#define roof(i, b, a) for (int i = (b); i >= (a); --i)
#define elsif else if
#define all(x) x.begin(), x.end()
#define Sort(x) sort(all(x))
#define ... | #include <bits/stdc++.h>
#define fr(i, n) for (int i = 0; i < (n); ++i)
#define foor(i, a, b) for (int i = (a); i <= (b); ++i)
#define rf(i, n) for (int i = (n); i-- > 0;)
#define roof(i, b, a) for (int i = (b); i >= (a); --i)
#define elsif else if
#define all(x) x.begin(), x.end()
#define Sort(x) sort(all(x))
#define ... | [["-", 31, 16, 31, 69, 341, 342, 0, 16, 17, 72], ["-", 31, 69, 341, 342, 0, 16, 12, 91, 17, 92], ["+", 31, 16, 31, 69, 341, 342, 0, 16, 17, 33]] | 1 | 6,271 |
#include <bits/stdc++.h>
using namespace std;
////////////////////////////// Begin Macros
#define all(x) (x).begin(), (x).end()
#define rep(i, N) for (int i = 0; i < (int)(N); i++)
#define reps(i, s, N) for (int i = (s); i < (int)(N); i++)
#define reprev(i, N) for (int i = N - 1; i >= 0; i--)
#define rep1(i, N) for... | #include <bits/stdc++.h>
using namespace std;
////////////////////////////// Begin Macros
#define all(x) (x).begin(), (x).end()
#define rep(i, N) for (int i = 0; i < (int)(N); i++)
#define reps(i, s, N) for (int i = (s); i < (int)(N); i++)
#define reprev(i, N) for (int i = N - 1; i >= 0; i--)
#define rep1(i, N) for... | [["-", 12, 23, 0, 41, 15, 23, 0, 16, 17, 47], ["+", 12, 23, 0, 41, 15, 23, 0, 16, 17, 20]] | 1 | 1,126 |
#include <bits/stdc++.h>
using namespace std;
#define lli long long int
#define uli unsigned long long int
#define INF 999999999999999999
#define rep(i, m, n) for (lli i = m; i < n; i++)
#define rrep(i, m, n) for (lli i = m - 1; i >= n; i--)
#define pb(n) push_back(n)
#define UE(N) N.erase(unique(N.begin(), N.end()), N... | #include <bits/stdc++.h>
using namespace std;
#define lli long long int
#define uli unsigned long long int
#define INF 999999999999999999
#define rep(i, m, n) for (lli i = m; i < n; i++)
#define rrep(i, m, n) for (lli i = m - 1; i >= n; i--)
#define pb(n) push_back(n)
#define UE(N) N.erase(unique(N.begin(), N.end()), N... | [["-", 12, 16, 31, 16, 12, 23, 0, 16, 12, 22], ["+", 12, 16, 31, 16, 12, 23, 0, 16, 12, 22], ["-", 0, 11, 12, 16, 12, 23, 0, 16, 12, 22], ["+", 0, 11, 12, 16, 12, 23, 0, 16, 12, 22]] | 1 | 352 |
#include <algorithm>
#include <cmath>
#include <iomanip>
#include <iostream>
#include <queue>
#include <vector>
using namespace std;
using ll = long long;
using pii = pair<int, int>;
using vi = vector<int>;
template <class T> using vv = vector<vector<T>>;
#define in(v) ... | #include <algorithm>
#include <cmath>
#include <iomanip>
#include <iostream>
#include <queue>
#include <vector>
using namespace std;
using ll = long long;
using pii = pair<int, int>;
using vi = vector<int>;
template <class T> using vv = vector<vector<T>>;
#define in(v) ... | [["-", 8, 9, 0, 57, 15, 339, 51, 16, 17, 47], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 17, 20]] | 1 | 547 |
#include "bits/stdc++.h"
using namespace std;
int n, m, cnt = 0, res = 0;
vector<int> v;
int main() {
cin >> n >> m;
v.assign(n, 0);
for (int i = 0; i < n; ++i) {
cin >> v[i];
cnt += v[i];
}
sort(v.begin(), v.end());
for (int i = 0; i < n; ++i) {
if (v[i] >= cnt / (4 * m)) {
res++;
}... | #include "bits/stdc++.h"
using namespace std;
int n, m, cnt = 0, res = 0;
vector<int> v;
int main() {
cin >> n >> m;
v.assign(n, 0);
for (int i = 0; i < n; ++i) {
cin >> v[i];
cnt += v[i];
}
sort(v.begin(), v.end());
for (int i = 0; i < n; ++i) {
if (v[i] >= cnt / (4.0 * m)) {
res++;
... | [["-", 51, 16, 12, 16, 12, 23, 0, 16, 31, 13], ["+", 51, 16, 12, 16, 12, 23, 0, 16, 31, 13]] | 1 | 148 |
n, m = map(int, input().split())
a = list(map(int, input().split()))
cnt = 0
a.sort()
a.reverse()
for i in a:
if i >= sum(a) / (4 * m):
cnt += 1
else:
if cnt >= m:
print("Yes")
else:
print("No")
exit() | n, m = map(int, input().split())
a = list(map(int, input().split()))
cnt = 0
a.sort()
a.reverse()
for i in a:
if i >= sum(a) / (4 * m):
cnt += 1
if cnt >= m:
print("Yes")
else:
print("No")
exit() | [["-", 0, 7, 8, 196, 0, 57, 75, 76, 0, 95], ["-", 0, 7, 8, 196, 0, 57, 75, 76, 0, 102]] | 5 | 92 |
#include <iostream>
#include <vector>
using namespace std;
int main() {
int n, m;
cin >> n >> m;
vector<int> a(n);
for (int i = 0; i < n; i++)
cin >> a[i];
int count = 0;
int lim = 0;
for (int i = 0; i < n; i++)
lim += a[i];
lim = lim / (4 * m);
for (int i = 0; i < n; i++) {
if (a[i] >= l... | #include <iostream>
#include <vector>
using namespace std;
int main() {
int n, m;
cin >> n >> m;
vector<int> a(n);
for (int i = 0; i < n; i++)
cin >> a[i];
int count = 0;
double lim = 0;
for (int i = 0; i < n; i++)
lim += a[i];
lim = lim / (4 * m);
for (int i = 0; i < n; i++) {
if ((doubl... | [["-", 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 | 150 |
#include <bits/stdc++.h>
using namespace std;
#define rep(i, a, b) for (int i = int(a); i < int(b); i++)
typedef long long ll;
int main() {
ll n, m;
cin >> n >> m;
ll a[100010], sum = 0, cn = 0;
rep(i, 0, n) {
cin >> a[i];
sum += a[i];
}
rep(i, 0, n) {
if (a[i] >= sum / 4 / m)
cn++;
}
... | #include <bits/stdc++.h>
using namespace std;
#define rep(i, a, b) for (int i = int(a); i < int(b); i++)
typedef long long ll;
int main() {
ll n, m;
cin >> n >> m;
ll a[100010], sum = 0, cn = 0;
rep(i, 0, n) {
cin >> a[i];
sum += a[i];
}
rep(i, 0, n) {
if (a[i] >= (double)sum / (4 * m))
c... | [["+", 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], ["+", 15, 339, 51, 16, 12, 16, 12, 23, 0, 24], ["-", 0, 57, 15, 339, 51, 16, 12, 16, 17, 85], ["+", 51, 16, 12, 16, 12, 23, 0, 16, 17, 48], ["+", 15, 339, 51, 16, 12, 16, 12, 23,... | 1 | 127 |
#include <bits/stdc++.h>
using namespace std;
int main() {
int n, m;
cin >> n >> m;
vector<int> a(n);
int i;
for (i = 0; i < n; i++)
cin >> a[i];
int total = 0;
for (i = 0; i < n; i++)
total += a[i];
int cnt = n;
for (i = 0; i < n; i++) {
if (a[i] >= (double)(total) / (4 * m))
cnt++;... | #include <bits/stdc++.h>
using namespace std;
int main() {
int n, m;
cin >> n >> m;
vector<int> a(n);
int i;
for (i = 0; i < n; i++)
cin >> a[i];
int total = 0;
for (i = 0; i < n; i++)
total += a[i];
int cnt = 0;
for (i = 0; i < n; i++) {
if (a[i] >= (double)(total) / (4 * m))
cnt++;... | [["-", 0, 14, 8, 9, 0, 43, 49, 50, 51, 22], ["+", 0, 14, 8, 9, 0, 43, 49, 50, 51, 13]] | 1 | 146 |
#pragma GCC optimize("O3")
#include <algorithm>
#include <cmath>
#include <cstring>
#include <iostream>
#include <map>
#include <numeric>
#include <set>
#include <stack>
#include <stdio.h>
#include <unordered_map>
#include <vector>
#define lld long long int
#define dbg1(vari1) cerr << #vari1 << " = " << (vari1) << endl... | #pragma GCC optimize("O3")
#include <algorithm>
#include <cmath>
#include <cstring>
#include <iostream>
#include <map>
#include <numeric>
#include <set>
#include <stack>
#include <stdio.h>
#include <unordered_map>
#include <vector>
#define lld long long int
#define dbg1(vari1) cerr << #vari1 << " = " << (vari1) << endl... | [["-", 0, 30, 0, 14, 8, 9, 0, 43, 39, 40], ["+", 0, 30, 0, 14, 8, 9, 0, 43, 39, 40], ["+", 49, 50, 51, 16, 31, 23, 0, 74, 0, 24], ["+", 51, 16, 31, 23, 0, 74, 39, 77, 39, 40], ["+", 49, 50, 51, 16, 31, 23, 0, 74, 0, 25]] | 1 | 177 |
#include <algorithm>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <fstream>
#include <functional>
#include <iostream>
#include <list>
#include <map>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <vector>
typedef long long ll;
const ll... | #include <algorithm>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <fstream>
#include <functional>
#include <iostream>
#include <list>
#include <map>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <vector>
typedef long long ll;
const ll... | [["-", 0, 30, 0, 14, 8, 9, 0, 43, 39, 78], ["+", 0, 30, 0, 14, 8, 9, 0, 43, 39, 40]] | 1 | 251 |
N, M = list(map(int, input().split()))
A = sorted(list(map(int, input().split())))[::-1]
th = sum(A)/4/M
if A[M-1]>th:
print('Yes')
else:
print('No') | N, M = list(map(int, input().split()))
A = sorted(list(map(int, input().split())))[::-1]
th = sum(A)/4/M
if A[M-1]>=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 | 79 |
#include <bits/stdc++.h>
using namespace std;
int main() {
int n, m;
cin >> n >> m;
int a[n];
int sum = 0;
for (int i = 0; i < n; i++) {
cin >> a[i];
sum += a[i];
}
int count = 0;
for (int i = 0; i < n; i++) {
if (a[i] * 4 * m > sum)
count++;
}
if (count > m)
cout << "Yes" << ... | #include <bits/stdc++.h>
using namespace std;
int main() {
int n, m;
cin >> n >> m;
int a[n];
int sum = 0;
for (int i = 0; i < n; i++) {
cin >> a[i];
sum += a[i];
}
int count = 0;
for (int i = 0; i < n; i++) {
if (a[i] * 4 * m >= sum)
count++;
}
if (count >= m)
cout << "Yes" <... | [["-", 8, 9, 0, 57, 15, 339, 51, 16, 17, 47], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 17, 20]] | 1 | 124 |
#include <algorithm>
#include <bitset>
#include <cassert>
#include <cmath>
#include <complex>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <deque>
#include <iomanip>
#include <iostream>
#include <iterator>
#include <list>
#include <map>
#include <math.h>
#include <numeric>
#include <queue>
#include ... | #include <algorithm>
#include <bitset>
#include <cassert>
#include <cmath>
#include <complex>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <deque>
#include <iomanip>
#include <iostream>
#include <iterator>
#include <list>
#include <map>
#include <math.h>
#include <numeric>
#include <queue>
#include ... | [["+", 8, 9, 0, 43, 49, 50, 51, 2, 63, 22], ["+", 3, 4, 0, 16, 12, 2, 63, 23, 0, 24], ["+", 3, 4, 0, 16, 12, 2, 63, 23, 0, 22], ["+", 3, 4, 0, 16, 12, 2, 63, 23, 0, 25]] | 1 | 330 |
#include <bits/stdc++.h>
#include <cmath>
#define pb push_back
#define ll long long
#define ull unsigned long long
#define deb(x) cerr << #x << " " << x << "\n"
#define debi cerr << "hey sparky\n"
#define x first
#define y second
#define nax (int)1e5 + 2
#define fast ios::sync_with_stdio(0), cin.tie(0), cout.tie(0)
#de... | #include <bits/stdc++.h>
#include <cmath>
#define pb push_back
#define ll long long
#define ull unsigned long long
#define deb(x) cerr << #x << " " << x << "\n"
#define debi cerr << "hey sparky\n"
#define x first
#define y second
#define nax (int)1e5 + 2
#define fast ios::sync_with_stdio(0), cin.tie(0), cout.tie(0)
#de... | [["-", 64, 9, 0, 1, 0, 16, 12, 5, 0, 6], ["+", 64, 9, 0, 1, 0, 16, 12, 5, 0, 6], ["-", 0, 9, 0, 1, 0, 16, 12, 5, 0, 6], ["+", 0, 9, 0, 1, 0, 16, 12, 5, 0, 6]] | 1 | 192 |
n,m=map(int,input().split())
arr=list(map(int,input().split()))
arr=sorted(arr,reverse=True)
cnt=0
for val in arr:
if val*4*m>sum(arr):
cnt+=1
if cnt>=m:
print('Yes')
else:
print('No') | n,m=map(int,input().split())
arr=list(map(int,input().split()))
arr=sorted(arr,reverse=True)
cnt=0
for val in arr:
if val*4*m>=sum(arr):
cnt+=1
if cnt>=m:
print('Yes')
else:
print('No') | [["-", 0, 7, 8, 196, 0, 57, 15, 666, 667, 47], ["+", 0, 7, 8, 196, 0, 57, 15, 666, 667, 20]] | 5 | 85 |
import sys
sys.setrecursionlimit(10 ** 7)
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
N, M = map(int, input().split())
A = list(map(int, input().split()))
S = sum(A)
m = S // (4 * M)
cnt = 0
for a in A:
if a < m:
continue
cnt += 1
if cnt >... | import sys
sys.setrecursionlimit(10 ** 7)
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
N, M = map(int, input().split())
A = list(map(int, input().split()))
S = sum(A)
m = S / (4 * M)
cnt = 0
for a in A:
if a < m:
continue
cnt += 1
if cnt >=... | [["-", 0, 656, 0, 1, 0, 662, 12, 657, 17, 676], ["+", 0, 656, 0, 1, 0, 662, 12, 657, 17, 85]] | 5 | 121 |
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define rrep(i, n) for (int i = (int)(n - 1); i >= 0; i--)
#define all(x) (x).begin(), (x).end()
#define sz(x) int(x.size())
#define get_unique(x) x.erase(unique(all(x)), x.end());
#define fout cout << fixed << setprecisi... | #include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define rrep(i, n) for (int i = (int)(n - 1); i >= 0; i--)
#define all(x) (x).begin(), (x).end()
#define sz(x) int(x.size())
#define get_unique(x) x.erase(unique(all(x)), x.end());
#define fout cout << fixed << setprecisi... | [["-", 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], ["-", 15, 16, 12, 16, 12, 23, 0, 16, 31, 13], ["+", 15, 16, 12, 16, 12, 23, 0, 16, 31, 13]] | 1 | 320 |
#include <algorithm>
#include <iostream>
#include <vector>
using namespace std;
int main() {
int N, M;
cin >> N >> M;
vector<int> A(N);
int i;
int sum = 0;
for (i = 0; i < N; i++) {
cin >> A[i];
sum += A[i];
}
sort(A.begin(), A.end(), greater<int>());
cout << (A[M - 1] >= sum / (4 * M) ? "Yes"... | #include <algorithm>
#include <iostream>
#include <vector>
using namespace std;
int main() {
int N, M;
cin >> N >> M;
vector<int> A(N);
int i;
int sum = 0;
for (i = 0; i < N; i++) {
cin >> A[i];
sum += A[i];
}
sort(A.begin(), A.end(), greater<int>());
cout << (A[M - 1] >= (double)sum / (4 * M)... | [["+", 0, 41, 15, 16, 12, 16, 31, 74, 0, 24], ["+", 15, 16, 12, 16, 31, 74, 39, 77, 39, 40], ["+", 0, 41, 15, 16, 12, 16, 31, 74, 0, 25]] | 1 | 124 |
############ ---- USER DEFINED INPUT FUNCTIONS ---- ############
def inp():
return(int(input().rstrip()))
def inlt():
return(list(map(int,input().rstrip().split())))
def insr():
s = input().rstrip()
return(s[:len(s) - 1])
def invr():
return(map(int,input().rstrip().split()))
######################... |
############ ---- USER DEFINED INPUT FUNCTIONS ---- ############
def inp():
return(int(input().rstrip()))
def inlt():
return(list(map(int,input().rstrip().split())))
def insr():
s = input().rstrip()
return(s[:len(s) - 1])
def invr():
return(map(int,input().rstrip().split()))
######################... | [["-", 0, 656, 0, 1, 0, 662, 12, 657, 17, 676], ["+", 0, 656, 0, 1, 0, 662, 12, 657, 17, 85]] | 5 | 176 |
n,m = map(int,input().split())
a = list(map(int,input().split()))
al = sum(a)
count = 0
for i in range(n):
if a[i] <al/(4*m):
count += 1
if count >= m:
print("Yes")
else:
print("No") | n,m = map(int,input().split())
a = list(map(int,input().split()))
al = sum(a)
count = 0
for i in range(n):
if a[i] >=al/(4*m):
count += 1
if count >= m:
print("Yes")
else:
print("No") | [["-", 0, 7, 8, 196, 0, 57, 15, 666, 667, 18], ["+", 0, 7, 8, 196, 0, 57, 15, 666, 667, 20]] | 5 | 86 |
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
int main() {
cin.tie(0);
ios::sync_with_stdio(false);
int N, M;
cin >> N >> M;
vector<int> A(N);
int count = 0;
for (int i = 0; i < N; i++) {
cin >> A[i];
count += A[i];
}
sort(A.begin(), A.end(), greater<int>());
i... | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
int main() {
cin.tie(0);
ios::sync_with_stdio(false);
int N, M;
cin >> N >> M;
vector<double> A(N);
double count = 0;
for (int i = 0; i < N; i++) {
cin >> A[i];
count += A[i];
}
sort(A.begin(), A.end(), greater<double>... | [["-", 0, 43, 39, 344, 3, 347, 0, 77, 39, 40], ["+", 0, 43, 39, 344, 3, 347, 0, 77, 39, 40], ["-", 0, 30, 0, 14, 8, 9, 0, 43, 39, 40], ["+", 0, 30, 0, 14, 8, 9, 0, 43, 39, 40], ["-", 0, 2, 63, 346, 3, 347, 0, 77, 39, 40], ["+", 0, 2, 63, 346, 3, 347, 0, 77, 39, 40]] | 1 | 165 |
n,m=map(int,input().split())
A = sorted(list(map(int,input().split())))[::-1]
s = sum(A)
print('Yes' if A[m-1]>=s//(4*m) else 'No') | n,m=map(int,input().split())
A = sorted(list(map(int,input().split())))[::-1]
s = sum(A)
print('Yes' if A[m-1]>=s/(4*m) else 'No') | [["-", 3, 4, 0, 41, 0, 666, 0, 657, 17, 676], ["+", 3, 4, 0, 41, 0, 666, 0, 657, 17, 85]] | 5 | 73 |
#include <bits/stdc++.h>
#define MAX_NUM (1000000000 + 7)
typedef uint64_t u64;
typedef int64_t i64;
typedef uint32_t u32;
typedef int32_t i32;
using namespace std;
template <typename T> static inline void ArrayInput(vector<T> &A) {
for (auto itr = A.begin(); itr < A.end(); ++itr)
cin >> *itr;
}
template <ty... | #include <bits/stdc++.h>
#define MAX_NUM (1000000000 + 7)
typedef uint64_t u64;
typedef int64_t i64;
typedef uint32_t u32;
typedef int32_t i32;
using namespace std;
template <typename T> static inline void ArrayInput(vector<T> &A) {
for (auto itr = A.begin(); itr < A.end(); ++itr)
cin >> *itr;
}
template <ty... | [["-", 0, 30, 0, 14, 8, 9, 0, 43, 39, 78], ["+", 0, 30, 0, 14, 8, 9, 0, 43, 39, 40]] | 1 | 420 |
#include <iostream>
#include <vector>
using namespace std;
int main() {
// your code goes here
int n, m;
long long a = 0;
cin >> n >> m;
vector<int> v(n);
for (int i = 0; i < n; i++) {
cin >> v[i];
a += v[i];
}
int c = 0;
for (int i = 0; i < n; i++) {
if (4 * m * v[i] >= 1)
c++;
}... | #include <iostream>
#include <vector>
using namespace std;
int main() {
// your code goes here
int n, m;
long long a = 0;
cin >> n >> m;
vector<int> v(n);
for (int i = 0; i < n; i++) {
cin >> v[i];
a += v[i];
}
int c = 0;
for (int i = 0; i < n; i++) {
if (4 * m * v[i] >= a)
c++;
}... | [["-", 8, 9, 0, 57, 15, 339, 51, 16, 12, 13], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 12, 22]] | 1 | 134 |
#include <bits/stdc++.h>
using namespace std;
int a[2001];
int main() {
int n, m;
cin >> n >> m;
int s = 0;
for (int i = 0; i < n; ++i) {
cin >> a[i];
s += a[i];
}
sort(a, a + n);
if (a[n - m] >= (s + 4 * m - 1) / (4 * m))
cout << "YES\n";
else
cout << "NO\n";
} | #include <bits/stdc++.h>
using namespace std;
int a[2001];
int main() {
int n, m;
cin >> n >> m;
int s = 0;
for (int i = 0; i < n; ++i) {
cin >> a[i];
s += a[i];
}
sort(a, a + n);
if (a[n - m] >= (s + 4 * m - 1) / (4 * m))
cout << "Yes\n";
else
cout << "No\n";
} | [["-", 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 | 113 |
n,m = map(int, input().split())
a = list(map(int, input().split()))
a.sort(reverse = True)
if a[m] * 4*m >= sum(a):
print('Yes')
else:
print('No') | n,m = map(int, input().split())
a = list(map(int, input().split()))
a.sort(reverse = True)
if a[m-1] * 4*m >= sum(a):
print('Yes')
else:
print('No') | [["+", 0, 657, 31, 657, 31, 206, 206, 657, 17, 33], ["+", 0, 657, 31, 657, 31, 206, 206, 657, 12, 612]] | 5 | 70 |
#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define IOS \
ios_base::sync_with_stdio(false); \
cin.tie(NULL); \
cout.tie... | #include <bits/stdc++.h>
using namespace std;
#define ll long long
#define IOS \
ios_base::sync_with_stdio(false); \
cin.tie(NULL); \
cout.tie... | [["-", 0, 30, 0, 14, 8, 9, 0, 43, 39, 78], ["+", 0, 30, 0, 14, 8, 9, 0, 43, 39, 40], ["+", 0, 1, 0, 11, 12, 16, 12, 74, 0, 24], ["+", 0, 11, 12, 16, 12, 74, 39, 77, 39, 40], ["+", 0, 1, 0, 11, 12, 16, 12, 74, 0, 25]] | 1 | 220 |
#import sys
MOD = 10 ** 9 + 7
INFI = 10**10
#input = sys.stdin.readline
import math
import itertools
import heapq
#import bisect
import copy
from functools import lru_cache
def sosuhante(n):
for k in range(2, int(math.sqrt(n))+1):
if n% k ==0:
return False
return True
def cmb(n, r):
i... | #import sys
MOD = 10 ** 9 + 7
INFI = 10**10
#input = sys.stdin.readline
import math
import itertools
import heapq
#import bisect
import copy
from functools import lru_cache
def sosuhante(n):
for k in range(2, int(math.sqrt(n))+1):
if n% k ==0:
return False
return True
def cmb(n, r):
i... | [["+", 0, 57, 15, 666, 0, 206, 206, 657, 17, 33], ["+", 0, 57, 15, 666, 0, 206, 206, 657, 12, 612]] | 5 | 456 |
#C
N, K = map(int,input().split())
if N%K==0:
print(0)
else:
print(min(N%K,-N%(K+1))) | #C
N, K = map(int,input().split())
if N%K==0:
print(0)
else:
print(min(N%K,-(N%(K)-K))) | [["+", 0, 652, 3, 4, 0, 664, 28, 23, 0, 24], ["-", 3, 4, 0, 657, 12, 23, 0, 657, 17, 72], ["-", 3, 4, 0, 657, 12, 23, 0, 657, 12, 612], ["+", 28, 23, 0, 657, 31, 657, 12, 23, 0, 25], ["+", 3, 4, 0, 664, 28, 23, 0, 657, 17, 33], ["+", 3, 4, 0, 664, 28, 23, 0, 657, 12, 22]] | 5 | 48 |
#include <bits/stdc++.h>
using namespace std;
int main() {
cin.tie(0);
cout.tie(0);
ios_base::sync_with_stdio(0);
long long n, k;
cin >> n >> k;
n %= k;
cout << min(n, n - k);
} | #include <bits/stdc++.h>
using namespace std;
int main() {
cin.tie(0);
cout.tie(0);
ios_base::sync_with_stdio(0);
long long n, k;
cin >> n >> k;
n %= k;
cout << min(n, abs(n - k));
} | [["+", 0, 16, 12, 2, 3, 4, 0, 2, 63, 22], ["+", 12, 2, 3, 4, 0, 2, 3, 4, 0, 24], ["+", 12, 2, 3, 4, 0, 2, 3, 4, 0, 25]] | 1 | 60 |
#include <bits/stdc++.h>
#define ll long long
#define pi 3.14159265358979
#define mod 1000000007
#define rep(i, n) for (ll i = 0; i < n; i++)
using namespace std;
int main() {
ll n, k;
cin >> n >> k;
if (n >= k) {
n -= (n / k) * k;
if (n > abs(k - n)) {
n = abs(k - n);
}
}
cout << n;
} | #include <bits/stdc++.h>
#define ll long long
#define pi 3.14159265358979
#define mod 1000000007
#define rep(i, n) for (ll i = 0; i < n; i++)
using namespace std;
int main() {
ll n, k;
cin >> n >> k;
if (n >= k) {
n -= (n / k) * k;
}
if (n > abs(k - n)) {
n = abs(k - n);
}
cout << n;
} | [["+", 0, 14, 8, 9, 0, 57, 64, 9, 0, 46], ["-", 0, 57, 64, 9, 0, 57, 64, 9, 0, 46]] | 1 | 84 |
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
const long long INF = 1LL << 60;
int main() {
ll N, K;
cin >> N >> K;
ll min_value = INF;
if (N >= K) {
N = N % K;
min_value = min(min_value, N);
}
if (N <= K) {
N = K - N;
min_value = min(min_value, N);
}
cout << min_v... | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
const long long INF = 1LL << 60;
int main() {
ll N, K;
cin >> N >> K;
ll min_value = N;
if (N >= K) {
N = N % K;
min_value = min(min_value, N);
}
if (N <= K) {
N = K - N;
min_value = min(min_value, N);
}
cout << min_val... | [["-", 0, 14, 8, 9, 0, 43, 49, 50, 51, 22], ["+", 0, 14, 8, 9, 0, 43, 49, 50, 51, 22]] | 1 | 95 |
#include <stdio.h>
int main() {
long long int n, k;
scanf("%d%d", &n, &k);
if (n % k <= k - (n % k))
printf("%d\n", n % k);
else
printf("%d\n", k - (n % k));
return 0;
}
| #include <stdio.h>
int main() {
long long int n, k;
scanf("%lld%lld", &n, &k);
if (n % k <= k - (n % k))
printf("%lld\n", n % k);
else
printf("%lld\n", k - (n % k));
return 0;
}
| [["-", 0, 1, 0, 2, 3, 4, 0, 5, 0, 6], ["+", 0, 1, 0, 2, 3, 4, 0, 5, 0, 6], ["-", 64, 1, 0, 2, 3, 4, 0, 5, 0, 6], ["+", 64, 1, 0, 2, 3, 4, 0, 5, 0, 6]] | 0 | 74 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.