buggy_code
stringlengths
11
625k
fixed_code
stringlengths
17
625k
bug_type
stringlengths
2
4.45k
language
int64
0
8
token_count
int64
5
200k
N, K = map(int,input().split()) A = list(map(int,input().split())) for i in range(K+1, N+1): print('Yes') if A[i - K] < A[i] else print('No')
N, K = map(int,input().split()) A = list(map(int,input().split())) for i in range(K, N): print('Yes') if A[i - K] < A[i] else print('No')
[["-", 0, 7, 12, 652, 3, 4, 0, 657, 17, 72], ["-", 0, 7, 12, 652, 3, 4, 0, 657, 12, 612]]
5
72
#include <bits/stdc++.h> using namespace std; int main() { int n, k; cin >> n >> k; int score[n]; for (int i = 0; i < n; i++) { cin >> score[i]; } for (int i = k + 1; i < n; i++) { if (score[i] > score[i - k]) { cout << "Yes" << endl; } else { cout << "No" << endl; } } retur...
#include <bits/stdc++.h> using namespace std; int main() { long long n, k; cin >> n >> k; long long score[n]; for (int i = 0; i < n; i++) { cin >> score[i]; } for (int i = k; i < n; i++) { if (score[i] > score[i - k]) { cout << "Yes" << endl; } else { cout << "No" << endl; } }...
[["-", 0, 30, 0, 14, 8, 9, 0, 43, 39, 40], ["+", 0, 14, 8, 9, 0, 43, 39, 86, 0, 96], ["-", 0, 7, 10, 43, 49, 50, 51, 16, 17, 72], ["-", 0, 7, 10, 43, 49, 50, 51, 16, 12, 13]]
1
108
#include <bits/stdc++.h> #define _GLIBCXX_DEBUG #define rep(i, n) for (int i = 0; i < (n); ++i) #define repi(i, a, b) for (int i = int(a); i < int(b); ++i) #define all(x) (x).begin(), (x).end() using namespace std; typedef long long ll; typedef long double ld; int main() { ll n, k; cin >> n >> k; int a[n]; rep(...
#include <bits/stdc++.h> #define _GLIBCXX_DEBUG #define rep(i, n) for (int i = 0; i < (n); ++i) #define repi(i, a, b) for (int i = int(a); i < int(b); ++i) #define all(x) (x).begin(), (x).end() using namespace std; typedef long long ll; typedef long double ld; int main() { int n, k; cin >> n >> k; int a[n]; rep...
[["-", 0, 30, 0, 14, 8, 9, 0, 43, 39, 78], ["+", 0, 30, 0, 14, 8, 9, 0, 43, 39, 40], ["-", 0, 1, 0, 2, 3, 4, 0, 16, 17, 33], ["-", 0, 1, 0, 2, 3, 4, 0, 16, 12, 22], ["-", 0, 1, 0, 2, 3, 4, 0, 25, 0, 35]]
1
123
N,K=map(int,input().split()) a=list(map(int,input().split())) for v in range(K-1): if a[v]>=a[K+v]: print("No") else: print("Yes")
N,K=map(int,input().split()) a=list(map(int,input().split())) for v in range(N-K): if a[v]>=a[K+v]: print("No") else: print("Yes")
[["-", 0, 7, 12, 652, 3, 4, 0, 657, 31, 22], ["+", 0, 7, 12, 652, 3, 4, 0, 657, 31, 22], ["-", 0, 7, 12, 652, 3, 4, 0, 657, 12, 612], ["+", 0, 7, 12, 652, 3, 4, 0, 657, 12, 22]]
5
70
#include <bits/stdc++.h> using namespace std; typedef long long ll; typedef pair<ll, ll> pll; typedef vector<ll> vll; #define INX(x) (cin >> x) #define OUTX(x) (cout << x << endl) #define ADD emplace_back #define MP make_pair #define VVEC(type) vector<vector<type>> int main() { ll N, K; cin >> N >> K; vll A(N...
#include <bits/stdc++.h> using namespace std; typedef long long ll; typedef pair<ll, ll> pll; typedef vector<ll> vll; #define INX(x) (cin >> x) #define OUTX(x) (cout << x << endl) #define ADD emplace_back #define MP make_pair #define VVEC(type) vector<vector<type>> int main() { ll N, K; cin >> N >> K; vll A(N...
[["-", 31, 16, 12, 23, 0, 41, 64, 5, 0, 6], ["+", 31, 16, 12, 23, 0, 41, 64, 5, 0, 6], ["-", 31, 16, 12, 23, 0, 41, 75, 5, 0, 6], ["+", 31, 16, 12, 23, 0, 41, 75, 5, 0, 6]]
1
150
def main(): n,k = map(int,input().split()) a = list(map(int,input().split())) ans = [] for i in range(k,n): ans.append("Yes" if a[i] > a[i-k] else "No") print("/n".join(ans)) if __name__ == '__main__': main()
def main(): n,k = map(int,input().split()) a = list(map(int,input().split())) ans = [] for i in range(k,n): ans.append("Yes" if a[i] > a[i-k] else "No") print("\n".join(ans)) if __name__ == '__main__': main()
[["-", 3, 4, 0, 652, 63, 319, 500, 557, 0, 6], ["+", 0, 652, 63, 319, 500, 557, 0, 6, 0, 44]]
5
97
N,K=[int(x) for x in input().split()] A=[int(x) for x in input().split()] for x in range(K,N): if a[x]>a[x-K]: print("Yes") else: print("No")
N,K=[int(x) for x in input().split()] a=[int(x) for x in input().split()] for x in range(K,N): if a[x]>a[x-K]: print("Yes") else: print("No")
[["-", 36, 36, 0, 656, 0, 1, 0, 662, 31, 22], ["+", 36, 36, 0, 656, 0, 1, 0, 662, 31, 22]]
5
75
#include <bits/stdc++.h> #define ll long long int using namespace std; int main() { ios_base::sync_with_stdio(false); cin.tie(NULL); ll n, k; cin >> n >> k; ll a[n]; ll i; for (i = 0; i < n; i++) cin >> a[i]; i = 0; ll j = k; ll i1; for (i1 = 0; i1 < n - k; i1++) { if (a[i] > a[j]) { ...
#include <bits/stdc++.h> #define ll long long int using namespace std; int main() { ios_base::sync_with_stdio(false); cin.tie(NULL); ll n, k; cin >> n >> k; ll a[n]; ll i; for (i = 0; i < n; i++) cin >> a[i]; i = 0; ll j = k; ll i1; for (i1 = 0; i1 < n - k; i1++) { if (a[j] > a[i]) { ...
[["-", 15, 339, 51, 16, 31, 69, 341, 342, 0, 22], ["+", 15, 339, 51, 16, 31, 69, 341, 342, 0, 22], ["-", 15, 339, 51, 16, 12, 69, 341, 342, 0, 22], ["+", 15, 339, 51, 16, 12, 69, 341, 342, 0, 22], ["-", 0, 1, 0, 16, 31, 16, 12, 5, 0, 6], ["+", 0, 1, 0, 16, 31, 16, 12, 5, 0, 6]]
1
138
NK = list(map(int, input().split(' '))) N = NK[0] K = NK[1] A = list(map(int, input().split(' '))) for i in range(K, N): if (A[i-k] < A[i]): print('Yes') else: print('No')
NK = list(map(int, input().split(' '))) N = NK[0] K = NK[1] A = list(map(int, input().split(' '))) for i in range(K, N): if (A[i-K] < A[i]): print('Yes') else: print('No')
[["-", 15, 23, 0, 666, 0, 206, 206, 657, 12, 22], ["+", 15, 23, 0, 666, 0, 206, 206, 657, 12, 22]]
5
91
#include <iostream> using namespace std; typedef long long ll; int main() { ll n, k; cin >> n >> k; ll arr[n]; for (int i = 1; i <= n; ++i) cin >> arr[i]; for (int i = k + 1; i <= n; ++i) { if (arr[i - k] < arr[i]) cout << "YES" << endl; else cout << "NO" << endl; } return 0; }
#include <iostream> using namespace std; typedef long long ll; int main() { ll n, k; cin >> n >> k; ll arr[n]; for (int i = 1; i <= n; ++i) cin >> arr[i]; for (int i = k + 1; i <= n; ++i) { if (arr[i - k] < arr[i]) cout << "Yes" << endl; else cout << "No" << endl; } return 0; }
[["-", 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
107
n, k = map(int, input().split()) a = list(map(int, input().split())) for i in range(k, n): if a[i] > a[i - 1]: print("Yes") else: print("No")
n, k = map(int, input().split()) a = list(map(int, input().split())) for i in range(k, n): if a[i] > a[i - k]: print("Yes") else: print("No")
[["-", 0, 57, 15, 666, 0, 206, 206, 657, 12, 612], ["+", 0, 57, 15, 666, 0, 206, 206, 657, 12, 22]]
5
70
n,k = map(int,input().split()) a = list(map(int,input().split())) for i in range(k,n): if a[i-3] < a[i]: print("Yes") else: print("No")
n,k = map(int,input().split()) a = list(map(int,input().split())) for i in range(k,n): if a[i-k] < a[i]: print("Yes") else: print("No")
[["-", 0, 57, 15, 666, 0, 206, 206, 657, 12, 612], ["+", 0, 57, 15, 666, 0, 206, 206, 657, 12, 22]]
5
70
#include <bits/stdc++.h> using namespace std; #define rep(i, n) for (int i = 0; i < (int)(n); i++) typedef long long ll; int main() { long long N, K; cin >> N >> K; vector<int> A(N + 1, 0); for (int i = 1; i <= N; i++) cin >> A[i]; for (int i = 1; i < N - K; i++) { if (A[K + i] > A[i]) cout <<...
#include <bits/stdc++.h> using namespace std; #define rep(i, n) for (int i = 0; i < (int)(n); i++) typedef long long ll; int main() { long long N, K; cin >> N >> K; vector<int> A(N + 1, 0); for (int i = 1; i <= N; i++) cin >> A[i]; for (int i = 1; i <= N - K; i++) { if (A[K + i] > A[i]) cout <...
[["-", 0, 14, 8, 9, 0, 7, 15, 16, 17, 18], ["+", 0, 14, 8, 9, 0, 7, 15, 16, 17, 19]]
1
123
n,k=map(int,input().split()) a=list(map(int,input().split())) for i in range(n-k+1): if a[i]<a[i+k+1]: print('Yes') else: print('No')
n,k=map(int,input().split()) a=list(map(int,input().split())) for i in range(n-k): if a[i]<a[i+k]: print('Yes') else: print('No')
[["-", 0, 7, 12, 652, 3, 4, 0, 657, 17, 72], ["-", 0, 7, 12, 652, 3, 4, 0, 657, 12, 612], ["-", 0, 57, 15, 666, 0, 206, 206, 657, 17, 72], ["-", 0, 57, 15, 666, 0, 206, 206, 657, 12, 612]]
5
74
N, K = map(int, input().split()) A = [int(i) for i in input().split()] i_list = [0] * N print(A) for i in range(K, N): if A[i-K] < A[i]: print('Yes') else: print('No')
N, K = map(int, input().split()) A = [int(i) for i in input().split()] i_list = [0] * N for i in range(K, N): if A[i-K] < A[i]: 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
82
#!/usr/bin/env python3 from collections import defaultdict,deque from heapq import heappush, heappop from bisect import bisect_left, bisect_right import sys, itertools, math sys.setrecursionlimit(10**5) input = sys.stdin.readline sqrt = math.sqrt def LI(): return list(map(int, input().split())) def LF(): return list(ma...
#!/usr/bin/env python3 from collections import defaultdict,deque from heapq import heappush, heappop from bisect import bisect_left, bisect_right import sys, itertools, math sys.setrecursionlimit(10**5) input = sys.stdin.readline sqrt = math.sqrt def LI(): return list(map(int, input().split())) def LF(): return list(ma...
[["-", 0, 7, 12, 652, 3, 4, 0, 657, 31, 22], ["+", 0, 7, 12, 652, 3, 4, 0, 657, 31, 22], ["-", 0, 7, 12, 652, 3, 4, 0, 657, 12, 612], ["+", 0, 7, 12, 652, 3, 4, 0, 657, 12, 22], ["-", 0, 7, 8, 196, 0, 57, 15, 666, 667, 47], ["+", 0, 7, 8, 196, 0, 57, 15, 666, 667, 20]]
5
461
#include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < (int)(n); i++) using namespace std; using ll = long long; int main() { int n, k; cin >> n >> k; vector<ll> a(n); for (int i = 0; i < n; i++) { cin >> a[i]; } for (int i = k; i < n; i++) { if (a[i - 1] < a[i]) { cout << "Yes" <<...
#include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < (int)(n); i++) using namespace std; using ll = long long; int main() { int n, k; cin >> n >> k; vector<ll> a(n); for (int i = 0; i < n; i++) { cin >> a[i]; } for (int i = k; i < n; i++) { if (a[i - k] < a[i]) { cout << "Yes" <<...
[["-", 51, 16, 31, 69, 341, 342, 0, 16, 12, 13], ["+", 51, 16, 31, 69, 341, 342, 0, 16, 12, 22]]
1
120
n,k = map(int, input().split()) A = list(map(int, input().split())) a = 1 for i in range(k): a *= A[i] ans = a for i in range(k,n): a = a//A[i-k] * A[i] if ans < a: print("Yes") else: print("No") ans = a
n,k = map(int, input().split()) A = list(map(int, input().split())) a = 0 for i in range(k): a += A[i] ans = a for i in range(k,n): a = a-A[i-k] + A[i] if ans < a: print("Yes") else: print("No") ans = a
[["-", 36, 36, 0, 656, 0, 1, 0, 662, 12, 612], ["+", 36, 36, 0, 656, 0, 1, 0, 662, 12, 612], ["-", 0, 7, 8, 196, 0, 1, 0, 677, 17, 108], ["+", 0, 7, 8, 196, 0, 1, 0, 677, 17, 107], ["-", 0, 1, 0, 662, 12, 657, 31, 657, 17, 676], ["+", 0, 1, 0, 662, 12, 657, 31, 657, 17, 33], ["-", 8, 196, 0, 1, 0, 662, 12, 657, 17, 48]...
5
100
#include <stdio.h> int main() { int i, j; long int n, k, a[200000]; scanf("%ld", &n); scanf("%ld", &k); for (i = 0; i < n; i++) scanf("%ld", &a[i]); for (i = k + 1; i <= n; i++) { if (a[i] > a[i - k]) printf("Yes\n"); else printf("No\n"); } return 0; }
#include <stdio.h> int main() { int i, j; long int n, k, a[200000]; scanf("%ld", &n); scanf("%ld", &k); for (i = 0; i < n; i++) scanf("%ld", &a[i]); for (i = k + 1; i <= n; i++) { if (a[i - 1] > a[i - k - 1]) printf("Yes\n"); else printf("No\n"); } return 0; }
[["+", 15, 23, 0, 16, 31, 69, 71, 16, 17, 33], ["+", 15, 23, 0, 16, 31, 69, 71, 16, 12, 13], ["+", 15, 23, 0, 16, 12, 69, 71, 16, 17, 33], ["+", 15, 23, 0, 16, 12, 69, 71, 16, 12, 13]]
0
121
N,K = map(int,input().split()) A = [int(a) for a in input().split()] n = 0 for i in range(K+1,N): if A[i] > A[n] : print("Yes") else: print("No") n+=1
N,K = map(int,input().split()) A = [int(a) for a in input().split()] n = 0 for i in range(K,N): if A[i] > A[n] : print("Yes") else: print("No") n+=1
[["-", 0, 7, 12, 652, 3, 4, 0, 657, 17, 72], ["-", 0, 7, 12, 652, 3, 4, 0, 657, 12, 612]]
5
77
package main import ( "fmt" ) func main() { var n, k int fmt.Scan(&n, &k) a := make([]int64, n) for i := 0; i < n; i++ { fmt.Scan(&a[i]) } // sum := make([]uint64, n+1) // for i := 0; i <n ; i++ { // if i == 0 { // sum[i] = 1 // } // if i >= k { // sum[i+1] = a[i] * sum[i] / a[i+1 - (n -k)] ...
package main import ( "fmt" ) func main() { var n, k int fmt.Scan(&n, &k) a := make([]int64, n) for i := 0; i < n; i++ { fmt.Scan(&a[i]) } // sum := make([]uint64, n+1) // for i := 0; i <n ; i++ { // if i == 0 { // sum[i] = 1 // } // if i >= k { // sum[i+1] = a[i] * sum[i] / a[i+1 - (n -k)] ...
[["-", 0, 437, 71, 16, 31, 16, 12, 23, 0, 24], ["-", 71, 16, 31, 16, 12, 23, 0, 16, 31, 22], ["-", 71, 16, 31, 16, 12, 23, 0, 16, 17, 33], ["-", 0, 437, 71, 16, 31, 16, 12, 23, 0, 25], ["-", 0, 431, 12, 432, 0, 437, 71, 16, 17, 72], ["-", 0, 431, 12, 432, 0, 437, 71, 16, 12, 433]]
7
150
#c n,k = map(int,input().split()) a = list(map(int,input().split())) for i in range(n-k): if a[i]<a[i+1]: print("Yes") else: print("No")
#c n,k = map(int,input().split()) a = list(map(int,input().split())) for i in range(n-k): if a[i]<a[i+k]: print("Yes") else: print("No")
[["-", 0, 57, 15, 666, 0, 206, 206, 657, 12, 612], ["+", 0, 57, 15, 666, 0, 206, 206, 657, 12, 22]]
5
71
#include <bits/stdc++.h> #define int long long using namespace std; signed main() { int n, k; cin >> n >> k; vector<int> a(n); for (int i = 0; i < n; i++) cin >> a[i]; for (int j = 0; j < n - k; j++) { if (a[j + k - 3] < a[j + k]) cout << "Yes" << endl; else cout << "No" << endl; }...
#include <bits/stdc++.h> #define int long long using namespace std; signed main() { int n, k; cin >> n >> k; vector<int> a(n); for (int i = 0; i < n; i++) cin >> a[i]; for (int j = 0; j < n - k; j++) { if (a[j] < a[j + k]) cout << "Yes" << endl; else cout << "No" << endl; } }
[["-", 31, 69, 341, 342, 0, 16, 31, 16, 17, 72], ["-", 31, 69, 341, 342, 0, 16, 31, 16, 12, 22], ["-", 51, 16, 31, 69, 341, 342, 0, 16, 17, 33], ["-", 51, 16, 31, 69, 341, 342, 0, 16, 12, 13]]
1
109
N, K = list(map(int,input().split())) A = list(map(int,input().split())) for i in range(N - K): if A[i] < A[i + K + 1]: print("Yes") else: print("No")
N, K = list(map(int,input().split())) A = list(map(int,input().split())) for i in range(N - K): if A[i] < A[i + K]: print("Yes") else: print("No")
[["-", 0, 57, 15, 666, 0, 206, 206, 657, 17, 72], ["-", 0, 57, 15, 666, 0, 206, 206, 657, 12, 612]]
5
75
#include <algorithm> #include <cstring> #include <iomanip> #include <iostream> #include <map> #include <math.h> #include <queue> #include <stdio.h> #include <stdlib.h> #include <string> #include <tuple> #include <utility> #include <vector> using namespace std; typedef long long ll; typedef unsigned long long ull; type...
#include <algorithm> #include <cstring> #include <iomanip> #include <iostream> #include <map> #include <math.h> #include <queue> #include <stdio.h> #include <stdlib.h> #include <string> #include <tuple> #include <utility> #include <vector> using namespace std; typedef long long ll; typedef unsigned long long ull; type...
[["-", 0, 1, 0, 2, 3, 4, 0, 16, 17, 72], ["-", 0, 1, 0, 2, 3, 4, 0, 16, 12, 13], ["-", 0, 9, 0, 57, 64, 1, 0, 2, 63, 22], ["+", 0, 9, 0, 57, 64, 1, 0, 2, 63, 22], ["-", 0, 57, 75, 76, 0, 1, 0, 2, 63, 22], ["+", 0, 57, 75, 76, 0, 1, 0, 2, 63, 22]]
1
295
#include <algorithm> #include <bitset> #include <cassert> #include <chrono> #include <cmath> #include <complex> #include <cstdint> #include <fstream> #include <functional> #include <iomanip> #include <iostream> #include <limits> #include <list> #include <map> #include <queue> #include <random> #include <regex> #include...
#include <algorithm> #include <bitset> #include <cassert> #include <chrono> #include <cmath> #include <complex> #include <cstdint> #include <fstream> #include <functional> #include <iomanip> #include <iostream> #include <limits> #include <list> #include <map> #include <queue> #include <random> #include <regex> #include...
[["-", 0, 1, 0, 16, 31, 16, 12, 2, 63, 22], ["+", 0, 1, 0, 16, 31, 16, 12, 2, 63, 22]]
1
2,359
def solve(): N,K=map(int,input().split()) A=list(map(int,input().split())) for i in range(N-K): if A[i-1]<A[i+K-1]: print("Yes") else: print("No") if __name__=="__main__": solve()
def solve(): N,K=map(int,input().split()) A=list(map(int,input().split())) for i in range(N-K): if A[i]<A[i+K]: print("Yes") else: print("No") if __name__=="__main__": solve()
[["-", 0, 57, 15, 666, 0, 206, 206, 657, 17, 33], ["-", 0, 57, 15, 666, 0, 206, 206, 657, 12, 612]]
5
89
#include <bits/stdc++.h> using namespace std; typedef long long lo; typedef vector<lo> vl; typedef vector<vl> vll; #define all(v) (v).begin(), (v).end() #define debug(x) cerr << #x << " = " << x << endl; #define REPV(a, b, c) for (lo(a) = b; (a) < (c); (a)++) #define REP(a, b) for (lo i = (a); i < (b); i++) template <...
#include <bits/stdc++.h> using namespace std; typedef long long lo; typedef vector<lo> vl; typedef vector<vl> vll; #define all(v) (v).begin(), (v).end() #define debug(x) cerr << #x << " = " << x << endl; #define REPV(a, b, c) for (lo(a) = b; (a) < (c); (a)++) #define REP(a, b) for (lo i = (a); i < (b); i++) template <...
[["+", 75, 76, 0, 9, 0, 1, 0, 11, 31, 22], ["+", 75, 76, 0, 9, 0, 1, 0, 11, 17, 32], ["+", 75, 76, 0, 9, 0, 1, 0, 11, 12, 22], ["+", 0, 57, 75, 76, 0, 9, 0, 1, 0, 35]]
1
279
#include <algorithm> #include <bits/stdc++.h> #include <bitset> #include <iostream> #include <map> #include <math.h> #include <set> #include <string> #include <vector> typedef long long ll; #define vi std::vector<int> #define vl std::vector<ll> #define floop(n) for (int i = 0; i < n; ++i) #define print(x) std::cout <...
#include <algorithm> #include <bits/stdc++.h> #include <bitset> #include <iostream> #include <map> #include <math.h> #include <set> #include <string> #include <vector> typedef long long ll; #define vi std::vector<int> #define vl std::vector<ll> #define floop(n) for (int i = 0; i < n; ++i) #define print(x) std::cout <...
[["-", 0, 1, 0, 11, 12, 41, 75, 16, 17, 48], ["+", 0, 1, 0, 11, 12, 41, 75, 16, 17, 72], ["-", 0, 1, 0, 11, 12, 16, 31, 16, 17, 85], ["+", 0, 1, 0, 11, 12, 16, 31, 16, 17, 33], ["-", 0, 9, 0, 1, 0, 11, 12, 16, 17, 48], ["+", 0, 9, 0, 1, 0, 11, 12, 16, 17, 72]]
1
196
#include <bits/stdc++.h> #include <ext/pb_ds/assoc_container.hpp> #include <ext/pb_ds/tree_policy.hpp> #include <functional> using namespace __gnu_pbds; using namespace std; typedef tree<long long, null_type, less<long long>, rb_tree_tag, tree_order_statistics_node_update> new_data_set; // defines ty...
#include <bits/stdc++.h> #include <ext/pb_ds/assoc_container.hpp> #include <ext/pb_ds/tree_policy.hpp> #include <functional> using namespace __gnu_pbds; using namespace std; typedef tree<long long, null_type, less<long long>, rb_tree_tag, tree_order_statistics_node_update> new_data_set; // defines ty...
[["-", 51, 16, 12, 69, 341, 342, 0, 16, 17, 72], ["-", 51, 16, 12, 69, 341, 342, 0, 16, 12, 13]]
1
218
#include <stdio.h> int main(void) { int n; int k; int a[200002]; int i; scanf("%d %d\n", &n, &k); for (i = 0; i < n; i++) { scanf("%d", &a[i]); } for (i = k; i < n; i++) { if (a[i - k] < a[i]) printf("Yes"); else printf("No"); } return (0); }
#include <stdio.h> int main(void) { int n; int k; int a[200002]; int i; scanf("%d %d\n", &n, &k); for (i = 0; i < n; i++) { scanf("%d", &a[i]); } for (i = k; i < n; i++) { if (a[i - k] < a[i]) printf("Yes\n"); else printf("No\n"); } return (0); }
[["+", 64, 1, 0, 2, 3, 4, 0, 5, 0, 44], ["+", 0, 1, 0, 2, 3, 4, 0, 5, 0, 44]]
0
115
#include <bits/stdc++.h> using namespace std; const int maxn = 2e5 + 13; int a[maxn]; int main() { int n, k; scanf("%d%d", &n, &k); for (int i = 1; i <= n; i++) { scanf("%d", &a[i]); } for (int i = k + 1; i <= n; i++) { if (a[i] > a[i - k]) printf("YES\n"); else printf("No\n"); } }
#include <bits/stdc++.h> using namespace std; const int maxn = 2e5 + 13; int a[maxn]; int main() { int n, k; scanf("%d%d", &n, &k); for (int i = 1; i <= n; i++) { scanf("%d", &a[i]); } for (int i = k + 1; i <= n; i++) { if (a[i] > a[i - k]) printf("Yes\n"); else printf("No\n"); } }
[["-", 64, 1, 0, 2, 3, 4, 0, 5, 0, 6], ["+", 64, 1, 0, 2, 3, 4, 0, 5, 0, 6]]
1
122
#include <algorithm> #include <cmath> #include <iomanip> #include <iostream> #include <map> #include <numeric> #include <queue> #include <set> #include <string> #include <utility> #include <vector> using namespace std; using int64 = long long; struct aaa { aaa() { cin.tie(nullptr); ios::sync_with_stdio(fals...
#include <algorithm> #include <cmath> #include <iomanip> #include <iostream> #include <map> #include <numeric> #include <queue> #include <set> #include <string> #include <utility> #include <vector> using namespace std; using int64 = long long; struct aaa { aaa() { cin.tie(nullptr); ios::sync_with_stdio(fals...
[["-", 8, 9, 0, 57, 64, 1, 0, 11, 17, 108], ["+", 8, 9, 0, 57, 64, 1, 0, 11, 17, 107], ["-", 8, 9, 0, 1, 0, 11, 12, 16, 17, 85], ["+", 8, 9, 0, 1, 0, 11, 12, 16, 17, 33], ["-", 0, 7, 8, 9, 0, 1, 0, 11, 17, 108], ["+", 0, 7, 8, 9, 0, 1, 0, 11, 17, 107]]
1
251
#include <bits/stdc++.h> #define ll long long #define pp pair<int, int> #define ppn pair<pp, int> #define F first #define S second #define N 200005 #define mod 1000000007 #define pi 3.14159265358979323846 using namespace std; int main() { ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0); int n, k; ...
#include <bits/stdc++.h> #define ll long long #define pp pair<int, int> #define ppn pair<pp, int> #define F first #define S second #define N 200005 #define mod 1000000007 #define pi 3.14159265358979323846 using namespace std; int main() { ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0); int n, k; ...
[["-", 0, 30, 0, 14, 8, 9, 0, 43, 39, 78], ["+", 0, 30, 0, 14, 8, 9, 0, 43, 39, 40], ["-", 0, 14, 8, 9, 0, 7, 15, 16, 17, 98], ["-", 8, 9, 0, 7, 15, 16, 12, 16, 31, 22], ["-", 8, 9, 0, 7, 15, 16, 12, 16, 17, 18], ["-", 8, 9, 0, 7, 15, 16, 12, 16, 12, 22]]
1
156
#include <bits/stdc++.h> using namespace std; int main() { int n, k; cin >> n >> k; vector<int> a(n); for (auto &&e : a) { cin >> e; } for (int i = k; i < n; i++) { cout << (a[i - k + 1] > a[i - k] ? "Yes" : "No") << endl; } }
#include <bits/stdc++.h> using namespace std; int main() { int n, k; cin >> n >> k; vector<int> a(n); for (auto &&e : a) { cin >> e; } for (int i = k; i < n; i++) { cout << (a[i] > a[i - k] ? "Yes" : "No") << endl; } }
[["-", 31, 69, 341, 342, 0, 16, 31, 16, 17, 33], ["-", 31, 69, 341, 342, 0, 16, 31, 16, 12, 22], ["-", 15, 16, 31, 69, 341, 342, 0, 16, 17, 72], ["-", 15, 16, 31, 69, 341, 342, 0, 16, 12, 13]]
1
92
N, K= map(int,input().split()) A = list(map(int,input().split())) for i in range(K, N): if A[i]>A[i-K-1]: print('Yes') else: print('No')
N, K= map(int,input().split()) A = list(map(int,input().split())) for i in range(K+1, N+1): if A[i-1]>A[i-K-1]: print('Yes') else: print('No')
[["+", 0, 7, 12, 652, 3, 4, 0, 657, 17, 72], ["+", 0, 7, 12, 652, 3, 4, 0, 657, 12, 612], ["+", 0, 57, 15, 666, 0, 206, 206, 657, 17, 33], ["+", 0, 57, 15, 666, 0, 206, 206, 657, 12, 612]]
5
72
#n=int(input()) n,k=map(int,input().split()) l=list(map(int,input().split())) mul=1 for i in range(k): mul=mul*l[i] z=mul j=0 for i in range(k,n): z=z//l[j] z=z*l[i] if z>mul: print('Yes') else: print('No') j+=1 mul=z
#n=int(input()) n,k=map(int,input().split()) l=list(map(int,input().split())) mul=1 for i in range(k): mul=mul+l[i] z=mul j=0 for i in range(k,n): z=z-l[j] z=z+l[i] if z>mul: print('Yes') else: print('No') j+=1 mul=z
[["-", 8, 196, 0, 1, 0, 662, 12, 657, 17, 48], ["+", 8, 196, 0, 1, 0, 662, 12, 657, 17, 72], ["-", 8, 196, 0, 1, 0, 662, 12, 657, 17, 676], ["+", 8, 196, 0, 1, 0, 662, 12, 657, 17, 33]]
5
110
#include <bits/stdc++.h> using namespace std; #define rep(i, n) for (int i = 0; i < (int)(n); i++) using ll = long long; ll GetDigit(ll num) { return log10(num) + 1; } // numの桁数を求める int main() { int n, k; cin >> n >> k; vector<ll> a(n); rep(i, n) cin >> a[i]; vector<ll> s(n - k + 1, 1); for (int i = 0; i <...
#include <bits/stdc++.h> using namespace std; #define rep(i, n) for (int i = 0; i < (int)(n); i++) using ll = long long; ll GetDigit(ll num) { return log10(num) + 1; } // numの桁数を求める int main() { ll n, k; cin >> n >> k; vector<ll> a(n); rep(i, n) cin >> a[i]; vector<ll> s(n - k + 1, 1); for (ll i = 0; i < k...
[["-", 0, 30, 0, 14, 8, 9, 0, 43, 39, 40], ["+", 0, 30, 0, 14, 8, 9, 0, 43, 39, 78], ["-", 0, 14, 8, 9, 0, 7, 10, 43, 39, 40], ["+", 0, 14, 8, 9, 0, 7, 10, 43, 39, 78], ["-", 0, 11, 12, 16, 31, 23, 0, 16, 17, 85], ["+", 0, 11, 12, 16, 31, 23, 0, 16, 17, 33], ["-", 8, 9, 0, 1, 0, 11, 12, 16, 17, 48], ["+", 8, 9, 0, 1, 0...
1
216
n, k = map(int, input().split()) al = list(map(int, input().split())) for i in range(k, n): print('yes' if al[i] > al[i - k] else 'No')
n, k = map(int, input().split()) al = list(map(int, input().split())) for i in range(k, n): print('Yes' if al[i] > al[i - k] else 'No')
[["-", 0, 652, 3, 4, 0, 41, 0, 557, 0, 6], ["+", 0, 652, 3, 4, 0, 41, 0, 557, 0, 6]]
5
65
n, k = list(map(int, input().split())) a = list(map(int, input().split())) for i in range(k, n): if a[i - 3] < a[i]: print("Yes") else: print("No")
n, k = list(map(int, input().split())) a = list(map(int, input().split())) for i in range(k, n): if i >= k and a[i - k] < a[i]: print("Yes") else: print("No")
[["+", 8, 196, 0, 57, 15, 679, 31, 666, 0, 22], ["+", 8, 196, 0, 57, 15, 679, 31, 666, 667, 20], ["+", 0, 7, 8, 196, 0, 57, 15, 679, 17, 355], ["-", 0, 57, 15, 666, 0, 206, 206, 657, 12, 612], ["+", 15, 679, 12, 666, 0, 206, 206, 657, 12, 22]]
5
73
N, K = list(map(int, input().split())) A = list(map(int, input().split())) results = list() for first, second in zip(A[0:N - K], A[K:N]): print(first, second) if second > first: results.append(True) else: results.append(False) for res in results: if res: print('Yes') else: ...
N, K = list(map(int, input().split())) A = list(map(int, input().split())) results = list() for first, second in zip(A[0:N - K], A[K:N]): if second > first: results.append(True) else: results.append(False) for res in results: if res: print('Yes') else: print('No')
[["-", 0, 7, 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, 21], ["-", 8, 196, 0, 1, 0, 652, 3, 4, 0, 25]]
5
112
n,k = map(int, input().split()) a = list(map(int, input().split())) cnt = 1 for i in range(k): cnt *= a[i] pre = cnt for i in range(n-k): cnt /= a[i] cnt *= a[i+k] if cnt>pre: print('Yes') else: print('No') pre = cnt
n,k = map(int, input().split()) a = list(map(int, input().split())) cnt = 1 for i in range(k): cnt += a[i] pre = cnt for i in range(n-k): cnt -= a[i] cnt += a[i+k] if cnt>pre: print('Yes') else: print('No') pre = cnt
[["-", 0, 7, 8, 196, 0, 1, 0, 677, 17, 108], ["+", 0, 7, 8, 196, 0, 1, 0, 677, 17, 107], ["-", 0, 7, 8, 196, 0, 1, 0, 677, 17, 90], ["+", 0, 7, 8, 196, 0, 1, 0, 677, 17, 110]]
5
99
n, k = map(int, input().split()) a = list(map(int , input().split())) b = [0] * (n-k+1) b0 = 1 for i in range(k): b0 = b0 * a[i] b[0] = b0 for i in range(k, n): b[i-k+1] = b[i-k] // a[i-k] * a[i] if b[i-k+1] > b[i-k]: print('Yes') else: print('No') #print(a, b, b0)
n, k = map(int, input().split()) a = list(map(int , input().split())) b = [0] * (n-k+1) b0 = 1 for i in range(k): b0 = b0 + a[i] b[0] = b0 for i in range(k, n): b[i-k+1] = b[i-k] - a[i-k] + a[i] if b[i-k+1] > b[i-k]: print('Yes') else: print('No') #print(a, b, b0)
[["-", 8, 196, 0, 1, 0, 662, 12, 657, 17, 48], ["+", 8, 196, 0, 1, 0, 662, 12, 657, 17, 72], ["-", 0, 1, 0, 662, 12, 657, 31, 657, 17, 676], ["+", 0, 1, 0, 662, 12, 657, 31, 657, 17, 33]]
5
140
#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, K; cin >> N >> K; vector<ll> A(200010); rep(i, N) cin >> A[i]; ll ans = A[0]; for (int i = 1; i < K; i++) { ans *= A[i]; } //ここまでで初...
#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, K; cin >> N >> K; vector<ll> A(200010); rep(i, N) cin >> A[i]; ll ans = A[0]; for (int i = 1; i < K; i++) { ans += A[i]; } //ここまでで初...
[["-", 0, 7, 8, 9, 0, 1, 0, 11, 17, 108], ["+", 0, 7, 8, 9, 0, 1, 0, 11, 17, 107], ["-", 0, 7, 8, 9, 0, 1, 0, 11, 17, 90], ["+", 0, 7, 8, 9, 0, 1, 0, 11, 17, 110]]
1
170
#include <bits/stdc++.h> using namespace std; int main() { int n, k; cin >> n >> k; unsigned long int a[n]; unsigned long long int b = 1, c = 0; for (int i = 0; i < n; i++) { cin >> a[i]; // cout << a[i]; } for (int i = 0; i < k; i++) { b *= a[i]; } c = b; // cout << b; int j = 0; f...
#include <bits/stdc++.h> using namespace std; int main() { long n, k; cin >> n >> k; unsigned long a[n]; unsigned long long b = 1, c = 0; for (int i = 0; i < n; i++) { cin >> a[i]; // cout << a[i]; } for (int i = 0; i < k; i++) { b += a[i]; } c = b; // cout << b; int j = 0; for (int...
[["-", 0, 30, 0, 14, 8, 9, 0, 43, 39, 40], ["+", 0, 14, 8, 9, 0, 43, 39, 86, 0, 96], ["-", 0, 14, 8, 9, 0, 43, 39, 86, 39, 40], ["-", 0, 7, 8, 9, 0, 1, 0, 11, 17, 108], ["+", 0, 7, 8, 9, 0, 1, 0, 11, 17, 107], ["-", 0, 7, 8, 9, 0, 1, 0, 11, 17, 90], ["+", 0, 7, 8, 9, 0, 1, 0, 11, 17, 110]]
1
165
#include <bits/stdc++.h> using namespace std; void solve() { int n, k; cin >> n >> k; int ar[n + 5] = {}; for (int i = 1; i <= n; i++) { cin >> ar[i]; } vector<unsigned long long> v; unsigned long long ans = 1; for (int i = 1; i <= k; i++) { ans *= ar[i]; } v.push_back(ans); int pos = 1; ...
#include <bits/stdc++.h> using namespace std; void solve() { int n, k; cin >> n >> k; long long ar[n + 5] = {}; for (int i = 1; i <= n; i++) { cin >> ar[i]; } vector<unsigned long long> v; long long ans = 1; for (int i = 1; i <= k; i++) { ans += ar[i]; } v.push_back(ans); int pos = 1; fo...
[["-", 0, 30, 0, 14, 8, 9, 0, 43, 39, 40], ["+", 0, 14, 8, 9, 0, 43, 39, 86, 0, 96], ["-", 0, 14, 8, 9, 0, 43, 39, 86, 0, 87], ["-", 0, 7, 8, 9, 0, 1, 0, 11, 17, 108], ["+", 0, 7, 8, 9, 0, 1, 0, 11, 17, 107], ["-", 0, 7, 8, 9, 0, 1, 0, 11, 17, 90], ["+", 0, 7, 8, 9, 0, 1, 0, 11, 17, 110]]
1
219
#include <algorithm> #include <iomanip> #include <iostream> #include <stdio.h> #include <string> #include <vector> #define _USE_MATH_DEFINES #include <math.h> using namespace std; #define rep(i, n) for (i = 0; i < n; i++) #define repl(k, n) for (k = 0; k < n; ++k) int main() { int N; int K; int i; cin >> N >> ...
#include <algorithm> #include <iomanip> #include <iostream> #include <stdio.h> #include <string> #include <vector> #define _USE_MATH_DEFINES #include <math.h> using namespace std; #define rep(i, n) for (i = 0; i < n; i++) #define repl(k, n) for (k = 0; k < n; ++k) int main() { int N; int K; int i; cin >> N >> ...
[["+", 64, 9, 0, 1, 0, 16, 12, 5, 0, 44], ["+", 0, 9, 0, 1, 0, 16, 12, 5, 0, 44]]
1
126
#include <bits/stdc++.h> #define INF 0x3f3f3f3f #define rep(i, a, n) for (int i = (a); i < (n); i++) #define per(i, a, n) for (int i = (a); i > (n); i--) typedef long long ll; const int maxn = 2e6 + 5; const int mod = 1e9 + 7; using namespace std; ll a[maxn]; void solve() { ll n, k, cur = 1, tmp; cin >> n >> k; ...
#include <bits/stdc++.h> #define INF 0x3f3f3f3f #define rep(i, a, n) for (int i = (a); i < (n); i++) #define per(i, a, n) for (int i = (a); i > (n); i--) typedef long long ll; const int maxn = 2e6 + 5; const int mod = 1e9 + 7; using namespace std; ll a[maxn]; void solve() { ll n, k, cur = 1, tmp; cin >> n >> k; ...
[["-", 0, 14, 8, 9, 0, 1, 0, 11, 17, 108], ["+", 0, 14, 8, 9, 0, 1, 0, 11, 17, 107], ["-", 0, 14, 8, 9, 0, 1, 0, 11, 17, 90], ["+", 0, 14, 8, 9, 0, 1, 0, 11, 17, 110]]
1
214
import java.util.*; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int n = sc.nextInt(); int k = sc.nextInt(); int as[] = new int[n]; for (int i = 0; i < n; i++) as[i] = sc.nextInt(); for (int i = 0; i < k - 1; i++) { if (as[k +...
import java.util.*; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int n = sc.nextInt(); int k = sc.nextInt(); long as[] = new long[n]; for (int i = 0; i < n; i++) as[i] = sc.nextLong(); for (int i = 0; i < n - k; i++) { if (as[...
[["-", 0, 195, 8, 196, 0, 503, 39, 506, 0, 507], ["+", 0, 195, 8, 196, 0, 503, 39, 506, 0, 96], ["-", 0, 503, 49, 200, 51, 227, 39, 506, 0, 507], ["+", 0, 503, 49, 200, 51, 227, 39, 506, 0, 96], ["-", 0, 7, 8, 1, 0, 11, 12, 492, 141, 22], ["+", 0, 7, 8, 1, 0, 11, 12, 492, 141, 22], ["-", 8, 196, 0, 7, 15, 16, 12, 16, 3...
3
144
#include <algorithm> #include <cmath> #include <iomanip> #include <iostream> #include <map> #include <queue> #include <set> #include <tuple> #include <vector> using namespace std; using ll = long long; #define rep(i, j, n) for (int i = j; i < (int)n; ++i) #define rrep(i, j, n) for (int i = (int)n - 1; j <= i; --i) con...
#include <algorithm> #include <cmath> #include <iomanip> #include <iostream> #include <map> #include <queue> #include <set> #include <tuple> #include <vector> using namespace std; using ll = long long; #define rep(i, j, n) for (int i = j; i < (int)n; ++i) #define rrep(i, j, n) for (int i = (int)n - 1; j <= i; --i) con...
[["-", 0, 14, 8, 9, 0, 1, 0, 11, 17, 108], ["+", 0, 14, 8, 9, 0, 1, 0, 11, 17, 107], ["-", 0, 43, 49, 50, 51, 16, 31, 16, 17, 48], ["+", 0, 43, 49, 50, 51, 16, 31, 16, 17, 72], ["-", 8, 9, 0, 43, 49, 50, 51, 16, 17, 85], ["+", 8, 9, 0, 43, 49, 50, 51, 16, 17, 33]]
1
203
#include <bits/stdc++.h> using namespace std; #define ll long long int int main() { int t; t = 1; while (t--) { ll n, k; cin >> n >> k; vector<ll> v(n + 1); v[0] = 0; for (int i = 1; i <= n; i++) { cin >> v[i]; } ll start = 1; ll cur = k + 1; while (cur <= n) { ...
#include <bits/stdc++.h> using namespace std; #define ll long long int int main() { int t; t = 1; while (t--) { ll n, k; cin >> n >> k; vector<ll> v(n + 1); v[0] = 0; for (int i = 1; i <= n; i++) { cin >> v[i]; } ll start = 1; ll cur = k + 1; while (cur <= n) { ...
[["-", 0, 1, 0, 16, 31, 16, 12, 5, 0, 6], ["+", 0, 1, 0, 16, 31, 16, 12, 5, 0, 6]]
1
140
#include <bits/stdc++.h> using namespace std; #define ll long long const ll mod = 1e9 + 7; const ll INF = 1LL << 60; #define fo(i, n) for (ll int i = 0; i < n; ++i) #define fos(j, i, n) for (ll int j = i; j < n; ++j) #define N 100004 #define fast \ ios...
#include <bits/stdc++.h> using namespace std; #define ll long long const ll mod = 1e9 + 7; const ll INF = 1LL << 60; #define fo(i, n) for (ll int i = 0; i < n; ++i) #define fos(j, i, n) for (ll int j = i; j < n; ++j) #define N 100004 #define fast \ ios...
[["-", 0, 14, 8, 9, 0, 43, 49, 50, 51, 13], ["+", 0, 14, 8, 9, 0, 43, 49, 50, 51, 13], ["-", 0, 14, 8, 9, 0, 1, 0, 11, 17, 108], ["+", 0, 14, 8, 9, 0, 1, 0, 11, 17, 107], ["-", 0, 14, 8, 9, 0, 1, 0, 11, 17, 90], ["+", 0, 14, 8, 9, 0, 1, 0, 11, 17, 110]]
1
271
#include <bits/stdc++.h> using namespace std; #define ll long long int main() { ll n, k; cin >> n >> k; ll arr[n], i, a, b; for (i = 0; i < n; i++) cin >> arr[i]; for (i = k; i < n; i++) { a = arr[i]; b = arr[i - k]; if (a > b) cout << "Yes" << endl; else cout << "NO" << end...
#include <bits/stdc++.h> using namespace std; #define ll long long int main() { ll n, k; cin >> n >> k; ll arr[n], i, a, b; for (i = 1; i <= n; i++) cin >> arr[i]; for (i = k + 1; i <= n; i++) { a = arr[i]; b = arr[i - k]; if (a > b) cout << "Yes" << endl; else cout << "No" ...
[["-", 0, 14, 8, 9, 0, 7, 10, 11, 12, 13], ["+", 0, 14, 8, 9, 0, 7, 10, 11, 12, 13], ["-", 0, 14, 8, 9, 0, 7, 15, 16, 17, 18], ["+", 0, 14, 8, 9, 0, 7, 15, 16, 17, 19], ["+", 8, 9, 0, 7, 10, 11, 12, 16, 17, 72], ["+", 8, 9, 0, 7, 10, 11, 12, 16, 12, 13], ["-", 0, 1, 0, 16, 31, 16, 12, 5, 0, 6], ["+", 0, 1, 0, 16, 31, 1...
1
115
#include <bits/stdc++.h> using namespace std; int main() { int n, k; cin >> n >> k; vector<int> array(n); for (int i = 0; i < n - 1; i++) cin >> array.at(i); for (int i = 0; i < n - k; i++) { int before = array.at(i); int after = array.at(i + k); if (before < after) { cout << "Yes" << e...
#include <bits/stdc++.h> using namespace std; int main() { int n, k; cin >> n >> k; vector<int> array(n); for (int i = 0; i < n; i++) cin >> array.at(i); for (int i = 0; i < n - k; i++) { int before = array.at(i); int after = array.at(i + k); if (before < after) { cout << "Yes" << endl;...
[["-", 8, 9, 0, 7, 15, 16, 12, 16, 17, 33], ["-", 8, 9, 0, 7, 15, 16, 12, 16, 12, 13]]
1
124
n,k = map(int,input().split()) l = list(map(int,input().split())) p1 = 1 for i in range(k): p1 *= l[i] for i in range(k,n): p2 = p1 p2 *= l[i] p2 //= l[i-k] #print(p1,p2) print('Yes' if p2 > p1 else 'No') p1 = p2
n,k = map(int,input().split()) l = list(map(int,input().split())) p1 = 0 for i in range(k): p1 += l[i] for i in range(k,n): p2 = p1 p2 += l[i] p2 -= l[i-k] #print(p1,p2) print('Yes' if p2 > p1 else 'No') p1 = p2
[["-", 36, 36, 0, 656, 0, 1, 0, 662, 12, 612], ["+", 36, 36, 0, 656, 0, 1, 0, 662, 12, 612], ["-", 0, 7, 8, 196, 0, 1, 0, 677, 17, 108], ["+", 0, 7, 8, 196, 0, 1, 0, 677, 17, 107], ["-", 0, 7, 8, 196, 0, 1, 0, 677, 17, 691], ["+", 0, 7, 8, 196, 0, 1, 0, 677, 17, 110]]
5
95
from collections import defaultdict,deque import math def gcd(a,b): return b if not a%b else gcd(b,a%b) def lcm(a,b): return (a*b)//gcd(a,b) def main(): n,k=map(int, input().split()) a=[int(i) for i in input().split()] tmp = 0 res = [] tmp = 1 ind = 0 for i in range(n-k): if...
from collections import defaultdict,deque import math def gcd(a,b): return b if not a%b else gcd(b,a%b) def lcm(a,b): return (a*b)//gcd(a,b) def main(): n,k=map(int, input().split()) a=[int(i) for i in input().split()] tmp = 0 res = [] ind = 0 for i in range(n-k): if(a[ind] < a[...
[["-", 0, 14, 8, 196, 0, 1, 0, 662, 31, 22], ["-", 0, 14, 8, 196, 0, 1, 0, 662, 0, 32], ["-", 0, 14, 8, 196, 0, 1, 0, 662, 12, 612], ["-", 8, 196, 0, 7, 12, 652, 3, 4, 0, 612], ["+", 8, 196, 0, 7, 12, 652, 3, 4, 0, 612]]
5
192
#include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < n; i++) using namespace std; typedef pair<int, int> P; typedef long long ll; template <class T> inline bool chmax(T &a, T b) { if (a < b) { a = b; return 1; } return 0; } template <class T> inline bool chmin(T &a, T b) { if (a > b) { a =...
#include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < n; i++) using namespace std; typedef pair<int, int> P; typedef long long ll; template <class T> inline bool chmax(T &a, T b) { if (a < b) { a = b; return 1; } return 0; } template <class T> inline bool chmin(T &a, T b) { if (a > b) { a =...
[["-", 51, 16, 31, 69, 341, 342, 0, 16, 12, 13], ["+", 31, 69, 341, 342, 0, 16, 31, 16, 12, 13], ["+", 51, 16, 31, 69, 341, 342, 0, 16, 17, 33], ["+", 51, 16, 31, 69, 341, 342, 0, 16, 12, 22]]
1
191
import java.util.*; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int n = sc.nextInt(); int k = sc.nextInt(); int[] a = new int[n]; for (int i = 0; i < n; n++) { a[i] = sc.nextInt(); } for (int j = k; j < n; j++) { if (a[j...
import java.util.*; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int n = sc.nextInt(); int k = sc.nextInt(); int[] a = new int[n]; for (int i = 0; i < n; i++) { a[i] = sc.nextInt(); } for (int j = k; j < n; j++) { if (a[j...
[["-", 0, 195, 8, 196, 0, 7, 26, 27, 0, 22], ["+", 0, 195, 8, 196, 0, 7, 26, 27, 0, 22]]
3
148
#include <iostream> using namespace std; int main() { // your code goes here int n, k; cin >> n >> k; int a[n + 5], sum[n + 4], i; for (i = 0; i < n; i++) cin >> a[i]; sum[0] = a[0]; for (i = k; i < n; i++) { if (a[i] > a[i - 1]) cout << "Yes" << endl; else cout << "No" << endl; ...
#include <iostream> using namespace std; int main() { // your code goes here int n, k; cin >> n >> k; int a[n + 5], sum[n + 4], i; for (i = 0; i < n; i++) cin >> a[i]; sum[0] = a[0]; for (i = k; i < n; i++) { if (a[i] > a[i - k]) cout << "Yes" << endl; else cout << "No" << endl; ...
[["-", 51, 16, 12, 69, 341, 342, 0, 16, 12, 13], ["+", 51, 16, 12, 69, 341, 342, 0, 16, 12, 22]]
1
120
n,k=map(int,input().split()) x=[int(x) for x in input().split()] ans=[1]*n ans[0]=x[0] for i in range(k,n): if x[c]<x[i]: print('Yes') else:print('No') c+=1
n,k=map(int,input().split()) x=[int(x) for x in input().split()] ans=[1]*n ans[0]=x[0] c=0 for i in range(k,n): if x[c]<x[i]: print('Yes') else:print('No') c+=1
[["+", 36, 36, 0, 656, 0, 1, 0, 662, 31, 22], ["+", 36, 36, 0, 656, 0, 1, 0, 662, 0, 32], ["+", 36, 36, 0, 656, 0, 1, 0, 662, 12, 612]]
5
88
#include <algorithm> // min, max, swap, sort, reverse, lower_bound, upper_bound #include <bitset> // bitset #include <cctype> // isupper, islower, isdigit, toupper, tolower #include <climits> #include <cstdint> // int64_t, int*_t #include <cstdio> // printf #include <deque> // deque #include <functional> #incl...
#include <algorithm> // min, max, swap, sort, reverse, lower_bound, upper_bound #include <bitset> // bitset #include <cctype> // isupper, islower, isdigit, toupper, tolower #include <climits> #include <cstdint> // int64_t, int*_t #include <cstdio> // printf #include <deque> // deque #include <functional> #incl...
[["-", 0, 1, 0, 2, 3, 4, 0, 16, 31, 22], ["+", 0, 1, 0, 2, 3, 4, 0, 16, 31, 22], ["-", 0, 1, 0, 2, 3, 4, 0, 16, 12, 13], ["+", 0, 1, 0, 2, 3, 4, 0, 16, 12, 22]]
1
216
def ip(): return list(map(int, input().split())) [n,k]=ip() arr=ip() s=0 e=k u=k-1 while u: if arr[s]<arr[e]: print("Yes") else: print("No") s+=1 u-=1 e+=1
def ip(): return list(map(int, input().split())) [n,k]=ip() arr=ip() s=0 e=k u=n-k while u: if arr[s]<arr[e]: print("Yes") else: print("No") s+=1 u-=1 e+=1
[["-", 0, 656, 0, 1, 0, 662, 12, 657, 31, 22], ["+", 0, 656, 0, 1, 0, 662, 12, 657, 31, 22], ["-", 0, 656, 0, 1, 0, 662, 12, 657, 12, 612], ["+", 0, 656, 0, 1, 0, 662, 12, 657, 12, 22]]
5
83
#include <bits/stdc++.h> #define dbug printf("I am here\n"); #define Fast \ ios_base::sync_with_stdio(false); \ cin.tie(0); #define vs v.size() #define ss s.size() #define sot(v) sort(v.begin(), v.end()) #de...
#include <bits/stdc++.h> #define dbug printf("I am here\n"); #define Fast \ ios_base::sync_with_stdio(false); \ cin.tie(0); #define vs v.size() #define ss s.size() #define sot(v) sort(v.begin(), v.end()) #de...
[["-", 0, 43, 39, 344, 3, 347, 0, 42, 0, 22], ["+", 0, 43, 39, 344, 3, 347, 0, 42, 0, 22], ["-", 0, 30, 0, 14, 8, 9, 0, 43, 39, 78], ["+", 0, 30, 0, 14, 8, 9, 0, 43, 39, 78], ["-", 0, 7, 8, 9, 0, 1, 0, 11, 17, 108], ["+", 0, 7, 8, 9, 0, 1, 0, 11, 17, 107], ["-", 0, 7, 8, 9, 0, 1, 0, 11, 17, 90], ["+", 0, 7, 8, 9, 0, 1,...
1
265
#include <bits/stdc++.h> using namespace std; #define ff first #define ss second #define ll long long #define int long long #define int long long #define inf ((ll)1e18) #define mod (ll)1e9 + 7 #define double long double #define ull unsigned long long #define vi vector<ll> #define ppi pair<int, int> #define pii pair<pai...
#include <bits/stdc++.h> using namespace std; #define ff first #define ss second #define ll long long #define int long long #define int long long #define inf ((ll)1e18) #define mod (ll)1e9 + 7 #define double long double #define ull unsigned long long #define vi vector<ll> #define ppi pair<int, int> #define pii pair<pai...
[["-", 8, 9, 0, 7, 8, 9, 0, 43, 39, 78], ["+", 8, 9, 0, 7, 8, 9, 0, 43, 39, 78], ["-", 0, 7, 8, 9, 0, 1, 0, 11, 17, 108], ["+", 0, 7, 8, 9, 0, 1, 0, 11, 17, 107], ["-", 0, 11, 12, 16, 31, 23, 0, 16, 17, 48], ["+", 0, 11, 12, 16, 31, 23, 0, 16, 17, 72], ["-", 8, 9, 0, 1, 0, 11, 12, 16, 17, 85], ["+", 8, 9, 0, 1, 0, 11, ...
1
299
#include <iostream> using namespace std; using ll = long long; int main() { int n, k; cin >> n >> k; ll a[n], nw = 1, old = 1; for (int i = 0; i < n; ++i) cin >> a[i]; for (int i = 0; i < k; ++i) old *= a[i]; for (int i = k; i < n; ++i) { nw = (old / a[i - k]) * a[i]; if (nw > old) co...
#include <iostream> using namespace std; using ll = unsigned long long; int main() { int n, k; cin >> n >> k; ll a[n], nw = 1, old = 1; for (int i = 0; i < n; ++i) cin >> a[i]; for (int i = 0; i < k; ++i) old += a[i]; for (int i = k; i < n; ++i) { nw = (old - a[i - k]) + a[i]; if (nw > old)...
[["+", 0, 30, 0, 360, 39, 77, 39, 86, 0, 87], ["-", 8, 9, 0, 7, 8, 1, 0, 11, 17, 108], ["+", 8, 9, 0, 7, 8, 1, 0, 11, 17, 107], ["-", 0, 11, 12, 16, 31, 23, 0, 16, 17, 85], ["+", 0, 11, 12, 16, 31, 23, 0, 16, 17, 33], ["-", 8, 9, 0, 1, 0, 11, 12, 16, 17, 48], ["+", 8, 9, 0, 1, 0, 11, 12, 16, 17, 72]]
1
149
package main import ( "bufio" "fmt" "os" "strconv" ) var sc = bufio.NewScanner(os.Stdin) func main() { sc.Split(bufio.ScanWords) n := nextInt() k := nextInt() a := make([]int, n) for i := 0; i < n; i++ { a[i] = nextInt() } for i := 0; i < n-k; i++ { if a[i] < a[i+n-k+1] { fmt.Println("Yes") } e...
package main import ( "bufio" "fmt" "os" "strconv" ) var sc = bufio.NewScanner(os.Stdin) func main() { sc.Split(bufio.ScanWords) n := nextInt() k := nextInt() a := make([]int, n) for i := 0; i < n; i++ { a[i] = nextInt() } for i := 0; i < n-k; i++ { if a[i] < a[i+k] { fmt.Println("Yes") } else ...
[["-", 12, 437, 71, 16, 31, 16, 31, 16, 12, 22], ["-", 15, 16, 12, 437, 71, 16, 31, 16, 17, 33], ["-", 0, 57, 15, 16, 12, 437, 71, 16, 17, 72], ["-", 0, 57, 15, 16, 12, 437, 71, 16, 12, 433]]
7
197
#include <bits/stdc++.h> using namespace std; int main() { int N; int K; cin >> N >> K; int V[N]; for (int i = 0; i < N; i++) { cin >> V[i]; } for (int i = K; i < N; i++) { if (V[i] > V[i - K]) cout << "YES" << endl; else cout << "NO" << endl; } }
#include <bits/stdc++.h> using namespace std; int main() { int N; int K; cin >> N >> K; int V[N]; for (int i = 0; i < N; i++) { cin >> V[i]; } for (int i = K; i < N; i++) { if (V[i] > V[i - K]) cout << "Yes" << endl; else cout << "No" << 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
100
#include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < (n); ++i) #define ll long long using namespace std; int main() { int n, k; cin >> n >> k; vector<int> scores(n); rep(i, n) cin >> scores[i]; ll tmp = 1; rep(i, k) tmp *= scores[i]; int j = 0; for (int i = k; i < n; i++) { ll score = (tm...
#include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < (n); ++i) #define ll long long using namespace std; int main() { int n, k; cin >> n >> k; vector<int> scores(n); rep(i, n) cin >> scores[i]; ll tmp = 1; rep(i, k) tmp += scores[i]; int j = 0; for (int i = k; i < n; i++) { ll score = tmp...
[["-", 0, 14, 8, 9, 0, 1, 0, 11, 17, 108], ["+", 0, 14, 8, 9, 0, 1, 0, 11, 17, 107], ["-", 0, 43, 49, 50, 51, 16, 31, 23, 0, 24], ["-", 49, 50, 51, 16, 31, 23, 0, 16, 17, 85], ["+", 0, 43, 49, 50, 51, 16, 31, 16, 17, 33], ["-", 0, 43, 49, 50, 51, 16, 31, 23, 0, 25], ["-", 8, 9, 0, 43, 49, 50, 51, 16, 17, 48], ["+", 8, ...
1
146
#include <bits/stdc++.h> using namespace std; int main() { int N, K; cin >> N >> K; int A[N]; for (int i = 0; i < N; i++) cin >> A[i]; long long total = 1, buf; for (int i = 0; i < K; i++) total *= A[i]; for (int i = K; i < N; i++) { buf = total; total /= A[i - K]; total *= A[i]; ...
#include <bits/stdc++.h> using namespace std; int main() { int N, K; cin >> N >> K; int A[N]; for (int i = 0; i < N; i++) cin >> A[i]; long long total = 0, buf; for (int i = 0; i < K; i++) total += A[i]; for (int i = K; i < N; i++) { buf = total; total -= A[i - K]; total += A[i]; ...
[["-", 0, 14, 8, 9, 0, 43, 49, 50, 51, 13], ["+", 0, 14, 8, 9, 0, 43, 49, 50, 51, 13], ["-", 8, 9, 0, 7, 8, 1, 0, 11, 17, 108], ["+", 8, 9, 0, 7, 8, 1, 0, 11, 17, 107], ["-", 0, 7, 8, 9, 0, 1, 0, 11, 17, 90], ["+", 0, 7, 8, 9, 0, 1, 0, 11, 17, 110], ["-", 0, 7, 8, 9, 0, 1, 0, 11, 17, 108], ["+", 0, 7, 8, 9, 0, 1, 0, 11...
1
138
N, K = map(int, input().split()) X = list(map(int, input().split())) f,e=0,K for i in range(N-K): if X[e]>X[f]: print("YES") else: print("NO") f+=1 e+=1
N, K = map(int, input().split()) X = list(map(int, input().split())) f,e=0,K for i in range(N-K): if X[e]>X[f]: print("Yes") else: print("No") f+=1 e+=1
[["-", 0, 1, 0, 652, 3, 4, 0, 557, 0, 6], ["+", 0, 1, 0, 652, 3, 4, 0, 557, 0, 6]]
5
81
#include <bits/stdc++.h> using namespace std; int main() { long long N, K; vector<long long> vec; cin >> N >> K; int x; vec.push_back(1); for (long long n = 0; n < N; n++) { cin >> x; vec.push_back(vec.back() + x); } for (long long i = K; i < N; i++) { if (vec.at(i) / vec.at(i - K) < vec...
#include <bits/stdc++.h> using namespace std; int main() { long long N, K; vector<long long> vec; cin >> N >> K; int x; vec.push_back(0); for (long long n = 0; n < N; n++) { cin >> x; vec.push_back(vec.back() + x); } for (long long i = K; i < N; i++) { if (vec.at(i) - vec.at(i - K) < vec...
[["-", 8, 9, 0, 1, 0, 2, 3, 4, 0, 13], ["+", 8, 9, 0, 1, 0, 2, 3, 4, 0, 13], ["-", 0, 57, 15, 339, 51, 16, 31, 16, 17, 85], ["+", 0, 57, 15, 339, 51, 16, 31, 16, 17, 33], ["-", 0, 57, 15, 339, 51, 16, 12, 16, 17, 85], ["+", 0, 57, 15, 339, 51, 16, 12, 16, 17, 33]]
1
155
#include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < (n); i++) using namespace std; typedef long long ll; int main() { int n, k; cin >> n >> k; vector<int> a(n); rep(i, n) cin >> a[i]; vector<ll> b(n); rep(i, n) { if (i == 0) b[i] = a[i]; else b[i] = b[i - 1] * a[i]; } f...
#include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < (n); i++) using namespace std; typedef long long ll; int main() { int n, k; cin >> n >> k; vector<int> a(n); rep(i, n) cin >> a[i]; vector<ll> b(n); rep(i, n) { if (i == 0) b[i] = a[i]; else b[i] = b[i - 1] + a[i]; } f...
[["-", 75, 76, 0, 1, 0, 11, 12, 16, 17, 48], ["+", 75, 76, 0, 1, 0, 11, 12, 16, 17, 72], ["-", 0, 9, 0, 1, 0, 11, 12, 16, 17, 85], ["+", 0, 9, 0, 1, 0, 11, 12, 16, 17, 33], ["-", 8, 9, 0, 43, 49, 50, 51, 16, 17, 85], ["+", 8, 9, 0, 43, 49, 50, 51, 16, 17, 33]]
1
216
#include <bits/stdc++.h> using namespace std; int main() { long long N, K; cin >> N >> K; vector<long long> A(N); for (long long i = 0; i < N; i++) cin >> A.at(i); long long hyoten = 1; for (long long j = 0; j < K; j++) hyoten *= A.at(j); long long hyotmp = hyoten; for (long long i = K; i < N; ...
#include <bits/stdc++.h> using namespace std; int main() { long long N, K; cin >> N >> K; vector<long long> A(N); for (long long i = 0; i < N; i++) cin >> A.at(i); long long hyoten = 1; for (long long j = 0; j < K; j++) { hyoten += A.at(j); // hyoten%=1000000007; } long long hyotmp =...
[["+", 0, 14, 8, 9, 0, 7, 8, 9, 0, 45], ["-", 8, 9, 0, 7, 8, 1, 0, 11, 17, 108], ["+", 0, 7, 8, 9, 0, 1, 0, 11, 17, 107], ["+", 0, 14, 8, 9, 0, 7, 8, 9, 0, 46], ["-", 0, 7, 8, 9, 0, 1, 0, 11, 17, 90], ["+", 0, 7, 8, 9, 0, 1, 0, 11, 17, 110], ["-", 0, 7, 8, 9, 0, 1, 0, 11, 17, 108]]
1
156
#include <bits/stdc++.h> #include <iostream> using namespace std; typedef long long ll; #define endl "\n" void solve() { ll n, k; cin >> n >> k; vector<ll> v; for (ll i = 0; i < n; i++) { ll temp; cin >> temp; v.push_back(temp); } ll i = 0; ll j = k; while (j < v.size()) { if (v[j] >...
#include <bits/stdc++.h> #include <iostream> using namespace std; typedef long long ll; #define endl "\n" void solve() { ll n, k; cin >> n >> k; vector<ll> v; for (ll i = 0; i < n; i++) { ll temp; cin >> temp; v.push_back(temp); } ll i = 0; ll j = k; while (j < v.size()) { if (v[j] >...
[["-", 0, 1, 0, 16, 31, 16, 12, 5, 0, 6], ["+", 0, 1, 0, 16, 31, 16, 12, 5, 0, 6]]
1
154
#include <bits/stdc++.h> #define ll long long #define fi first #define se second #define mp make_pair #define pb push_back #define pii pair<int, int> #define pll pair<long long, long long> #define fastio() \ ios_base::sync_with_stdio(false); ...
#include <bits/stdc++.h> #define ll long long #define fi first #define se second #define mp make_pair #define pb push_back #define pii pair<int, int> #define pll pair<long long, long long> #define fastio() \ ios_base::sync_with_stdio(false); ...
[["-", 0, 14, 8, 9, 0, 7, 15, 16, 12, 22], ["+", 0, 14, 8, 9, 0, 7, 15, 16, 12, 22], ["-", 0, 14, 8, 9, 0, 1, 0, 2, 63, 22], ["-", 8, 9, 0, 1, 0, 2, 3, 4, 0, 24], ["-", 8, 9, 0, 1, 0, 2, 3, 4, 0, 25], ["-", 0, 30, 0, 14, 8, 9, 0, 1, 0, 35]]
1
455
// R<3S #include <bits/stdc++.h> #define hell 1000000007 #define PI 3.14159265358979323844 #define mp make_pair #define pb push_back #define fi first #define se second #define ALL(v) v.begin(), v.end() #define SORT(v) sort(ALL(v)) #define REVERSE(v) reverse(ALL(v)) #define endl "\n" #define vecmax(v) max_element(all(v)...
// R<3S #include <bits/stdc++.h> #define hell 1000000007 #define PI 3.14159265358979323844 #define mp make_pair #define pb push_back #define fi first #define se second #define ALL(v) v.begin(), v.end() #define SORT(v) sort(ALL(v)) #define REVERSE(v) reverse(ALL(v)) #define endl "\n" #define vecmax(v) max_element(all(v)...
[["-", 0, 14, 8, 9, 0, 43, 49, 50, 51, 13], ["+", 0, 14, 8, 9, 0, 43, 49, 50, 51, 13]]
1
392
#include <bits/stdc++.h> #define all(X) (X).begin(), (X).end() #define rall(X) (X).rbegin(), (X).rend() #define pub push_back #define puf push_front #define pob pop_back #define pof pop_front #define ff first #define ss second #define P 1000000007 #define in(x, a, b) (a <= x && x < b) using namespace std; using ll = l...
#include <bits/stdc++.h> #define all(X) (X).begin(), (X).end() #define rall(X) (X).rbegin(), (X).rend() #define pub push_back #define puf push_front #define pob pop_back #define pof pop_front #define ff first #define ss second #define P 1000000007 #define in(x, a, b) (a <= x && x < b) using namespace std; using ll = l...
[["-", 0, 14, 8, 9, 0, 43, 49, 50, 51, 13], ["+", 0, 14, 8, 9, 0, 43, 49, 50, 51, 13]]
1
320
#include <bits/stdc++.h> using namespace std; const int N = 2e5 + 7; typedef long long ll; ll a[N], k; int n; bool judge(ll x) { int ans = 0; for (int i = 1; i <= n; i++) { if (a[i] > x) { int cnt = a[i] / x; if (a[i] % x == 0) { ans += cnt - 1; } else { ans += cnt; } ...
#include <bits/stdc++.h> using namespace std; const int N = 2e5 + 7; typedef long long ll; ll a[N], k; int n; bool judge(ll x) { ll ans = 0; for (int i = 1; i <= n; i++) { if (a[i] > x) { ll cnt = a[i] / x; if (a[i] % x == 0) { ans += cnt - 1; } else { ans += cnt; } ...
[["-", 0, 30, 0, 14, 8, 9, 0, 43, 39, 40], ["+", 0, 30, 0, 14, 8, 9, 0, 43, 39, 78], ["-", 8, 9, 0, 57, 64, 9, 0, 43, 39, 40], ["+", 8, 9, 0, 57, 64, 9, 0, 43, 39, 78], ["-", 0, 14, 8, 9, 0, 43, 49, 50, 51, 13], ["+", 0, 14, 8, 9, 0, 43, 49, 50, 51, 13]]
1
235
def main(): n,k=map(int,input().split()) lst=sorted(list(map(int,input().split()))) left=0 right=lst[-1] while right-left>1: mid=(right+left)//2 sm=0 for x in lst: sm+=x//mid if sm<=k: right=mid else : left=mid print(r...
def main(): n,k=map(int,input().split()) lst=sorted(list(map(int,input().split()))) left=0 right=lst[-1] while right-left>1: mid=(right+left)//2 sm=0 for x in lst: sm+=(x-1)//mid if sm<=k: right=mid else : left=mid pri...
[["+", 0, 1, 0, 677, 12, 657, 31, 23, 0, 24], ["+", 0, 677, 12, 657, 31, 23, 0, 657, 17, 33], ["+", 0, 677, 12, 657, 31, 23, 0, 657, 12, 612], ["+", 0, 1, 0, 677, 12, 657, 31, 23, 0, 25]]
5
100
#include <algorithm> #include <cstdio> #include <cstring> #include <iostream> #include <map> using namespace std; typedef long long ll; ll mod = 1e9 + 7; int a[200010], n, k; bool check(int x) { int p = 0; if (x == 0) return false; for (int i = 1; i <= n; i++) { p += a[i] / x; if (a[i] & x == 0) ...
#include <algorithm> #include <cstdio> #include <cstring> #include <iostream> #include <map> using namespace std; typedef long long ll; ll mod = 1e9 + 7; int a[200010], n, k; bool check(int x) { int p = 0; if (x == 0) return false; for (int i = 1; i <= n; i++) { p += a[i] / x; if (a[i] % x == 0) ...
[["-", 8, 9, 0, 57, 15, 339, 51, 16, 17, 67], ["+", 0, 57, 15, 339, 51, 16, 31, 16, 17, 109]]
1
204
#include <bits/stdc++.h> using namespace std; #define pi 3.14159265358979 #define mod 1000000007 #define ll long long int #define rep(i, a, b) for (ll i = a; i < b; i++) #define repn(i, a, b) for (ll i = a; i > b; i--) #define mod1 1000003 #define mod2 998244353 #define inf 2e18 #define hi "hello" #define nl "\n" #def...
#include <bits/stdc++.h> using namespace std; #define pi 3.14159265358979 #define mod 1000000007 #define ll long long int #define rep(i, a, b) for (ll i = a; i < b; i++) #define repn(i, a, b) for (ll i = a; i > b; i--) #define mod1 1000003 #define mod2 998244353 #define inf 2e18 #define hi "hello" #define nl "\n" #def...
[["-", 0, 14, 8, 9, 0, 43, 49, 50, 51, 13], ["+", 0, 14, 8, 9, 0, 43, 49, 50, 51, 13]]
1
487
#input of int(split by space) def get_i() return gets.chomp.split(" ").map(&:to_i) end #input of float(split by space) def get_f() return gets.chomp.split(" ").map(&:to_f) end #input of string(split by space) def get() return gets.chomp.split(" ") end #input of string(split per one character) def get_nsp() retu...
#input of int(split by space) def get_i() return gets.chomp.split(" ").map(&:to_i) end #input of float(split by space) def get_f() return gets.chomp.split(" ").map(&:to_f) end #input of string(split by space) def get() return gets.chomp.split(" ") end #input of string(split per one character) def get_nsp() retu...
[["-", 196, 737, 8, 736, 0, 751, 15, 738, 17, 18], ["+", 196, 737, 8, 736, 0, 751, 15, 738, 17, 19]]
4
305
import math N,K = map(int, input().split()) A = list(map(int, input().split())) epsilon = 10**(-9) #A = [a-epsilon for a in A] _min = 0 _max = max(A) while _max - _min < epsilon: new = (_min+_max)/2 if _min < int(new): new = int(new) times = sum([math.ceil(a/new)-1 for a in A]) #print(_min, new, _max, ti...
import math N,K = map(int, input().split()) A = list(map(int, input().split())) epsilon = 10**(-5) #A = [a-epsilon for a in A] _min = 0 _max = max(A) while _max - _min > epsilon: new = (_min+_max)/2 if _min < int(new): new = int(new) times = sum([math.ceil(a/new)-1 for a in A]) #print(_min, new, _max, ti...
[["-", 0, 662, 12, 657, 12, 23, 0, 664, 28, 612], ["+", 0, 662, 12, 657, 12, 23, 0, 664, 28, 612], ["-", 36, 36, 0, 656, 0, 52, 15, 666, 667, 18], ["+", 36, 36, 0, 656, 0, 52, 15, 666, 667, 47]]
5
162
#include <bits/stdc++.h> using namespace std; typedef long long ll; typedef long double ld; #define X first; #define Y second; typedef pair<int, int> pii; typedef pair<ll, int> pli; typedef pair<ll, ll> pll; const ll INF = 2e18; const int inf = 1e9 + 10; const int maxN = 2e5 + 10; const int maxK = 1e4 + 10; const int ...
#include <bits/stdc++.h> using namespace std; typedef long long ll; typedef long double ld; #define X first; #define Y second; typedef pair<int, int> pii; typedef pair<ll, int> pli; typedef pair<ll, ll> pll; const ll INF = 2e18; const int inf = 1e9 + 10; const int maxN = 2e5 + 10; const int maxK = 1e4 + 10; const int ...
[["-", 0, 14, 8, 9, 0, 43, 49, 50, 51, 13], ["+", 0, 14, 8, 9, 0, 43, 49, 50, 51, 13]]
1
302
#include <algorithm> #include <bitset> #include <cmath> #include <iostream> #include <queue> #include <set> #include <string> #include <vector> using namespace std; using ll = long long int; using dd = long double; int main() { ll N, K; cin >> N >> K; vector<ll> log(N); for (ll i = 0; i < N; i++) { cin >>...
#include <algorithm> #include <bitset> #include <cmath> #include <iostream> #include <queue> #include <set> #include <string> #include <vector> using namespace std; using ll = long long int; using dd = long double; int main() { ll N, K; cin >> N >> K; vector<ll> log(N); for (ll i = 0; i < N; i++) { cin >>...
[["-", 0, 14, 8, 9, 0, 43, 49, 50, 51, 13], ["+", 0, 14, 8, 9, 0, 43, 49, 50, 51, 13]]
1
279
#include <algorithm> #include <iostream> #include <map> #include <math.h> #include <queue> #include <set> #include <stdio.h> #include <string.h> #include <vector> using namespace std; typedef long long ll; const int maxn = 2e5 + 10; const int inf = 0x3f3f3f3f; const int mod = 1e9 + 7; int n, a[maxn], k; bool judge(int ...
#include <algorithm> #include <iostream> #include <map> #include <math.h> #include <queue> #include <set> #include <stdio.h> #include <string.h> #include <vector> using namespace std; typedef long long ll; const int maxn = 2e5 + 10; const int inf = 0x3f3f3f3f; const int mod = 1e9 + 7; int n, a[maxn], k; bool judge(int ...
[["-", 0, 14, 8, 9, 0, 43, 49, 50, 51, 13], ["+", 0, 14, 8, 9, 0, 43, 49, 50, 51, 13]]
1
196
#include <bits/stdc++.h> #include <unistd.h> #define fi first #define se second #define rep(i, n) for (ll i = 0; i < (n); ++i) #define rep1(i, n) for (ll i = 1; i <= (n); ++i) #define rrep(i, n) for (ll i = (n)-1; i >= 0; --i) #define ALL(a) a.begin(), a.end() #define pb push_back #define dame ...
#include <bits/stdc++.h> #include <unistd.h> #define fi first #define se second #define rep(i, n) for (ll i = 0; i < (n); ++i) #define rep1(i, n) for (ll i = 1; i <= (n); ++i) #define rrep(i, n) for (ll i = (n)-1; i >= 0; --i) #define ALL(a) a.begin(), a.end() #define pb push_back #define dame ...
[["-", 0, 14, 8, 9, 0, 43, 49, 50, 51, 13], ["+", 0, 14, 8, 9, 0, 43, 49, 50, 51, 13]]
1
1,675
#include <bits/stdc++.h> using namespace std; const int nax = 2e5 + 10; int n, k; int a[nax]; int main() { cin.tie(0)->sync_with_stdio(false); cin >> n >> k; for (int i = 1; i <= n; ++i) { cin >> a[i]; } int l = 0, r = 1e9; int ans = -1; while (l <= r) { int mid = l + r >> 1; long long tot...
#include <bits/stdc++.h> using namespace std; const int nax = 2e5 + 10; int n, k; int a[nax]; int main() { cin.tie(0)->sync_with_stdio(false); cin >> n >> k; for (int i = 1; i <= n; ++i) { cin >> a[i]; } int l = 1, r = 1e9; int ans = -1; while (l <= r) { int mid = l + r >> 1; long long tot...
[["-", 0, 14, 8, 9, 0, 43, 49, 50, 51, 13], ["+", 0, 14, 8, 9, 0, 43, 49, 50, 51, 13]]
1
183
N,K = map(int,input().split()) A = list(map(int,input().split())) A.sort() def f(A,N): ans = 0 for i in range(len(A)): ans += -(-A[i]//N) - 1 return ans ok = 1000000000 ng = 1 while abs(ok-ng) > 1: mid = (ok+ng) // 2 if f(A,mid) <= K: ok = mid else: ng = mid print(ok)
N,K = map(int,input().split()) A = list(map(int,input().split())) A.sort() def f(A,N): ans = 0 for i in range(len(A)): ans += -(-A[i]//N) - 1 return ans ok = 10000000000 ng = 0 while abs(ok-ng) > 1: mid = (ok+ng) // 2 if f(A,mid) <= K: ok = mid else: ng = mid print(ok)
[["-", 36, 36, 0, 656, 0, 1, 0, 662, 12, 612], ["+", 36, 36, 0, 656, 0, 1, 0, 662, 12, 612]]
5
123
#include "bits/stdc++.h" using namespace std; #ifdef _DEBUG #define dlog(str) cout << "====" << str << endl; #else #define dlog(str) #endif #define INF 999999999 #define MOD 1000000007 #define REP(i, n) for (int i = 0, i##_l = (n); i < i##_l; i++) #define FOR(i, s, e) for (int i = s, i##_l = (e); i < i##_l; i++) #defin...
#include "bits/stdc++.h" using namespace std; #ifdef _DEBUG #define dlog(str) cout << "====" << str << endl; #else #define dlog(str) #endif #define INF 999999999 #define MOD 1000000007 #define REP(i, n) for (int i = 0, i##_l = (n); i < i##_l; i++) #define FOR(i, s, e) for (int i = s, i##_l = (e); i < i##_l; i++) #defin...
[["-", 0, 14, 8, 9, 0, 43, 49, 50, 51, 13], ["+", 0, 14, 8, 9, 0, 43, 49, 50, 51, 13]]
1
248
#include <bits/stdc++.h> #pragma GCC optimize("unroll-loops,no-stack-protector") #pragma GCC target("sse,sse2,ssse3,sse4,popcnt,abm,mmx,avx,tune=native") #define watch(x) cout << (#x) << " is " << (x) << endl #define debug cout << "hi" << endl using namespace std; typedef long long ll; typedef long double ld; typedef ...
#include <bits/stdc++.h> #pragma GCC optimize("unroll-loops,no-stack-protector") #pragma GCC target("sse,sse2,ssse3,sse4,popcnt,abm,mmx,avx,tune=native") #define watch(x) cout << (#x) << " is " << (x) << endl #define debug cout << "hi" << endl using namespace std; typedef long long ll; typedef long double ld; typedef ...
[["-", 64, 9, 0, 1, 0, 11, 12, 16, 17, 72], ["+", 64, 9, 0, 1, 0, 11, 12, 16, 17, 33], ["-", 0, 14, 8, 9, 0, 43, 49, 50, 51, 13], ["+", 0, 14, 8, 9, 0, 43, 49, 50, 51, 13]]
1
326
import math def f(A, m, K): p = sum([a // m for a in A]) if p > K: return False else: return True N, K = map(int, input().split()) A = list(map(int, input().split())) left = 1 right = 10 ** 9 while int(left) != int(right): m = (left + right) / 2 if f(A, m, K): right =...
import math def f(A, m, K): p = sum([a // m for a in A]) if p > K: return False else: return True N, K = map(int, input().split()) A = list(map(int, input().split())) left = 0 right = 10 ** 9 + 1 while int(left) != int(right): m = (left + right) / 2 if f(A, m, K): rig...
[["-", 36, 36, 0, 656, 0, 1, 0, 662, 12, 612], ["+", 36, 36, 0, 656, 0, 1, 0, 662, 12, 612], ["+", 0, 656, 0, 1, 0, 662, 12, 657, 17, 72], ["+", 0, 656, 0, 1, 0, 662, 12, 657, 12, 612]]
5
125
#include <bits/stdc++.h> using namespace std; #define rep(i, n) for (int i = 0; i < n; ++i) using ll = long long; int main() { ios::sync_with_stdio(false); cin.tie(0); ll n, k; cin >> n >> k; vector<ll> A(n); rep(i, n) cin >> A[i]; ll l = 1, r = 0; rep(i, n) r = max(r, A[i]); while (l < r) { ll me...
#include <bits/stdc++.h> using namespace std; #define rep(i, n) for (int i = 0; i < n; ++i) using ll = long long; int main() { ios::sync_with_stdio(false); cin.tie(0); ll n, k; cin >> n >> k; vector<ll> A(n); rep(i, n) cin >> A[i]; ll l = 1, r = 0; rep(i, n) r = max(r, A[i]); while (l < r) { ll me...
[["+", 0, 11, 12, 23, 0, 16, 31, 23, 0, 24], ["+", 12, 23, 0, 16, 31, 23, 0, 16, 17, 33], ["+", 12, 23, 0, 16, 31, 23, 0, 16, 12, 13], ["+", 0, 11, 12, 23, 0, 16, 31, 23, 0, 25], ["-", 8, 9, 0, 1, 0, 16, 31, 16, 12, 22], ["+", 8, 9, 0, 1, 0, 16, 31, 16, 12, 22]]
1
169
def main(): import sys input = sys.stdin.readline sys.setrecursionlimit(10**6) N, K = [int(x) for x in input().strip().split()] A = [int(x) for x in input().strip().split()] l, r = 1, max(A) def f(m): ret = 0 # print('m={}'.format(m)) for a in A: ret += (a...
def main(): import sys input = sys.stdin.readline sys.setrecursionlimit(10**6) N, K = [int(x) for x in input().strip().split()] A = [int(x) for x in input().strip().split()] l, r = 0, max(A) def f(m): ret = 0 # print('m={}'.format(m)) for a in A: ret += (a...
[["-", 8, 196, 0, 1, 0, 662, 12, 432, 0, 612], ["+", 8, 196, 0, 1, 0, 662, 12, 432, 0, 612]]
5
164
//! 尺卂乃卂.卂フ乇乇ㄒ #include <bits/stdc++.h> //#include <ext/pb_ds/detail/standard_policies.hpp> using namespace std; // Using namespace __gnu_pbds; // typedef // tree<int,null_type,less<int>,rb_tree_tag,tree_order_statistics_node_update> // Ordered_set; #define ll long long #define int long long #define ld long double #de...
//! 尺卂乃卂.卂フ乇乇ㄒ #include <bits/stdc++.h> //#include <ext/pb_ds/detail/standard_policies.hpp> using namespace std; // Using namespace __gnu_pbds; // typedef // tree<int,null_type,less<int>,rb_tree_tag,tree_order_statistics_node_update> // Ordered_set; #define ll long long #define int long long #define ld long double #de...
[["-", 8, 9, 0, 52, 15, 339, 51, 16, 12, 13], ["+", 8, 9, 0, 52, 15, 339, 51, 16, 12, 13], ["-", 64, 9, 0, 1, 0, 11, 12, 16, 17, 33], ["-", 64, 9, 0, 1, 0, 11, 12, 16, 12, 13]]
1
663
#include <bits/stdc++.h> using namespace std; #define ll long long int #define rep(i, n) for (i = 0; i < (n); i++) #define pb push_back #define mp make_pair #define ff first #define ss second #define all(c) c.begin(), c.end() #define endl "\n" typedef pair<ll, ll> lpair; vector<ll> a; ll k; bool poss(ll sz) { ll cn...
#include <bits/stdc++.h> using namespace std; #define ll long long int #define rep(i, n) for (i = 0; i < (n); i++) #define pb push_back #define mp make_pair #define ff first #define ss second #define all(c) c.begin(), c.end() #define endl "\n" typedef pair<ll, ll> lpair; vector<ll> a; ll k; bool poss(ll sz) { ll cn...
[["+", 8, 1, 0, 11, 12, 16, 31, 23, 0, 24], ["+", 0, 11, 12, 16, 31, 23, 0, 16, 17, 33], ["+", 0, 11, 12, 16, 31, 23, 0, 16, 12, 13], ["+", 8, 1, 0, 11, 12, 16, 31, 23, 0, 25]]
1
264
//#include<i_am_noob_orz> #include <bits/stdc++.h> using namespace std; #define ll long long #define int ll #define ull unsigned long long #define pii pair<int, int> #define X first #define Y second #define mod ((ll)1e9 + 7) #define pb push_back #define mp make_pair #define abs(x) ((x) > 0 ? (x) : (-(x))) #define F(n) ...
//#include<i_am_noob_orz> #include <bits/stdc++.h> using namespace std; #define ll long long #define int ll #define ull unsigned long long #define pii pair<int, int> #define X first #define Y second #define mod ((ll)1e9 + 7) #define pb push_back #define mp make_pair #define abs(x) ((x) > 0 ? (x) : (-(x))) #define F(n) ...
[["-", 0, 14, 8, 9, 0, 43, 49, 50, 51, 13], ["+", 0, 14, 8, 9, 0, 43, 49, 50, 51, 13]]
1
291
// internal // _removeAt(index) will remove the item at the given index from the queue, // retaining balance. returns the removed item, or undefined if nothing is // removed. FastPriorityQueue.prototype._removeAt = function(index) { if (index > this.size - 1 || index < 0) return undefined; // impl1: // this...
// internal // _removeAt(index) will remove the item at the given index from the queue, // retaining balance. returns the removed item, or undefined if nothing is // removed. FastPriorityQueue.prototype._removeAt = function(index) { if (index > this.size - 1 || index < 0) return undefined; // impl1: // this...
[["-", 8, 556, 0, 52, 15, 23, 0, 16, 17, 18], ["+", 8, 556, 0, 52, 15, 23, 0, 16, 17, 19]]
2
1,676
#include <bits/stdc++.h> using namespace std; #define pb push_back #define mp make_pair #define fs first #define fst first #define sc second #define snd second #define sz(X) (int)(X).size() #define forn(i, n) for (int i = 0; i < int(n); i++) #define fornr(i, n) for (int i = int(n) - 1; i >= 0; i--) #define forab(i, a...
#include <bits/stdc++.h> using namespace std; #define pb push_back #define mp make_pair #define fs first #define fst first #define sc second #define snd second #define sz(X) (int)(X).size() #define forn(i, n) for (int i = 0; i < int(n); i++) #define fornr(i, n) for (int i = int(n) - 1; i >= 0; i--) #define forab(i, a...
[["-", 0, 14, 8, 9, 0, 43, 49, 50, 51, 13], ["+", 0, 14, 8, 9, 0, 43, 49, 50, 51, 13]]
1
255
(n,k)=gets.split.map(&:to_i) a=gets.split.map(&:to_i) r = ([a.sum / (k+a.size),0].max..a.max).bsearch {|x| a.sum{|t| (t-1)/x } <= k } print r
(n,k)=gets.split.map(&:to_i) a=gets.split.map(&:to_i) r = ([a.sum / (k+a.size),1].max..a.max).bsearch {|x| a.sum{|t| (t-1)/x } <= k } print r
[["-", 486, 739, 0, 475, 756, 652, 486, 516, 0, 612], ["+", 486, 739, 0, 475, 756, 652, 486, 516, 0, 612]]
4
77