problem_id
stringlengths
6
6
language
stringclasses
2 values
original_status
stringclasses
3 values
original_src
stringlengths
19
243k
changed_src
stringlengths
19
243k
change
stringclasses
3 values
i1
int64
0
8.44k
i2
int64
0
8.44k
j1
int64
0
8.44k
j2
int64
0
8.44k
error
stringclasses
270 values
stderr
stringlengths
0
226k
p02921
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; #define rep(i, n) for (int i = 0; i < (n); i++) int main() { string s, t; rep(i, 3) cin >> s.at(i); rep(i, 3) cin >> t.at(i); int count = 0; rep(i, 3) { if (s.at(i) == t.at(i)) count++; } cout << count << endl; }
#include <bits/stdc++.h> using namespace std; #define rep(i, n) for (int i = 0; i < (n); i++) int main() { string s, t; cin >> s >> t; int count = 0; rep(i, 3) { if (s.at(i) == t.at(i)) count++; } cout << count << endl; }
replace
5
7
5
6
-6
terminate called after throwing an instance of 'std::out_of_range' what(): basic_string::at: __n (which is 0) >= this->size() (which is 0)
p02921
C++
Runtime Error
#include <iostream> #include <string> using namespace std; int main() { string S, T; int ans; cin >> S; cin >> T; for (int i = 0; i != 3; i++) { if (S[i] == T[i]) ans++; } return ans; }
#include <iostream> #include <string> using namespace std; int main() { string S, T; int ans; cin >> S; cin >> T; for (int i = 0; i != 3; i++) { if (S[i] == T[i]) ans++; } cout << ans << endl; return 0; }
replace
13
14
13
15
2
p02921
C++
Runtime Error
#include <stdio.h> int main(void) { char s[3], t[3]; int i, c; for (i = 0; i < 3; i++) { scanf("%c", s[i]); } for (i = 0; i < 3; i++) { scanf("%c", t[i]); } c = 0; for (i = 0; i < 3; i++) { if (s[i] == t[i]) c++; } printf("%d\n", c); return 0; }
#include <stdio.h> int main(void) { char s[3], t[3]; int i, c; scanf("%s", s); scanf("%s", t); c = 0; for (i = 0; i < 3; i++) { if (s[i] == t[i]) c++; } printf("%d\n", c); return 0; }
replace
4
10
4
6
0
p02921
C++
Runtime Error
#include <bits/stdc++.h> #ifdef ONLINE_JUDGE #define freopen(N, M, Q) #endif #define ll long long #define fi first #define se second #define pb push_back #define eb emplace_back #define all(N) N.begin(), N.end() using namespace std; const ll INF = 1e9; int main() { ios_base::sync_with_stdio(false); freopen("in...
#include <bits/stdc++.h> #ifdef ONLINE_JUDGE #define freopen(N, M, Q) #endif #define ll long long #define fi first #define se second #define pb push_back #define eb emplace_back #define all(N) N.begin(), N.end() using namespace std; const ll INF = 1e9; int main() { ios_base::sync_with_stdio(false); // freopen(...
replace
19
20
19
20
0
p02922
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; int main() { int A, B; cin >> A >> B; return max(1, B / A + int(B % A != 0)); }
#include <bits/stdc++.h> using namespace std; int main() { int A, B; cin >> A >> B; A--; B--; cout << B / A + int(B % A != 0) << endl; return 0; }
replace
5
6
5
9
3
p02922
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; int main() { int a, b; cin >> a >> b; int ans = 0; int cnt = 1; while (cnt < b) { cnt += a - 1; ans++; } cout << ans << endl; return 1; }
#include <bits/stdc++.h> using namespace std; int main() { int a, b; cin >> a >> b; int ans = 0; int cnt = 1; while (cnt < b) { cnt += a - 1; ans++; } cout << ans << endl; return 0; }
replace
13
14
13
14
1
p02922
C++
Time Limit Exceeded
#include <algorithm> #include <cmath> #include <iostream> #include <string> using namespace std; typedef long long ll; ll deg(ll n) { ll count = 0; while (n != 0) { n /= 10; count++; } return count; } int main() { int a, b; cin >> a >> b; int ans = 0; int sum = 1; while (sum < b) { ans++; ...
#include <algorithm> #include <cmath> #include <iostream> #include <string> using namespace std; typedef long long ll; ll deg(ll n) { ll count = 0; while (n != 0) { n /= 10; count++; } return count; } int main() { int a, b; cin >> a >> b; int ans = 0; int sum = 1; while (sum < b) { ans++; ...
replace
21
22
21
22
TLE
p02922
C++
Runtime Error
#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 a, b; cin >> a >> b; int t = a - 1; int s = b - 1; int ans = (t + s - 1) / s; cout << ans << endl; return 0; }
#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 a, b; cin >> a >> b; int s = a - 1; int t = b - 1; int ans = (t + s - 1) / s; cout << ans << endl; return 0; }
replace
8
10
8
10
0
p02922
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; int main() { string s, t; cin >> s >> t; int cnt = 0; for (int i = 0; i < 3; i++) { if (s.at(i) == t.at(i)) cnt++; } cout << cnt; }
#include <bits/stdc++.h> using namespace std; int main() { int a, b, cnt = 0, x = 1; cin >> a >> b; while (x < b) { x = x - 1 + a; cnt++; } cout << cnt; }
replace
4
10
4
9
-6
terminate called after throwing an instance of 'std::out_of_range' what(): basic_string::at: __n (which is 1) >= this->size() (which is 1)
p02922
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; int main() { int n, m; cin >> m >> n; m--; cout << (m + n - 2) / (n - 1) << endl; return 0; }
#include <bits/stdc++.h> using namespace std; int main() { int n, m; cin >> n >> m; m--; cout << (m + n - 2) / (n - 1) << endl; return 0; }
replace
4
5
4
5
0
p02922
Python
Runtime Error
A, B = map(int, input().split()) if B == 1: print(0) else: C = A cnt = 1 while C < B: C += A - 1 cnt += 1 print(cnt)
A, B = map(int, input().split()) if B == 1: print(0) else: C = A cnt = 1 while C < B: C += A - 1 cnt += 1 print(cnt)
replace
10
12
10
11
0
p02922
C++
Time Limit Exceeded
#include <iostream> using namespace std; int main(void) { int a, b; int i = 0; cin >> a >> b; int sum = 1; while (1) { sum = 1; if (sum >= b) break; i++; sum--; sum += a; } cout << i; }
#include <iostream> using namespace std; int main(void) { int a, b; int i = 0; cin >> a >> b; int sum = 1; while (1) { if (sum >= b) break; i++; sum--; sum += a; } cout << i; }
replace
9
10
9
10
TLE
p02922
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; int main() { ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL); #ifndef ONLINE_JUDGE freopen("input.txt", "r", stdin); freopen("output.txt", "w", stdout); #endif int a; cin >> a; int b; cin >> b; if (b == 1) { cout << 0 << '\n'; ret...
#include <bits/stdc++.h> using namespace std; int main() { ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL); int a; cin >> a; int b; cin >> b; if (b == 1) { cout << 0 << '\n'; return 0; } float x = ceil(float(b - 1) / (a - 1)); cout << (int)x << '\n'; return 0; }
delete
6
10
6
6
0
p02922
C++
Time Limit Exceeded
/// Bismillahir Rahmanir Rahim /// ALLAH HU AKBAR #include <bits/stdc++.h> using namespace std; int main() { int A, B; int count = 1; cin >> A >> B; int y = A - 1; int x = A; while (A < B) { x--; x = x + A; count++; } if (B <= 1) count = 0; cout << count << endl; }
/// Bismillahir Rahmanir Rahim /// ALLAH HU AKBAR #include <bits/stdc++.h> using namespace std; int main() { int A, B; int count = 1; cin >> A >> B; int y = A - 1; int x = A; while (x < B) { x--; x = x + A; count++; } if (B <= 1) count = 0; cout << count << endl; }
replace
10
11
10
11
TLE
p02922
C++
Runtime Error
#include <algorithm> #include <bitset> #include <cctype> #include <cmath> #include <complex> #include <functional> #include <iomanip> #include <iostream> #include <map> #include <numeric> #include <queue> #include <set> #include <string> #include <unordered_map> #include <vector> #define rep(i, n) for (int i = 0; i < ...
#include <algorithm> #include <bitset> #include <cctype> #include <cmath> #include <complex> #include <functional> #include <iomanip> #include <iostream> #include <map> #include <numeric> #include <queue> #include <set> #include <string> #include <unordered_map> #include <vector> #define rep(i, n) for (int i = 0; i < ...
replace
48
49
48
49
0
p02922
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; int main() { int a, b; cin >> a >> b; b--; a--; cout << (b - 1) / (a - 1) + 1 << endl; return 0; }
#include <bits/stdc++.h> using namespace std; int main() { int a, b; cin >> a >> b; cout << (b + a - 3) / (a - 1) << endl; return 0; }
replace
5
8
5
6
0
p02922
C++
Time Limit Exceeded
#include <bits/stdc++.h> using namespace std; int main() { int a, b; cin >> a >> b; int ans = 0; int x = 1; while (x < b) { x--; ans += a; } cout << ans << endl; return 0; }
#include <bits/stdc++.h> using namespace std; int main() { int a, b; cin >> a >> b; int ans = 0; int x = 1; while (x < b) { x--; x += a; ans++; } cout << ans << endl; return 0; }
replace
11
12
11
13
TLE
p02922
C++
Time Limit Exceeded
#include <iostream> using namespace std; int main() { int A, B; cin >> A >> B; int c = 1, out = A; if (B == 1) { c = 0; } else { while (A < B) { out += A - 1; c++; } } cout << c << endl; return 0; }
#include <iostream> using namespace std; int main() { int A, B; cin >> A >> B; int c = 1, out = A; if (B == 1) { c = 0; } else { while (out < B) { out += A - 1; c++; } } cout << c << endl; return 0; }
replace
9
10
9
10
TLE
p02922
C++
Runtime Error
#include <bits/stdc++.h> #include <ext/pb_ds/assoc_container.hpp> using namespace std; using namespace __gnu_pbds; const long long MOD = 1000000007LL; const long long INF = 1e18; int GCD(int a, int b) { return b == 0 ? a : GCD(b, a % b); } long long fast_exp(long long base, long long exp, long long mod = MOD) { lon...
#include <bits/stdc++.h> #include <ext/pb_ds/assoc_container.hpp> using namespace std; using namespace __gnu_pbds; const long long MOD = 1000000007LL; const long long INF = 1e18; int GCD(int a, int b) { return b == 0 ? a : GCD(b, a % b); } long long fast_exp(long long base, long long exp, long long mod = MOD) { lon...
replace
62
63
62
63
0
p02922
C++
Runtime Error
#include <cctype> #include <cerrno> #include <cfloat> #include <ciso646> #include <climits> #include <clocale> #include <cmath> #include <csetjmp> #include <csignal> #include <cstdarg> #include <cstddef> #include <cstdio> #include <cstdlib> #include <cstring> #include <ctime> #include <algorithm> #include <bitset> #in...
#include <cctype> #include <cerrno> #include <cfloat> #include <ciso646> #include <climits> #include <clocale> #include <cmath> #include <csetjmp> #include <csignal> #include <cstdarg> #include <cstddef> #include <cstdio> #include <cstdlib> #include <cstring> #include <ctime> #include <algorithm> #include <bitset> #in...
replace
71
72
71
78
0
p02922
C++
Time Limit Exceeded
#include <iostream> using namespace std; int main() { int a, b, cnt = 0; cin >> a >> b; while (b > 1) { b - a + 1; cnt++; } cout << cnt; return 0; }
#include <iostream> using namespace std; int main() { int a, b, cnt = 0; cin >> a >> b; while (b > 1) { b -= a - 1; cnt++; } cout << cnt; return 0; }
replace
6
7
6
7
TLE
p02922
C++
Runtime Error
#include <iostream> int main() { int A, B; std::cin >> A >> B; int curr = 1; int cnt = 0; while (curr < B) { curr += (A - 1); cnt++; } return cnt; }
#include <iostream> int main() { int A, B; std::cin >> A >> B; int curr = 1; int cnt = 0; while (curr < B) { curr += (A - 1); cnt++; } std::cout << cnt; return 0; }
replace
13
14
13
15
3
p02922
C++
Runtime Error
#include <iostream> using namespace std; int main() { int a, b; cin >> a >> b; int tapNum = 0; int socket = 1; while (socket < b) { socket += a - 1; tapNum++; } return tapNum; }
#include <iostream> using namespace std; int main() { int a, b; cin >> a >> b; int tapNum = 0; int socket = 1; while (socket < b) { socket += a - 1; tapNum++; } cout << tapNum << endl; return 0; }
replace
12
13
12
14
3
p02922
C++
Time Limit Exceeded
#include <iostream> using namespace std; int main() { int a, b; cin >> b; int cur = 1, res = 0; while (cur < b) { ++res; cur += a - 1; } cout << res << endl; return 0; }
#include <iostream> using namespace std; int main() { int a, b; cin >> a >> b; int cur = 1, res = 0; while (cur < b) { ++res; cur += a - 1; } cout << res << endl; return 0; }
replace
6
7
6
7
TLE
p02922
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; typedef long long ll; int main() { int a, b; cin >> a >> b; int origin = (b - 1 + a - 2) / (a - 1); int cur = 1; int cnt = 0; while (true) { if (cur * a >= b) { break; } cur *= a; } int has = (cur) / (a - 1); for (int i = 0; i <= 50; i...
#include <bits/stdc++.h> using namespace std; typedef long long ll; int main() { int a, b; cin >> a >> b; int origin = (b - 1 + a - 2) / (a - 1); int cur = 1; int cnt = 0; while (true) { if (cur * a >= b) { break; } cur *= a; } int has = (cur - 1) / (a - 1); for (int i = 0; i <= 5...
replace
18
19
18
19
0
p02922
C++
Time Limit Exceeded
/* author : s@if */ #include <bits/stdc++.h> using namespace std; #define NIL -1 #define fi first #define sec second #define MAX INT_MAX #define INF 99999999 #define ll long long #define PI acos(-1.0) #define MOD 1000000007 #define PLL pair<ll, ll> #define PII pair<int, int> #define ull unsigned long long #defi...
/* author : s@if */ #include <bits/stdc++.h> using namespace std; #define NIL -1 #define fi first #define sec second #define MAX INT_MAX #define INF 99999999 #define ll long long #define PI acos(-1.0) #define MOD 1000000007 #define PLL pair<ll, ll> #define PII pair<int, int> #define ull unsigned long long #defi...
replace
71
72
71
72
TLE
p02922
C++
Time Limit Exceeded
// #pragma GCC optimize("O3", "unroll-loops") // #pragma GCC target("avx2") #include <bits/stdc++.h> #define FAST \ ios_base::sync_with_stdio(0); \ cin.tie(0); ...
// #pragma GCC optimize("O3", "unroll-loops") // #pragma GCC target("avx2") #include <bits/stdc++.h> #define FAST \ ios_base::sync_with_stdio(0); \ cin.tie(0); ...
delete
115
119
115
115
TLE
p02923
C++
Runtime Error
#include <algorithm> #include <cmath> #include <iostream> #include <string> #include <vector> using namespace std; long long MOD = 1000000007; int main() { long long n; long long h[10100]; cin >> n; for (size_t i = 0; i < n; i++) { cin >> h[i]; } int tempCount = 0; int maxCount = 0; for (size_...
#include <algorithm> #include <cmath> #include <iostream> #include <string> #include <vector> using namespace std; long long MOD = 1000000007; int main() { long long n; long long h[100100]; cin >> n; for (size_t i = 0; i < n; i++) { cin >> h[i]; } int tempCount = 0; int maxCount = 0; for (size...
replace
13
14
13
14
0
p02923
C++
Time Limit Exceeded
#include <iostream> using namespace std; int main() { int A = 0, N, Z, a; cin >> N; int B[N]; for (int i = 0; i < N; i++) { cin >> B[i]; } N -= 1; for (int s = 0; s < N; s++) { Z = 0; a = s + 1; for (int x = s; B[x] >= B[a] && x < N; x++) { Z++; a++; } if (A < Z) { ...
#include <iostream> using namespace std; int main() { int A = 0, N, Z, a; cin >> N; int B[N]; for (int i = 0; i < N; i++) { cin >> B[i]; } N -= 1; for (int s = 0; s < N; s++) { Z = 0; a = s + 1; if (A < N - s) { for (int x = s; B[x] >= B[a] && x < N; x++) { Z++; a++;...
replace
14
20
14
22
TLE
p02923
Python
Time Limit Exceeded
n = int(input()) height = list(map(int, input().split())) max_count = 0 for i in range(n): count = 0 for j in range(i, n): if j == n - 1 or height[j] < height[j + 1]: break count += 1 max_count = max(max_count, count) print(max_count)
n = int(input()) height = list(map(int, input().split())) max_count = 0 count = 0 for i in range(n - 1): if height[i] < height[i + 1]: max_count = max(count, max_count) count = 0 continue count += 1 max_count = max(count, max_count) print(max_count)
replace
3
10
3
11
TLE
p02923
C++
Time Limit Exceeded
#include <iostream> #include <vector> int main() { int N; std::cin >> N; std::vector<int> H(N); for (int i = 0; i < N; i++) { std::cin >> H[i]; } int max = -1; for (int i = 0; i < N; i++) { int cnt = 0; for (int j = i; j < N - 1; j++) { if (H[j + 1] <= H[j]) cnt++; else ...
#include <iostream> #include <vector> int main() { int N; std::cin >> N; std::vector<int> H(N); for (int i = 0; i < N; i++) { std::cin >> H[i]; } int max = -1; for (int i = 0; i < N; i++) { int cnt = 0; for (int j = i; j < N - 1; j++) { if (H[j + 1] <= H[j]) cnt++; else ...
insert
18
18
18
20
TLE
p02923
Python
Time Limit Exceeded
n = int(input()) h = list(map(int, input().split())) max_step = 0 for i in range(n): current_step = 0 for j in range(i + 1, n): if h[j - 1] >= h[j]: current_step += 1 if current_step > max_step: max_step = current_step else: i = j ...
n = int(input()) h = list(map(int, input().split())) max_step = 0 current_step = 0 for i in range(n - 1): if h[i] >= h[i + 1]: current_step += 1 if current_step > max_step: max_step = current_step else: current_step = 0 print(max_step)
replace
4
14
4
12
TLE
p02923
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; int main() { int A; cin >> A; vector<int> B(A); for (int i = 0; i < A; i++) { cin >> B.at(i); } int ans = 0; int tmp = 0; for (int i = 0; i < A; i++) { if (B.at(i) >= B.at(i + 1)) { tmp++; } else { tmp = 0; } ans = max(ans, t...
#include <bits/stdc++.h> using namespace std; int main() { int A; cin >> A; vector<int> B(A); for (int i = 0; i < A; i++) { cin >> B.at(i); } int ans = 0; int tmp = 0; for (int i = 0; i < A - 1; i++) { if (B.at(i) >= B.at(i + 1)) { tmp++; } else { tmp = 0; } ans = max(an...
replace
12
13
12
13
-6
terminate called after throwing an instance of 'std::out_of_range' what(): vector::_M_range_check: __n (which is 5) >= this->size() (which is 5)
p02923
C++
Time Limit Exceeded
#include <iostream> using namespace std; int main() { long long n; long long h[110000]; cin >> n; for (long long i = 0; i < n; i++) cin >> h[i]; long long storedCount = 0; long long eachCount = 0; for (long long i = 0; i < n; i++) { // cout << storedCount << eachCount << endl; if (storedCoun...
#include <iostream> using namespace std; int main() { long long n; long long h[110000]; cin >> n; for (long long i = 0; i < n; i++) cin >> h[i]; long long storedCount = 0; long long eachCount = 0; for (long long i = 0; i < n; i++) { // cout << storedCount << eachCount << endl; if (storedCoun...
insert
16
16
16
18
TLE
p02923
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; int main() { int N; cin >> N; vector<int> vec(N); for (int i = 0; i < N; i++) { cin >> vec.at(i); } int count = 0; vector<int> vec2; int a = vec.at(0); for (int i = 1; i < N; i++) { if (i == N - 1) { if (a >= vec.at(i)) { count++; ...
#include <bits/stdc++.h> using namespace std; int main() { int N; cin >> N; if (N == 1) { cout << 0 << endl; return 0; } vector<int> vec(N); for (int i = 0; i < N; i++) { cin >> vec.at(i); } int count = 0; vector<int> vec2; int a = vec.at(0); for (int i = 1; i < N; i++) { if (i ==...
insert
6
6
6
10
0
p02923
C++
Time Limit Exceeded
#include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < n; i++) using ll = long long; using namespace std; const long long INF = 1LL << 60; int main() { int n; cin >> n; vector<int> h(n); rep(i, n) cin >> h[i]; int max = 0; for (int i = 0; i < n - 1; i++) { int cnt = 0; for (int j = i; j < n...
#include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < n; i++) using ll = long long; using namespace std; const long long INF = 1LL << 60; int main() { int n; cin >> n; vector<int> h(n); rep(i, n) cin >> h[i]; int max = 0; for (int i = 0; i < n - 1; i++) { if (h[i] <= h[i - 1]) continue; ...
insert
13
13
13
15
TLE
p02923
C++
Runtime Error
#include <iostream> using namespace std; int main() { int a, h[10005]; cin >> a; int i; int Max, ans; Max = 0; ans = 0; for (i = 0; i < a; i++) { cin >> h[i]; } for (i = 0; i < a - 1; i++) { if (h[i] >= h[i + 1]) { Max++; if (ans < Max) { ans = Max; } } else { ...
#include <iostream> using namespace std; int main() { int a, h[100005]; cin >> a; int i; int Max, ans; Max = 0; ans = 0; for (i = 0; i < a; i++) { cin >> h[i]; } for (i = 0; i < a - 1; i++) { if (h[i] >= h[i + 1]) { Max++; if (ans < Max) { ans = Max; } } else { ...
replace
3
4
3
4
0
p02923
Python
Time Limit Exceeded
#!/usr/bin/env python3 n = int(input()) h = list(map(int, input().split())) ans = 0 for i in range(n): tmp = 0 for j in range(i, n - 1): if h[j] < h[j + 1]: tmp = 0 else: tmp += 1 ans = max(ans, tmp) print(ans)
#!/usr/bin/env python3 n = int(input()) h = list(map(int, input().split())) ans = 0 tmp = 0 for i in range(n - 1): if h[i] < h[i + 1]: tmp = 0 else: tmp += 1 ans = max(ans, tmp) print(ans)
replace
4
12
4
11
TLE
p02923
C++
Time Limit Exceeded
#include <iostream> #include <math.h> // #include <numeric> #include <algorithm> #include <map> #include <vector> using namespace std; #define n_max 100000 #define rep(i, a, n) for (int i = a; i < n; i++) #define rep2(i, a, n) for (int i = a; i <= n; i++) #define rrep(i, a, n) for (int i = a; i > n; i--) #define rrep...
#include <iostream> #include <math.h> // #include <numeric> #include <algorithm> #include <map> #include <vector> using namespace std; #define n_max 100000 #define rep(i, a, n) for (int i = a; i < n; i++) #define rep2(i, a, n) for (int i = a; i <= n; i++) #define rrep(i, a, n) for (int i = a; i > n; i--) #define rrep...
insert
28
28
28
31
TLE
p02923
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; int main() { int N; cin >> N; vector<int> H(N); for (int i = 0; i < N; i++) { cin >> H.at(i); } int i = 0; int c = 0; int M = 0; while (i < N) { if (H.at(i - 1) >= H.at(i)) { c++; if (i == N - 1) { M = max(M, c); } }...
#include <bits/stdc++.h> using namespace std; int main() { int N; cin >> N; vector<int> H(N); for (int i = 0; i < N; i++) { cin >> H.at(i); } int i = 1; int c = 0; int M = 0; while (i < N) { if (H.at(i - 1) >= H.at(i)) { c++; if (i == N - 1) { M = max(M, c); } }...
replace
11
12
11
12
-6
terminate called after throwing an instance of 'std::out_of_range' what(): vector::_M_range_check: __n (which is 18446744073709551615) >= this->size() (which is 5)
p02923
C++
Time Limit Exceeded
#include <algorithm> #include <cmath> #include <cstdlib> #include <iostream> #include <map> #include <string> #include <vector> using namespace std; int main() { int n; cin >> n; int h[n]; for (int i(0); i < n; i++) { cin >> h[i]; } int ans(0); for (int i(0); i < n - 1; i++) { int j(0); whi...
#include <algorithm> #include <cmath> #include <cstdlib> #include <iostream> #include <map> #include <string> #include <vector> using namespace std; int main() { int n; cin >> n; int h[n]; for (int i(0); i < n; i++) { cin >> h[i]; } int ans(0); for (int i(0); i < n - ans - 1; i++) { int j(0); ...
replace
19
20
19
20
TLE
p02923
C++
Runtime Error
#include <iostream> using namespace std; int main(void) { int n, h[1000], i, max = 0, cnt = 0; cin >> n; for (i = 0; i < n; i++) cin >> h[i]; for (i = n - 2; i >= 0; i--) { if (h[i] >= h[i + 1]) cnt++; else cnt = 0; if (max < cnt) max = cnt; } cout << max << endl; return ...
#include <iostream> using namespace std; int main(void) { int n, h[100000], i, max = 0, cnt = 0; cin >> n; for (i = 0; i < n; i++) cin >> h[i]; for (i = n - 2; i >= 0; i--) { if (h[i] >= h[i + 1]) cnt++; else cnt = 0; if (max < cnt) max = cnt; } cout << max << endl; retur...
replace
3
4
3
4
0
p02923
Python
Time Limit Exceeded
N = int(input()) H = list(map(int, input().split())) ans = [] count = 0 for i in range(N): for j in range(i + count, N): if j == N - 1: ans.append(count) count = 0 break if H[j] < H[j + 1]: ans.append(count) count = 0 break ...
N = int(input()) H = list(map(int, input().split())) ans = [] count = 0 for j in range(N): if j == N - 1: ans.append(count) count = 0 break if H[j] < H[j + 1]: ans.append(count) count = 0 continue elif H[j] >= H[j + 1]: count += 1 print(max(ans))
replace
5
17
5
16
TLE
p02923
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; int main() { int n; cin >> n; vector<int> h(n); for (int i = 0; i < n; i++) { cin >> h.at(i); } int ans = 0; int count = 0; for (int i = 0; i < n; i++) { if (h.at(i) >= h.at(i + 1)) { count++; } else { ans = max(ans, count); c...
#include <bits/stdc++.h> using namespace std; int main() { int n; cin >> n; vector<int> h(n); for (int i = 0; i < n; i++) { cin >> h.at(i); } int ans = 0; int count = 0; for (int i = 0; i < n - 1; i++) { if (h.at(i) >= h.at(i + 1)) { count++; } else { ans = max(ans, count); ...
replace
13
14
13
14
-6
terminate called after throwing an instance of 'std::out_of_range' what(): vector::_M_range_check: __n (which is 5) >= this->size() (which is 5)
p02923
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; int a[10010]; int main() { int n; cin >> n; for (int i = 0; i < n; i++) cin >> a[i]; int ans = 0; int record = a[0]; int temp_ans = 0; for (int i = 1; i < n; i++) { if (a[i] <= record) { temp_ans += 1; record = a[i]; } else { a...
#include <bits/stdc++.h> using namespace std; int a[100010]; int main() { int n; cin >> n; for (int i = 0; i < n; i++) cin >> a[i]; int ans = 0; int record = a[0]; int temp_ans = 0; for (int i = 1; i < n; i++) { if (a[i] <= record) { temp_ans += 1; record = a[i]; } else { ...
replace
4
5
4
5
0
p02923
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; int main() { long long int i, k = 0; long long int n, a[5000], b[5000]; cin >> n; for (i = 0; i < n; i++) { cin >> a[i]; } long long int count1 = 0; for (i = 0; i < n - 1; i++) { if (a[i + 1] <= a[i]) { count1++; } else { b[k] ...
#include <bits/stdc++.h> using namespace std; int main() { long long int i, k = 0; long long int n, a[500000], b[500000]; cin >> n; for (i = 0; i < n; i++) { cin >> a[i]; } long long int count1 = 0; for (i = 0; i < n - 1; i++) { if (a[i + 1] <= a[i]) { count1++; } else { b...
replace
8
9
8
9
0
p02923
Python
Runtime Error
# -*- coding: utf-8 -*- # 整数の入力 def main(): n = int(input()) h = list(map(int, input().split())) result = [] count = 0 for i in range(n - 1): if h[i] < h[i + 1]: result.append(count) count = 0 continue count += 1 if i == n - 2: ...
# -*- coding: utf-8 -*- # 整数の入力 def main(): n = int(input()) h = list(map(int, input().split())) if n == 1: print(0) return result = [] count = 0 for i in range(n - 1): if h[i] < h[i + 1]: result.append(count) count = 0 continue ...
insert
7
7
7
11
0
p02923
Python
Runtime Error
# coding: utf-8 n = int(input()) lst = list(map(int, input().split())) cnt = 0 data = [] for i in range(n - 1): if lst[i] >= lst[i + 1]: cnt += 1 else: data.append(cnt) cnt = 0 print(max(cnt))
# coding: utf-8 n = int(input()) lst = list(map(int, input().split())) cnt = 0 data = [] for i in range(n - 1): if lst[i] >= lst[i + 1]: cnt += 1 else: data.append(cnt) cnt = 0 data.append(cnt) print(max(data))
replace
11
12
11
13
TypeError: 'int' object is not iterable
Traceback (most recent call last): File "/home/alex/Documents/bug-detection/input/Project_CodeNet/data/p02923/Python/s153309090.py", line 12, in <module> print(max(cnt)) TypeError: 'int' object is not iterable
p02923
Python
Runtime Error
n = input() h_string = input() h_list = h_string.split(" ") for item in h_list: item = int(item) longest = 0 now_value = -1 now_length = 0 for value in h_list: if value <= now_value: now_length += 1 now_value = value if now_length > longest: longest = now_length else:...
n = input() h_string = input() h_list = h_string.split(" ") for i in range(len(h_list)): h_list[i] = int(h_list[i]) longest = 0 now_value = -1 now_length = 0 for value in h_list: if value <= now_value: now_length += 1 now_value = value if now_length > longest: longest = n...
replace
3
5
3
5
TypeError: '<=' not supported between instances of 'str' and 'int'
Traceback (most recent call last): File "/home/alex/Documents/bug-detection/input/Project_CodeNet/data/p02923/Python/s196465841.py", line 14, in <module> if value <= now_value: TypeError: '<=' not supported between instances of 'str' and 'int'
p02923
Python
Runtime Error
from sys import stdin n = int(stdin.readline().rstrip()) h = [int(x) for x in stdin.readline().rstrip().split()] m = 0 count = 0 for i in range(n): if (i == n - 1) and (m < count): m = count else: if h[i] >= h[i + 1]: count += 1 else: if m < count: ...
from sys import stdin n = int(stdin.readline().rstrip()) h = [int(x) for x in stdin.readline().rstrip().split()] m = 0 count = 0 for i in range(n): if i == n - 1: if m < count: m = count else: if h[i] >= h[i + 1]: count += 1 else: if m < count: ...
replace
8
10
8
11
0
p02923
Python
Runtime Error
N = int(input()) H = [int, input().split(" ")] counter = -1 last_h = float("inf") _max = 0 for h in H: if h <= last_h: counter += 1 else: if _max < counter: _max = counter counter = 0 last_h = h if _max < counter: _max = counter print(_max)
N = int(input()) H = map(int, input().split()) counter = -1 last_h = float("inf") _max = 0 for h in H: if h <= last_h: counter += 1 else: if _max < counter: _max = counter counter = 0 last_h = h if _max < counter: _max = counter print(_max)
replace
1
2
1
2
TypeError: '<=' not supported between instances of 'type' and 'float'
Traceback (most recent call last): File "/home/alex/Documents/bug-detection/input/Project_CodeNet/data/p02923/Python/s934114167.py", line 8, in <module> if h <= last_h: TypeError: '<=' not supported between instances of 'type' and 'float'
p02923
C++
Time Limit Exceeded
#include <bits/stdc++.h> using namespace std; int main(void) { int n; cin >> n; vector<int> h(n); for (size_t i = 0; i < n; i++) { cin >> h[i]; } int max = 0, ct = 0; for (size_t i = n - 1; i >= 0; i--) { if (i == n - 1 || h[i] < h[i + 1]) ct = 0; ct++; if (max < ct) max = c...
#include <bits/stdc++.h> using namespace std; int main(void) { int n; cin >> n; vector<int> h(n); for (size_t i = 0; i < n; i++) { cin >> h[i]; } int max = 0, ct = 0; for (int i = n - 1; i >= 0; i--) { if (i == n - 1 || h[i] < h[i + 1]) ct = 0; ct++; if (max < ct) max = ct; ...
replace
13
14
13
14
TLE
p02923
Python
Runtime Error
import sys from itertools import accumulate from collections import Counter input = sys.stdin.readline def main(): n = int(input()) H = list(map(int, input().split())) print( Counter(accumulate([H[i] < H[i + 1] for i in range(n - 1)])).most_common(1)[0][ 1 ] - 1 ) ...
import sys from itertools import accumulate from collections import Counter input = sys.stdin.readline def main(): n = int(input()) H = list(map(int, input().split())) if n == 1: print(0) return # 連続した場合、同値 acc = list(accumulate([H[i] < H[i + 1] for i in range(n - 1)])) x, y =...
replace
10
16
10
17
0
p02923
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; void solve(long long N, std::vector<float> H) { vector<float> dH(N - 1, 0); for (int i = 0; i < N - 1; ++i) { if (H[i + 1] - H[i] <= 0) dH[i] += 1; } // for(int i = 0; i < N; ++i) cout << dH[i] << endl; // cout << endl; vector<float> ans(N, 0); for ...
#include <bits/stdc++.h> using namespace std; void solve(long long N, std::vector<float> H) { vector<float> dH(N - 1, 0); for (int i = 0; i < N - 1; ++i) { if (H[i + 1] - H[i] <= 0) dH[i] += 1; } // for(int i = 0; i < N; ++i) cout << dH[i] << endl; // cout << endl; vector<float> ans(N, 0); for ...
replace
12
13
12
13
0
p02923
C++
Runtime Error
#include <algorithm> #include <cstdio> using namespace std; const int maxn = 10005; int n, ans, h[maxn], f[maxn]; int main(void) { scanf("%d", &n); for (register int i = 1; i <= n; ++i) scanf("%d", &h[i]); for (register int i = 2; i <= n; ++i) { if (h[i] <= h[i - 1]) f[i] = f[i - 1] + 1; els...
#include <algorithm> #include <cstdio> using namespace std; const int maxn = 100005; int n, ans, h[maxn], f[maxn]; int main(void) { scanf("%d", &n); for (register int i = 1; i <= n; ++i) scanf("%d", &h[i]); for (register int i = 2; i <= n; ++i) { if (h[i] <= h[i - 1]) f[i] = f[i - 1] + 1; el...
replace
5
6
5
6
0
p02923
C++
Runtime Error
#include <bits/stdc++.h> #include <cstring> #include <iostream> #include <math.h> using namespace std; class Mass { public: int N; long H[100]; }; int main() { Mass m; cin >> m.N; int i; int j = 0; int k = 0; for (i = 0; i < m.N; i++) { cin >> m.H[i]; if (i != 0 && m.H[i] <= m.H[i - 1]) { ...
#include <bits/stdc++.h> #include <cstring> #include <iostream> #include <math.h> using namespace std; class Mass { public: int N; long H[100000]; }; int main() { Mass m; cin >> m.N; int i; int j = 0; int k = 0; for (i = 0; i < m.N; i++) { cin >> m.H[i]; if (i != 0 && m.H[i] <= m.H[i - 1]) {...
replace
9
10
9
10
0
p02923
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; int main() { ios::sync_with_stdio(0); cin.tie(0); int cell[10000] = {0}; int N, input; cin >> N; for (int i = 0; i < N; i++) { cin >> input; cell[i] = input; } int curr = 0, _max = 0; for (int i = 0; i < N - 1; i++) { // cout << "i, i+1 => " ...
#include <bits/stdc++.h> using namespace std; int main() { ios::sync_with_stdio(0); cin.tie(0); int cell[100000] = {0}; int N, input; cin >> N; for (int i = 0; i < N; i++) { cin >> input; cell[i] = input; } int curr = 0, _max = 0; for (int i = 0; i < N - 1; i++) { // cout << "i, i+1 => "...
replace
6
7
6
7
0
p02923
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; using ll = long long; using ld = long double; #define FOR(i, a, b) for (int i = (a); i < (b); ++i) #define IFOR(i, a, b) for (int i = (b - 1); i >= (a); --i) #define RPT(i, a, b) for (int i = (a); i < ((a) + (b)); ++i) #define IRPT(i, a, b) for (int i = ((a) + (b)-1); i >= ...
#include <bits/stdc++.h> using namespace std; using ll = long long; using ld = long double; #define FOR(i, a, b) for (int i = (a); i < (b); ++i) #define IFOR(i, a, b) for (int i = (b - 1); i >= (a); --i) #define RPT(i, a, b) for (int i = (a); i < ((a) + (b)); ++i) #define IRPT(i, a, b) for (int i = ((a) + (b)-1); i >= ...
replace
15
16
15
16
0
p02923
C++
Runtime Error
#pragma GCC optimize("O3") #include <bits/stdc++.h> using namespace std; typedef int64_t ll; typedef uint64_t ull; ll n, h[10000], ans, tmp; int main(void) { ll i; cin >> n; for (i = 0; i < n; i++) { cin >> h[i]; } for (i = 0; i < n - 1; i++) { if (h[i + 1] <= h[i]) tmp++; else { an...
#pragma GCC optimize("O3") #include <bits/stdc++.h> using namespace std; typedef int64_t ll; typedef uint64_t ull; ll n, h[100000], ans, tmp; int main(void) { ll i; cin >> n; for (i = 0; i < n; i++) { cin >> h[i]; } for (i = 0; i < n - 1; i++) { if (h[i + 1] <= h[i]) tmp++; else { a...
replace
8
9
8
9
0
p02923
C++
Time Limit Exceeded
#include <iostream> #include <vector> using namespace std; int main(int argc, char *argv[]) { int N; int count = 0; int count_max = 0; cin >> N; vector<int> v; int m; for (int i = 0; i < N; i++) { cin >> m; v.push_back(m); } for (int i = 0; i < N - 1; i++) { count = 0; for (int j = i;...
#include <iostream> #include <vector> using namespace std; int main(int argc, char *argv[]) { int N; int count = 0; int count_max = 0; cin >> N; vector<int> v; int m; for (int i = 0; i < N; i++) { cin >> m; v.push_back(m); } for (int i = 0; i < N - 1; i++) { count = 0; if (N - i < cou...
insert
17
17
17
19
TLE
p02923
C++
Time Limit Exceeded
#include <bits/stdc++.h> #include <math.h> #include <numeric> #include <stdlib.h> using namespace std; int main() { int N, i, max = 0, j = 0; cin >> N; int H[N]; for (i = 0; i < N; i++) { cin >> H[i]; } for (i = 0; i < N - 1; i++) { for (j = 0; H[i + j] >= H[i + j + 1] && i + j + 1 < N;) { j++...
#include <bits/stdc++.h> #include <math.h> #include <numeric> #include <stdlib.h> using namespace std; int main() { int N, i, max = 0, j = 0; cin >> N; int H[N]; for (i = 0; i < N; i++) { cin >> H[i]; } for (i = 0; i < N - 1; i++) { for (j = 0; H[i + j] >= H[i + j + 1] && i + j + 1 < N;) { j++...
insert
19
19
19
20
TLE
p02923
C++
Time Limit Exceeded
#include <iostream> using namespace std; int main() { int N, *H, max = 0, c = 0, co = 0, s = 0; cin >> N; H = (int *)malloc(sizeof(int) * N); for (int i = 0; i < N; i++) { cin >> H[i]; } while (c < N) { co = c; s = 0; while (H[co] >= H[co + 1] && co < N - 1) { s++; co++; ...
#include <iostream> using namespace std; int main() { int N, *H, max = 0, c = 0, co = 0, s = 0; cin >> N; H = (int *)malloc(sizeof(int) * N); for (int i = 0; i < N; i++) { cin >> H[i]; } while (c < N) { co = c; s = 0; while (H[co] >= H[co + 1] && co < N - 1) { s++; co++; ...
insert
23
23
23
25
TLE
p02923
C++
Time Limit Exceeded
/* * Project: AtCoder Beginners Contest 139 C - Lower * Author: toms74209200 <https://github.com/toms74209200> * * Created on 2020/08/26 * Copyright (c) 2020 toms74209200 * * This software is released under the MIT License. * http://opensource.org/licenses/mit-license.php */ #include <cstdint> #include <cstdio...
/* * Project: AtCoder Beginners Contest 139 C - Lower * Author: toms74209200 <https://github.com/toms74209200> * * Created on 2020/08/26 * Copyright (c) 2020 toms74209200 * * This software is released under the MIT License. * http://opensource.org/licenses/mit-license.php */ #include <cstdint> #include <cstdio...
insert
29
29
29
32
TLE
p02923
C++
Time Limit Exceeded
#include <iostream> using namespace ::std; int main() { int s; cin >> s; int array[s], score, max = 0, i, j; for (i = 0; i < s; i++) { cin >> array[i]; } for (i = 0; i < s - 1; i++) { j = i; // cout<<j<<endl; while (array[j] >= array[j + 1] && j < s - 1) { score++; // cout<<j; ...
#include <iostream> using namespace ::std; int main() { int s; cin >> s; int array[s], score, max = 0, i, j; for (i = 0; i < s; i++) { cin >> array[i]; } for (i = 0; i < s - 1; i++) { j = i; // cout<<j<<endl; while (array[j] >= array[j + 1] && j < s - 1) { score++; // cout<<j; ...
insert
22
22
22
24
TLE
p02923
C++
Time Limit Exceeded
#include <math.h> #include <stdio.h> #include <stdlib.h> #include <string.h> int main() { int N; int H[100000]; int ans = 0, count = 0; scanf("%d", &N); for (int i = 0; i < N; i++) scanf("%d", &H[i]); for (int i = 0; i < N; i++) { count = 0; for (int j = i; j < N - 1; j++) { if (H[j] <...
#include <math.h> #include <stdio.h> #include <stdlib.h> #include <string.h> int main() { int N; int H[100000]; int ans = 0, count = 0; scanf("%d", &N); for (int i = 0; i < N; i++) scanf("%d", &H[i]); for (int i = 0; i < N; i++) { count = 0; for (int j = i; j < N - 1; j++) { if (H[j] <...
insert
22
22
22
24
TLE
p02923
C++
Time Limit Exceeded
#include <bits/stdc++.h> using namespace std; int main() { int N; cin >> N; vector<int> H(N); for (int i = 0; i < N; i++) { cin >> H[i]; } // i番目のマスに降り立ったときに移動可能な回数を格納 vector<int> can(N, 0); for (int i = 0; i < N - 1; i++) { if (i >= 1) { if (H[i] == H[i - 1]) continue; } ...
#include <bits/stdc++.h> using namespace std; int main() { int N; cin >> N; vector<int> H(N); for (int i = 0; i < N; i++) { cin >> H[i]; } // i番目のマスに降り立ったときに移動可能な回数を格納 vector<int> can(N, 0); for (int i = 0; i < N - 1; i++) { if (i >= 1) { if (H[i] <= H[i - 1]) continue; } ...
replace
18
19
18
19
TLE
p02923
C++
Runtime Error
#include <bits/stdc++.h> #define ll long long using namespace std; int main() { ll n; cin >> n; ll h[n], i, j, c = 0, d; for (i = 0; i < n; i++) { cin >> h[i]; } vector<ll> a; for (i = 1; i < n; i++) { if (i == n - 1) { if (h[i] <= h[i - 1]) { a.push_back(c + 1); } else ...
#include <bits/stdc++.h> #define ll long long using namespace std; int main() { ll n; cin >> n; ll h[n], i, j, c = 0, d; for (i = 0; i < n; i++) { cin >> h[i]; } vector<ll> a; if (n == 1) { cout << "0"; return 0; } for (i = 1; i < n; i++) { if (i == n - 1) { if (h[i] <= h[i - 1...
insert
12
12
12
16
0
p02923
C++
Time Limit Exceeded
#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; cin >> N; vector<int> h(N); int ans = 0; rep(i, N) cin >> h[i]; rep(i, N - 1) { int temp = 0; rep(j, N - i - 1) { if (h[i + j] >= h[i + j + 1]) temp...
#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; cin >> N; vector<int> h(N); int ans = 0; rep(i, N) cin >> h[i]; rep(i, N - 1) { int temp = 0; rep(j, N - i - 1) { if (h[i + j] >= h[i + j + 1]) temp...
insert
22
22
22
24
TLE
p02923
C++
Time Limit Exceeded
#include <bits/stdc++.h> using namespace std; int main() { int N; cin >> N; int H[N]; for (int i = 0; i < N; i++) { cin >> H[i]; } int biggest = 0; for (int i = 0; i < N - 1; i++) { int counter = 0; int t = i; while (t < N - 1) { if (H[t] >= H[t + 1]) { counter++; ...
#include <bits/stdc++.h> using namespace std; int main() { int N; cin >> N; int H[N]; for (int i = 0; i < N; i++) { cin >> H[i]; } int biggest = 0; for (int i = 0; i < N - 1; i++) { int counter = 0; int t = i; if (biggest >= N - 1) { break; } while (t < N - 1) { i...
insert
18
18
18
21
TLE
p02923
C++
Time Limit Exceeded
#include <algorithm> #include <cmath> #include <iostream> #include <map> #include <math.h> #include <queue> #include <stack> #include <string> #include <vector> typedef long long ll; using namespace std; #define mod 10007 #define rep(i, n) for (ll i = 0; i < n; i++) int main(void) { ll n; cin >> n; vector<ll> h...
#include <algorithm> #include <cmath> #include <iostream> #include <map> #include <math.h> #include <queue> #include <stack> #include <string> #include <vector> typedef long long ll; using namespace std; #define mod 10007 #define rep(i, n) for (ll i = 0; i < n; i++) int main(void) { ll n; cin >> n; vector<ll> h...
insert
35
35
35
37
TLE
p02923
C++
Time Limit Exceeded
#include <iostream> using namespace std; int main() { int n, max_cnt = 0; cin >> n; int h[n]; for (int i = 0; i < n; i++) cin >> h[i]; for (int i = 0; i < n - 1; i++) { int cnt = 0; for (int j = i + 1; j < n; j++) { if (h[j - 1] >= h[j]) { cnt++; max_cnt = max(max_cnt, cnt);...
#include <iostream> using namespace std; int main() { int n, max_cnt = 0; cin >> n; int h[n]; for (int i = 0; i < n; i++) cin >> h[i]; for (int i = 0; i < n - 1; i++) { int cnt = 0; if (n - i - 1 <= max_cnt) break; for (int j = i + 1; j < n; j++) { if (h[j - 1] >= h[j]) { ...
insert
11
11
11
13
TLE
p02923
C++
Time Limit Exceeded
#include <cmath> #include <iostream> #include <vector> using namespace std; int main() { int num; cin >> num; vector<int> array(num, 0); for (int i = 0; i < num; i++) { int n; scanf("%d", &n); array[i] = n; } int ans = 0; for (int i = 0; i < num; i++) { int tmpCounter = 0; for (int ...
#include <cmath> #include <iostream> #include <vector> using namespace std; int main() { int num; cin >> num; vector<int> array(num, 0); for (int i = 0; i < num; i++) { int n; scanf("%d", &n); array[i] = n; } int ans = 0; for (int i = 0; i < num; i++) { int tmpCounter = 0; if (i + a...
insert
19
19
19
22
TLE
p02923
C++
Time Limit Exceeded
#include <iostream> using namespace std; int main() { int N; int ans = 0; int ans0 = 0; cin >> N; int H[N]; for (int i = 0; i < N; i++) { cin >> H[i]; } for (int i = 0; i < N; i++) { ans0 = 0; for (int j = i; j < N - 1; j++) { if (H[j] >= H[j + 1]) { ans0++; } else { ...
#include <iostream> using namespace std; int main() { int N; int ans = 0; int ans0 = 0; cin >> N; int H[N]; for (int i = 0; i < N; i++) { cin >> H[i]; } for (int i = 0; i < N; i++) { ans0 = 0; if (ans >= N - i) { break; } for (int j = i; j < N - 1; j++) { if (H[j] >= H...
insert
16
16
16
19
TLE
p02923
C++
Runtime Error
#include <iostream> #include <string> using namespace std; const int MAX_N = 10005; int H[MAX_N]; bool check[MAX_N]; void init() { for (int i = 0; i < MAX_N; ++i) { check[i] = true; } check[0] = false; } int main() { int N; cin >> N; init(); for (int i = 0; i < N; ++i) { cin >> H[i]; if (i !...
#include <iostream> #include <string> using namespace std; const int MAX_N = 100005; int H[MAX_N]; bool check[MAX_N]; void init() { for (int i = 0; i < MAX_N; ++i) { check[i] = true; } check[0] = false; } int main() { int N; cin >> N; init(); for (int i = 0; i < N; ++i) { cin >> H[i]; if (i ...
replace
3
4
3
4
0
p02923
C++
Time Limit Exceeded
#include <algorithm> #include <cstdlib> #include <iostream> #include <string.h> #include <string> #include <vector> using namespace std; int main() { int n; cin >> n; vector<int> h(n); for (int i = 0; i < n; i++) cin >> h[i]; int max = 0; for (int i = 0; i < n; i++) { // start point int count ...
#include <algorithm> #include <cstdlib> #include <iostream> #include <string.h> #include <string> #include <vector> using namespace std; int main() { int n; cin >> n; vector<int> h(n); for (int i = 0; i < n; i++) cin >> h[i]; int max = 0; int count = 0; for (int i = 0; i < n - 1; i++) { if (h[i]...
replace
16
27
16
24
TLE
p02923
C++
Time Limit Exceeded
#include <bits/stdc++.h> #include <cassert> #include <numeric> // #include <boost/multiprecision/cpp_int.hpp> #define ll long long int #define CON 100010 const long long mod = 1e9 + 7; const int INF = 1001001001; const int inf = 100000; // const ll inf=1e9+7; // const ll ful=1e18; using namespace std; // namespace mp =...
#include <bits/stdc++.h> #include <cassert> #include <numeric> // #include <boost/multiprecision/cpp_int.hpp> #define ll long long int #define CON 100010 const long long mod = 1e9 + 7; const int INF = 1001001001; const int inf = 100000; // const ll inf=1e9+7; // const ll ful=1e18; using namespace std; // namespace mp =...
insert
34
34
34
36
TLE
p02923
C++
Runtime Error
#include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < (int)(n); i++) #define rep_ll(i, n) for (ll i = 0; i < (ll)(n); i++) using namespace std; typedef long long ll; typedef unsigned long long u_ll; typedef pair<int, int> pair_; const long double PI = (acos(-1)); const int INF = 1001001001; const int dx[] ...
#include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < (int)(n); i++) #define rep_ll(i, n) for (ll i = 0; i < (ll)(n); i++) using namespace std; typedef long long ll; typedef unsigned long long u_ll; typedef pair<int, int> pair_; const long double PI = (acos(-1)); const int INF = 1001001001; const int dx[] ...
replace
34
35
34
35
0
p02923
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; int main() { int m, n, c = 0; cin >> m >> n; int x = m - n; int y = x / (m - 1); cout << 1 + y; }
#include <bits/stdc++.h> using namespace std; int main() { int n; cin >> n; int a[n]; for (int i = 0; i < n; i++) { cin >> a[i]; } int c = 0, m = 0; for (int i = n - 2; i >= 0; i--) { if (a[i] >= a[i + 1]) { c++; m = max(m, c); } else c = 0; } cout << m; }
replace
5
10
5
20
0
p02923
C++
Time Limit Exceeded
#include <bits/stdc++.h> using namespace std; #define rep(i, n) for (int i = 0; i < (n); i++) int main() { int n; cin >> n; vector<long long> h(n); rep(i, n) cin >> h[i]; int ans = 0; rep(i, n) { int cnt = 0; int j = i; while ((j < n - 1) && (h[j] >= h[j + 1])) { cnt++; j++; }...
#include <bits/stdc++.h> using namespace std; #define rep(i, n) for (int i = 0; i < (n); i++) int main() { int n; cin >> n; vector<long long> h(n); rep(i, n) cin >> h[i]; int ans = 0; rep(i, n) { int cnt = 0; int j = i; while ((j < n - 1) && (h[j] >= h[j + 1])) { cnt++; j++; }...
insert
19
19
19
20
TLE
p02923
C++
Runtime Error
#include <iostream> #include <vector> using namespace std; int main() { size_t N; cin >> N; vector<int> H(N, 0); for (auto &h : H) { cin >> h; } int move = 0; int moveMax = 0; size_t p = 0; while (p <= (N - 2)) { if (H[p] >= H[p + 1]) { ++move; } else { if (move > moveMax) { ...
#include <iostream> #include <vector> using namespace std; int main() { size_t N; cin >> N; if (N == 1) { cout << 0 << endl; return 0; } vector<int> H(N, 0); for (auto &h : H) { cin >> h; } int move = 0; int moveMax = 0; size_t p = 0; while (p <= (N - 2)) { if (H[p] >= H[p + 1])...
insert
7
7
7
12
0
p02923
C++
Time Limit Exceeded
#include <bits/stdc++.h> #define rep(i, N) for (int i = 0; i < (N); i++) #define FOR(i, a, b) for (int i = (a); i < (b); i++) using namespace std; const long long MOD = 1e9 + 7; const long long INF = 1e12; const int inf = 1e9; const int mod = 1e9 + 7; typedef long long ll; typedef pair<ll, int> P; typedef set<int> S; i...
#include <bits/stdc++.h> #define rep(i, N) for (int i = 0; i < (N); i++) #define FOR(i, a, b) for (int i = (a); i < (b); i++) using namespace std; const long long MOD = 1e9 + 7; const long long INF = 1e12; const int inf = 1e9; const int mod = 1e9 + 7; typedef long long ll; typedef pair<ll, int> P; typedef set<int> S; i...
insert
30
30
30
31
TLE
p02923
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; #define rep(i, n) for (int i = 0; i < (int)(n); i++) using ll = long long; using P = pair<string, int>; const double PI = acos(-1); int main() { int n; cin >> n; vector<int> h(n); rep(i, n) cin >> h.at(i); vector<int> a(n - 1); rep(i, n - 1) { a.at(i) = h.at(i)...
#include <bits/stdc++.h> using namespace std; #define rep(i, n) for (int i = 0; i < (int)(n); i++) using ll = long long; using P = pair<string, int>; const double PI = acos(-1); int main() { int n; cin >> n; vector<int> h(n); rep(i, n) cin >> h.at(i); if (n == 1) { cout << 0 << endl; return 0; } ...
insert
12
12
12
16
0
p02923
C++
Time Limit Exceeded
#include <algorithm> #include <iostream> #include <vector> using namespace std; int main() { int N; cin >> N; vector<int> H(N); vector<int> cnt(N); for (int i = 0; i < N; i++) { cin >> H[i]; } for (int i = 0; i < N; i++) { for (int j = i; j < N - 1; j++) { if (H[j] >= H[j + 1]) { ...
#include <algorithm> #include <iostream> #include <vector> using namespace std; int main() { int N; cin >> N; vector<int> H(N); vector<int> cnt(N); for (int i = 0; i < N; i++) { cin >> H[i]; } for (int i = 0; i < N; i++) { for (int j = i; j < N - 1; j++) { if (H[j] >= H[j + 1]) { ...
insert
23
23
23
26
TLE
p02923
C++
Time Limit Exceeded
#include <iostream> using namespace std; int main() { int n, a[100000], c = 0; cin >> n; for (int i = 0; i < n; i++) { cin >> a[i]; } for (int i = 0; i < n - 1; i++) { int x = 0; for (int j = i; j < n - 1; j++) { if (a[j + 1] > a[j]) { break; } else { x++; } ...
#include <iostream> using namespace std; int main() { int n, a[100000], c = 0; cin >> n; for (int i = 0; i < n; i++) { cin >> a[i]; } for (int i = 0; i < n - 1; i++) { int x = 0; for (; i < n - 1; i++) { if (a[i + 1] > a[i]) { break; } else { x++; } } ...
replace
15
17
15
17
TLE
p02923
C++
Runtime Error
/************************************************************************ * -> Bismillahir Rahmanir Rahim <- * * * * * * ...
/************************************************************************ * -> Bismillahir Rahmanir Rahim <- * * * * * * ...
replace
65
66
65
66
0
p02923
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; int main() { int N; cin >> N; vector<int> H(N); for (int i = 0; i < N; i++) cin >> H.at(i); priority_queue<int> A; int count = 0; for (int i = 0; i < N - 1; i++) { if (H.at(i) >= H.at(i + 1)) count++; else { A.push(count); count ...
#include <bits/stdc++.h> using namespace std; int main() { int N; cin >> N; vector<int> H(N); for (int i = 0; i < N; i++) cin >> H.at(i); priority_queue<int> A; int count = 0; for (int i = 0; i < N - 1; i++) { if (H.at(i) >= H.at(i + 1)) count++; else { A.push(count); count ...
insert
19
19
19
20
0
p02923
C++
Time Limit Exceeded
#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; cin >> n; int h[n + 1]; for (int i = 1; i <= n; i++) cin >> h[i]; int max_count = 0; for (int i = 1; i < n; i++) { int j = i; int count = 0; while (j < n...
#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; cin >> n; int h[n + 1]; for (int i = 1; i <= n; i++) cin >> h[i]; int max_count = 0; int count = 0; for (int i = n; i > 1; i--) { if (h[i] <= h[i - 1]) { ...
replace
14
25
14
21
TLE
p02923
C++
Runtime Error
#include <bits/stdc++.h> #include <iostream> #include <string> #include <time.h> using namespace std; #define ll long long int #define pb push_back #define mp make_pair #define fi first #define se second #define mod 1000000007 void solve() { ll n; cin >> n; vector<ll> h(n); ll i, j, k; for (i = 0; i < n; i++)...
#include <bits/stdc++.h> #include <iostream> #include <string> #include <time.h> using namespace std; #define ll long long int #define pb push_back #define mp make_pair #define fi first #define se second #define mod 1000000007 void solve() { ll n; cin >> n; vector<ll> h(n); ll i, j, k; for (i = 0; i < n; i++)...
replace
34
38
34
38
-6
terminate called after throwing an instance of 'std::bad_alloc' what(): std::bad_alloc
p02923
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; int main() { int N, sum, saidai; cin >> N; sum = 0; saidai = 0; vector<int> vec(N); vector<int> wow(N); for (int i = 0; i < N; i++) { cin >> vec.at(i); } for (int i = 0; i < N; i++) { wow.at(i) = 0; } for (int i = 0; i < N - 1; i++) { for ...
#include <bits/stdc++.h> using namespace std; int main() { int N, sum, saidai; cin >> N; sum = 0; saidai = 0; vector<int> vec(N); vector<int> wow(N); for (int i = 0; i < N; i++) { cin >> vec.at(i); } reverse(vec.begin(), vec.end()); for (int i = 1; i < N; i++) { if (vec.at(i - 1) <= vec.at(...
replace
13
34
13
20
0
p02923
C++
Time Limit Exceeded
#include <bits/stdc++.h> using namespace std; int main() { int N; int nowmax = 0; cin >> N; vector<int> data(N + 1); data.at(N) = 1000000001; for (int i = 0; i < N; i++) { cin >> data.at(i); } for (int i = 0; i < N; i++) // 落下地点 { int Now = i; int count = 0; while (data.at(Now) >= da...
#include <bits/stdc++.h> using namespace std; int main() { int N; int nowmax = 0; cin >> N; vector<int> data(N + 1); data.at(N) = 1000000001; for (int i = 0; i < N; i++) { cin >> data.at(i); } for (int i = 0; i < N; i++) // 落下地点 { int Now = i; int count = 0; while (data.at(Now) >= da...
insert
24
24
24
26
TLE
p02923
C++
Runtime Error
#include <bits/stdc++.h> int main() { int n; std::cin >> n; std::vector<long long> h(n); std::priority_queue<long long> q; for (int i = 0; i < n; i++) { std::cin >> h[i]; } int c = 0; for (int i = n - 1; i >= 1; i--) { if (h[i] <= h[i - 1]) { c++; continue; } q.push(c); ...
#include <bits/stdc++.h> int main() { int n; std::cin >> n; std::vector<long long> h(n); std::priority_queue<long long> q; for (int i = 0; i < n; i++) { std::cin >> h[i]; } int c = 0; for (int i = n - 1; i >= 1; i--) { if (h[i] <= h[i - 1]) { c++; continue; } q.push(c); ...
insert
20
20
20
21
0
p02923
C++
Time Limit Exceeded
#include <bits/stdc++.h> using namespace std; int N; int main() { cin >> N; int C[N]; for (int i = 0; i < N; i++) cin >> C[i]; int ans = 0, keep; for (int i = 0; i < N; i++) { keep = 0; for (int j = i; j < N - 1; j++) { if (C[j] < C[j + 1]) break; keep++; } ans = max...
#include <bits/stdc++.h> using namespace std; int N; int main() { cin >> N; int C[N]; for (int i = 0; i < N; i++) cin >> C[i]; int ans = 0, keep; for (int i = 0; i < N; i++) { if ((C[i - 1] >= C[i]) && i) continue; keep = 0; for (int j = i; j < N - 1; j++) { if (C[j] < C[j + 1])...
insert
13
13
13
15
TLE
p02923
C++
Time Limit Exceeded
#include <iostream> #include <string> using namespace std; int main(void) { // Your code here! int n; int h[100000]; int i, j, k; int cnt = 0; int max = cnt; cin >> n; for (i = 0; i < n; i++) { cin >> h[i]; } for (i = 0; i < n; i++) { if (i == n - 1) { break; } k = i; j = ...
#include <iostream> #include <string> using namespace std; int main(void) { // Your code here! int n; int h[100000]; int i, j, k; int cnt = 0; int max = cnt; cin >> n; for (i = 0; i < n; i++) { cin >> h[i]; } for (i = 0; i < n; i++) { if (i == n - 1 || max > n / 2) { break; } ...
replace
16
17
16
17
TLE
p02923
C++
Time Limit Exceeded
#include <iostream> #include <vector> using namespace std; int main(int argc, char **argv) { int N; vector<int> H; int i, max = 0, count; cin >> N; H.resize(N); for (int c = 0; c < N; c++) { cin >> H.at(c); } for (i = 0; i < (H.size() - 2); i++) { count = 0; while ((i + count + 1) <= (H.s...
#include <iostream> #include <vector> using namespace std; int main(int argc, char **argv) { int N; vector<int> H; int i, max = 0, count; cin >> N; H.resize(N); for (int c = 0; c < N; c++) { cin >> H.at(c); } for (i = 0; i < (H.size() - 1 - max); i++) { count = 0; while ((i + count + 1) <...
replace
15
16
15
16
TLE
p02923
C++
Runtime Error
#include <cmath> #include <iostream> using namespace std; int main() { int n; int h[10100]; int count = 0; int max = 0; cin >> n; for (int i = 0; i < n; i++) { cin >> h[i]; } for (int i = 0; i < (n - 1); i++) { if (h[i] < h[i + 1]) { max = ((max < count) ? count : max); count = 0...
#include <cmath> #include <iostream> using namespace std; int main() { int n; int h[101000]; int count = 0; int max = 0; cin >> n; for (int i = 0; i < n; i++) { cin >> h[i]; } for (int i = 0; i < (n - 1); i++) { if (h[i] < h[i + 1]) { max = ((max < count) ? count : max); count = ...
replace
6
7
6
7
0
p02923
C++
Time Limit Exceeded
#include <bits/stdc++.h> using namespace std; #define ll long long #define lli long long int #define loop(i, x, n) for (lli i = x; i <= n; i++) #define rloop(i, n, x) for (lli i = n; i >= x; i--) typedef vector<ll> v64; typedef vector<pair<ll, ll>> vp64; typedef vector<bool> vbo; typedef set<ll> s64; typedef set<bool...
#include <bits/stdc++.h> using namespace std; #define ll long long #define lli long long int #define loop(i, x, n) for (lli i = x; i <= n; i++) #define rloop(i, n, x) for (lli i = n; i >= x; i--) typedef vector<ll> v64; typedef vector<pair<ll, ll>> vp64; typedef vector<bool> vbo; typedef set<ll> s64; typedef set<bool...
replace
24
32
24
32
TLE
p02923
C++
Time Limit Exceeded
#include <bits/stdc++.h> #include <iostream> #include <queue> using namespace std; int main() { int long long n, cou = 0; cin >> n; vector<int> A(n); std::priority_queue<int> ans; for (int i = 0; i < n; i++) { cin >> A.at(i); } for (int a = 0; a < n; a++) { cou = 0; for (int b = a; b < n; b++...
#include <bits/stdc++.h> #include <iostream> #include <queue> using namespace std; int main() { int long long n, cou = 0; cin >> n; vector<int> A(n); std::priority_queue<int> ans; for (int i = 0; i < n; i++) { cin >> A.at(i); } for (int a = 0; a < n; a++) { cou = 0; for (int b = a; b < n; b++...
replace
18
20
18
20
TLE
p02923
C++
Runtime Error
#include <bits/stdc++.h> // #include<ext/pb_ds/assoc_container.hpp> // #include<ext/pb_ds/tree_policy.hpp> #define pb push_back #define mp make_pair typedef long long ll; #define fi first #define se second #define all(x) (x).begin(), (x).end() using namespace std; // using namespace __gnu_pbds; typedef vector<int...
#include <bits/stdc++.h> // #include<ext/pb_ds/assoc_container.hpp> // #include<ext/pb_ds/tree_policy.hpp> #define pb push_back #define mp make_pair typedef long long ll; #define fi first #define se second #define all(x) (x).begin(), (x).end() using namespace std; // using namespace __gnu_pbds; typedef vector<int...
replace
23
24
23
24
0
p02923
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; using ll = long long; using P = pair<ll, ll>; #define rep(i, n) for (int(i) = 0; (i) < (n); (i)++) #define rep2(i, m, n) for (int(i) = (m); (i) < (n); (i)++) int main() { ios::sync_with_stdio(false); cin.tie(0); int n; cin >> n; vector<int> h(n); rep(i, n) cin ...
#include <bits/stdc++.h> using namespace std; using ll = long long; using P = pair<ll, ll>; #define rep(i, n) for (int(i) = 0; (i) < (n); (i)++) #define rep2(i, m, n) for (int(i) = (m); (i) < (n); (i)++) int main() { ios::sync_with_stdio(false); cin.tie(0); int n; cin >> n; vector<int> h(n); rep(i, n) cin ...
replace
16
17
16
17
0
p02923
C++
Time Limit Exceeded
#include <bits/stdc++.h> #include <math.h> using namespace std; int main() { int n; cin >> n; vector<int> a(n); vector<int> b(n); for (int i = 0; i < n; i++) { cin >> a.at(i); } for (int i = 0; i < n; i++) { int c = 0; for (int j = 1; j < n - i; j++) { if (a.at(i + j - 1) >= a.at(i + ...
#include <bits/stdc++.h> #include <math.h> using namespace std; int main() { int n; cin >> n; vector<int> a(n); vector<int> b(n); for (int i = 0; i < n; i++) { cin >> a.at(i); } for (int i = 0; i < n; i++) { int c = 0; for (int j = 1; j < n - i; j++) { if (a.at(i + j - 1) >= a.at(i + ...
insert
25
25
25
28
TLE