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
p03239
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; int main() { int N, T; cin >> N >> T; vector<int> A(N); vector<int> B(N); for (int i = 0; i < N; i++) { cin >> A[N] >> B[N]; } int b = 1001; for (int i = 0; i < N; i++) { if (T >= B[i]) { b = min(b, A[i]); } } if (b == 1001) { cout...
#include <bits/stdc++.h> using namespace std; int main() { int N, T; cin >> N >> T; vector<int> A(N); vector<int> B(N); for (int i = 0; i < N; i++) { cin >> A[i] >> B[i]; } int b = 1001; for (int i = 0; i < N; i++) { if (T >= B[i]) { b = min(b, A[i]); } } if (b == 1001) { cout...
replace
9
10
9
10
0
p03239
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; typedef long long ll; #define REP(i, n) for (ll i = 0; i < (ll)(n); i++) #define REPD(i, n) for (ll i = n - 1; i >= 0; i--) #define FOR(i, a, b) for (ll i = a; i <= (ll)(b); i++) #define FORD(i, a, b) for (ll i = a; i >= (ll)(b); i--) #define ALL(x) (x).begin(), (x).end() ...
#include <bits/stdc++.h> using namespace std; typedef long long ll; #define REP(i, n) for (ll i = 0; i < (ll)(n); i++) #define REPD(i, n) for (ll i = n - 1; i >= 0; i--) #define FOR(i, a, b) for (ll i = a; i <= (ll)(b); i++) #define FORD(i, a, b) for (ll i = a; i >= (ll)(b); i--) #define ALL(x) (x).begin(), (x).end() ...
replace
69
71
69
71
-6
terminate called after throwing an instance of 'std::out_of_range' what(): vector::_M_range_check: __n (which is 0) >= this->size() (which is 0)
p03239
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; // Compiler version g++ 6.3.0 int main() { int N, t; vector<int> a; cin >> N >> t; for (int i = 0; i < N; i++) { int x, y; cin >> x >> y; if (y <= t) { a.push_back(x); } } sort(a.begin(), a.end()); cout << a.at(0) << endl; }
#include <bits/stdc++.h> using namespace std; // Compiler version g++ 6.3.0 int main() { int N, t; vector<int> a; cin >> N >> t; for (int i = 0; i < N; i++) { int x, y; cin >> x >> y; if (y <= t) { a.push_back(x); } } sort(a.begin(), a.end()); if (!a.empty()) { cout << a.at(0) <...
replace
16
17
16
21
0
p03239
Python
Runtime Error
N, T = map(int, input().split()) c_t = [list(map(int, input().split())) for _ in range(N)] cost = 2_000_000 TLE_flg = True for i in range(N): if c_t[i][1] <= T: cost = min(cost, c_t[i][0]) TLE_flg = False print("TLE" if TLE_flg else cost)
N, T = map(int, input().split()) c_t = [list(map(int, input().split())) for _ in range(N)] cost = 2000000 TLE_flg = True for i in range(N): if c_t[i][1] <= T: cost = min(cost, c_t[i][0]) TLE_flg = False print("TLE" if TLE_flg else cost)
replace
2
3
2
3
0
p03239
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; using ll = long long; using Graph = vector<vector<int>>; int main() { int N, T; cin >> N >> T; vector<int> c; for (int i = 0; i < N; i++) { int t, x; cin >> x >> t; if (t <= T) { c.push_back(x); } } sort(c.begin(), c.end()); cout << c.at...
#include <bits/stdc++.h> using namespace std; using ll = long long; using Graph = vector<vector<int>>; int main() { int N, T; cin >> N >> T; vector<int> c; for (int i = 0; i < N; i++) { int t, x; cin >> x >> t; if (t <= T) { c.push_back(x); } } if (c.size() == 0) { cout << "TLE" <...
replace
16
18
16
22
0
p03239
C++
Runtime Error
#include <algorithm> #include <iostream> #include <vector> using namespace std; int main() { int N, T; cin >> N >> T; vector<int> cost; int c, t; for (int i = 0; i < N; i++) { cin >> c >> t; if (t <= T) { cost.push_back(c); } } sort(cost.begin(), cost.end()); cout << *cost.begin(); ...
#include <algorithm> #include <iostream> #include <vector> using namespace std; int main() { int N, T; cin >> N >> T; vector<int> cost; int c, t; for (int i = 0; i < N; i++) { cin >> c >> t; if (t <= T) { cost.push_back(c); } } if (cost.size() != 0) { sort(cost.begin(), cost.end());...
replace
16
18
16
22
0
p03239
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; int main() { int n, t; cin >> n >> t; vector<int> cost(0); for (int i = 0; i < n; i++) { int x, y; cin >> x >> y; if (y <= t) cost.push_back(x); } sort(cost.begin(), cost.end()); cout << cost.at(0) << endl; }
#include <bits/stdc++.h> using namespace std; int main() { int n, t; cin >> n >> t; vector<int> cost(0); for (int i = 0; i < n; i++) { int x, y; cin >> x >> y; if (y <= t) cost.push_back(x); } sort(cost.begin(), cost.end()); if (cost.size() > 0) cout << cost.at(0) << endl; else ...
replace
14
15
14
18
0
p03239
C++
Runtime Error
#include <algorithm> #include <bitset> #include <cctype> #include <cmath> #include <cstdio> #include <cstdlib> #include <cstring> #include <functional> #include <iomanip> #include <iostream> #include <map> #include <queue> #include <set> #include <stack> #include <string> #include <utility> #include <vector> #define pb...
#include <algorithm> #include <bitset> #include <cctype> #include <cmath> #include <cstdio> #include <cstdlib> #include <cstring> #include <functional> #include <iomanip> #include <iostream> #include <map> #include <queue> #include <set> #include <stack> #include <string> #include <utility> #include <vector> #define pb...
replace
44
45
44
48
0
p03239
C++
Runtime Error
#include <algorithm> #include <bitset> #include <cassert> #include <cmath> #include <cstdio> #include <cstring> #include <functional> #include <iomanip> #include <iostream> #include <list> #include <map> #include <numeric> #include <queue> #include <set> #include <string> #include <tuple> #include <utility> #include <v...
#include <algorithm> #include <bitset> #include <cassert> #include <cmath> #include <cstdio> #include <cstring> #include <functional> #include <iomanip> #include <iostream> #include <list> #include <map> #include <numeric> #include <queue> #include <set> #include <string> #include <tuple> #include <utility> #include <v...
replace
51
53
51
57
0
p03239
C++
Runtime Error
#include <algorithm> #include <iostream> #include <math.h> #include <string> #include <vector> using namespace std; int main() { int N, T; cin >> N >> T; vector<int> c(N), t(N); vector<int> answer; for (int i = 0; i < N; ++i) { cin >> c[i] >> t[i]; if (t[i] <= T) { answer.push_back(c[i]); } ...
#include <algorithm> #include <iostream> #include <math.h> #include <string> #include <vector> using namespace std; int main() { int N, T; cin >> N >> T; vector<int> c(N), t(N); vector<int> answer; for (int i = 0; i < N; ++i) { cin >> c[i] >> t[i]; if (t[i] <= T) { answer.push_back(c[i]); } ...
insert
17
17
17
21
0
p03239
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; int main() { cin.tie(0); ios::sync_with_stdio(false); freopen("input.txt", "r", stdin); int n, t; cin >> n >> t; vector<int> cost(n), time(n); for (int i = 0; i < n; ++i) { cin >> cost[i] >> time[i]; } int ans = 1001; for (int i = 0; i < n; ++i) ...
#include <bits/stdc++.h> using namespace std; int main() { cin.tie(0); ios::sync_with_stdio(false); // freopen("input.txt", "r", stdin); int n, t; cin >> n >> t; vector<int> cost(n), time(n); for (int i = 0; i < n; ++i) { cin >> cost[i] >> time[i]; } int ans = 1001; for (int i = 0; i < n; ++...
replace
6
7
6
7
-6
terminate called after throwing an instance of 'std::bad_alloc' what(): std::bad_alloc
p03239
C++
Runtime Error
#include <algorithm> #include <iostream> using namespace std; struct input { int c, t; } inputs[1000]; bool compare(input a, input b) { if (a.t == b.t) { return a.c < b.c; } return a.t < b.t; } int main() { int N, T; cin >> N >> T; int c, t; for (int i = 0; i < N; i++) { cin >> c >> t; in...
#include <algorithm> #include <iostream> using namespace std; struct input { int c, t; } inputs[1000]; bool compare(input a, input b) { if (a.t == b.t) { return a.c < b.c; } return a.t < b.t; } int main() { int N, T; cin >> N >> T; int c, t; for (int i = 0; i < N; i++) { cin >> c >> t; in...
replace
31
32
31
32
0
p03239
C++
Runtime Error
#include <algorithm> #include <iostream> #include <vector> using namespace std; int main() { int n, t, i; cin >> n >> t; vector<int> c, q; for (i = 0; i < n; i++) cin >> c[i] >> q[i]; vector<int> p; for (i = 0; i < n; i++) { if (q[i] <= t) p.push_back(c[i]); } if (p.size() == 0) cout <...
#include <algorithm> #include <iostream> #include <vector> using namespace std; int main() { int n, t, i; cin >> n >> t; int c[n], q[n]; for (i = 0; i < n; i++) cin >> c[i] >> q[i]; vector<int> p; for (i = 0; i < n; i++) { if (q[i] <= t) p.push_back(c[i]); } if (p.size() == 0) cout << ...
replace
7
8
7
8
-11
p03239
C++
Runtime Error
#define _GLIBCXX_DEBUG // TLEの原因になるので注意!!!!!!!!!!! #include <bits/stdc++.h> #include <cmath> typedef long long ll; using namespace std; vector<int> arr; stack<int> st; queue<int> qu; queue<pair<int, int>> qu2; priority_queue<int> pq; #define rep(i, n) for (int i = 0; i < (int)(n); i++) #define rep2(i, n) for (int i = 1...
#define _GLIBCXX_DEBUG // TLEの原因になるので注意!!!!!!!!!!! #include <bits/stdc++.h> #include <cmath> typedef long long ll; using namespace std; vector<int> arr; stack<int> st; queue<int> qu; queue<pair<int, int>> qu2; priority_queue<int> pq; #define rep(i, n) for (int i = 0; i < (int)(n); i++) #define rep2(i, n) for (int i = 1...
insert
189
189
189
193
0
p03239
C++
Runtime Error
#include <algorithm> #include <iostream> #include <vector> using namespace std; int main() { int N, T; cin >> N >> T; vector<int> C; for (int i = 0; i < N; i++) { int c, t; cin >> c >> t; if (t <= T) { C.push_back(c); } } sort(C.begin(), C.end()); cout << C[0] << endl; }
#include <algorithm> #include <iostream> #include <vector> using namespace std; int main() { int N, T; cin >> N >> T; vector<int> C; for (int i = 0; i < N; i++) { int c, t; cin >> c >> t; if (t <= T) { C.push_back(c); } } if (C.size() == 0) { cout << "TLE" << endl; return 0...
insert
19
19
19
24
0
p03239
C++
Runtime Error
#include <bits/stdc++.h> using ll = long long; #define int ll #define rep(i, n) for (int i = 0; i < n; i++) #define loop(i, s, n) for (int i = s; i < n; i++) #define erep(e, v) for (auto &&e : v) #define all(in) in.begin(), in.end() #define MP make_pair #define INF (sizeof(int) == 4 ? (int)1e9 : (int)1e18) #define EPS ...
#include <bits/stdc++.h> using ll = long long; #define int ll #define rep(i, n) for (int i = 0; i < n; i++) #define loop(i, s, n) for (int i = s; i < n; i++) #define erep(e, v) for (auto &&e : v) #define all(in) in.begin(), in.end() #define MP make_pair #define INF (sizeof(int) == 4 ? (int)1e9 : (int)1e18) #define EPS ...
replace
50
51
50
51
0
p03239
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; #define ll long long #define f(i, x, n) for (int i = x; i < (int)(n); ++i) #define speed \ ios::sync_with_stdio(0); \ cin.tie(0); int const N = 1e5 + 1; ...
#include <bits/stdc++.h> using namespace std; #define ll long long #define f(i, x, n) for (int i = x; i < (int)(n); ++i) #define speed \ ios::sync_with_stdio(0); \ cin.tie(0); int const N = 1e5 + 1; ...
delete
10
13
10
10
0
p03239
C++
Runtime Error
#include <algorithm> #include <iostream> #include <vector> int main(void) { int N, T; std::cin >> N >> T; std::vector<int> costs; int time = 0; int cost = 0; for (int i = 0; i < N; i++) { std::cin >> cost >> time; if (time <= T) { costs.push_back(cost); } } std::sort(costs.begin(), c...
#include <algorithm> #include <iostream> #include <vector> int main(void) { int N, T; std::cin >> N >> T; std::vector<int> costs; int time = 0; int cost = 0; for (int i = 0; i < N; i++) { std::cin >> cost >> time; if (time <= T) { costs.push_back(cost); } } if (costs.size() == 0) { ...
replace
17
19
17
23
0
p03239
C++
Time Limit Exceeded
#include <iostream> using namespace std; int main() { int N, T; cin >> N >> T; int c[1000]; int t[1000]; int cost = 1001; for (int i = 0; i < N; i++) { cin >> c[i] >> t[i]; if ((t[i] <= T) && (c[i] <= cost)) cost = c[i]; } if (cost == 1001) cout << "TLE"; else cout << cost; wh...
#include <iostream> using namespace std; int main() { int N, T; cin >> N >> T; int c[1000]; int t[1000]; int cost = 1001; for (int i = 0; i < N; i++) { cin >> c[i] >> t[i]; if ((t[i] <= T) && (c[i] <= cost)) cost = c[i]; } if (cost == 1001) cout << "TLE"; else cout << cost; re...
delete
18
20
18
18
TLE
p03239
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; int main() { int n, t, ci, ti; vector<int> cost; cin >> n >> t; for (int i = 0; i < n; i++) { cin >> ci >> ti; if (ti > t) continue; cost.push_back(ci); } cout << *min_element(cost.begin(), cost.end()); return 0; }
#include <bits/stdc++.h> using namespace std; int main() { int n, t, ci, ti; vector<int> cost; cin >> n >> t; for (int i = 0; i < n; i++) { cin >> ci >> ti; if (ti > t) continue; cost.push_back(ci); } if (cost.size() == 0) cout << "TLE"; else cout << *min_element(cost.begin(), c...
replace
13
14
13
17
0
p03239
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; int main() { int N, T, ans = 1001; cin >> N >> T; vector<int> c(N), t(N); for (int i = 1; i <= N; i++) { cin >> c[i] >> t[i]; } for (int i = 1; i <= N; i++) { if (t[i] <= T) ans = min(ans, c[i]); } if (ans == 1001) cout << "TLE" << endl; ...
#include <bits/stdc++.h> using namespace std; int main() { int N, T, ans = 1001; cin >> N >> T; vector<int> c(110), t(110); for (int i = 1; i <= N; i++) { cin >> c[i] >> t[i]; } for (int i = 1; i <= N; i++) { if (t[i] <= T) ans = min(ans, c[i]); } if (ans == 1001) cout << "TLE" << end...
replace
5
6
5
6
0
p03240
Python
Time Limit Exceeded
import sys read = sys.stdin.read readline = sys.stdin.readline readlines = sys.stdin.readlines sys.setrecursionlimit(10**9) INF = 1 << 60 MOD = 1000000007 def main(): N, *XYH = map(int, read().split()) for cx in range(101): for cy in range(101): ok = 10**12 ng = 0 ...
import sys read = sys.stdin.read readline = sys.stdin.readline readlines = sys.stdin.readlines sys.setrecursionlimit(10**9) INF = 1 << 60 MOD = 1000000007 def main(): N, *XYH = map(int, read().split()) for cx in range(101): for cy in range(101): ok = 10**9 + 100 ng = 0 ...
replace
15
16
15
16
TLE
p03240
Python
Runtime Error
def search_center(xyh_list): xyh_list.sort(key=lambda r: r[2], reverse=True) highest = xyh_list[0] for cx in range(101): for cy in range(101): h = highest[2] + abs(highest[0] - cx) + abs(highest[1] - cy) matched = True for xyh in xyh_list[1:]: if x...
def search_center(xyh_list): xyh_list.sort(key=lambda r: r[2], reverse=True) highest = xyh_list[0] for cx in range(101): for cy in range(101): h = highest[2] + abs(highest[0] - cx) + abs(highest[1] - cy) matched = True for xyh in xyh_list[1:]: if x...
replace
9
10
9
10
0
p03240
C++
Runtime Error
#pragma GCC optimize("O3") #include "bits/stdc++.h" using namespace std; using ll = long long int; #define debugos cout #define debug(v) \ { \ printf("L%d %s > ", __LINE__, #v...
#pragma GCC optimize("O3") #include "bits/stdc++.h" using namespace std; using ll = long long int; #define debugos cout #define debug(v) \ { \ printf("L%d %s > ", __LINE__, #v...
replace
206
207
206
207
0
p03240
C++
Runtime Error
#include <algorithm> #include <climits> #include <cmath> #include <iostream> #include <vector> using namespace std; class point { public: point(); point(long x, long y); point(const point &other); long x, y, h; long height(long cx, long cy); }; point::point(long x, long y) : x(x), y(y) {} point::point(con...
#include <algorithm> #include <climits> #include <cmath> #include <iostream> #include <vector> using namespace std; class point { public: point(); point(long x, long y); point(const point &other); long x, y, h; long height(long cx, long cy); }; point::point(long x, long y) : x(x), y(y) {} point::point(con...
replace
45
46
45
46
0
p03240
C++
Runtime Error
#include "bits/stdc++.h" #define fi first #define se second #define pb push_back #define mp make_pair #define rep(i, n) for (int i = 0; i < (n); ++i) #define rrep(i, n) for (int i = 1; i <= (n); ++i) #define drep(i, n) for (int i = (n)-1; i >= 0; --i) #define all(s) s.begin(), s.end() using namespace std; typedef long ...
#include "bits/stdc++.h" #define fi first #define se second #define pb push_back #define mp make_pair #define rep(i, n) for (int i = 0; i < (n); ++i) #define rrep(i, n) for (int i = 1; i <= (n); ++i) #define drep(i, n) for (int i = (n)-1; i >= 0; --i) #define all(s) s.begin(), s.end() using namespace std; typedef long ...
replace
34
37
34
42
0
p03240
C++
Runtime Error
#include <bits/stdc++.h> #define rep(i, n) for (long long i = 0; i < (n); i++) using namespace std; typedef long long ll; const int MOD = 1e9 + 7; const int MAX = 1000000; const ll INF = (1LL << 31) - 1; const double pi = acos(-1); ll n, x[101], y[101], h[101]; vector<tuple<ll, ll, ll>> vec; int main() { cin >> n; ...
#include <bits/stdc++.h> #define rep(i, n) for (long long i = 0; i < (n); i++) using namespace std; typedef long long ll; const int MOD = 1e9 + 7; const int MAX = 1000000; const ll INF = (1LL << 31) - 1; const double pi = acos(-1); ll n, x[101], y[101], h[101]; vector<tuple<ll, ll, ll>> vec; int main() { cin >> n; ...
insert
26
26
26
27
0
p03240
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; using ll = long long; using vi = vector<int>; using vvi = vector<vi>; using vd = vector<double>; using vvd = vector<vd>; using vl = vector<ll>; using vvl = vector<vl>; using pii = pair<int, int>; using vs = vector<string>; #define rep(i, n) range(i, 0, n) #define range(i, a...
#include <bits/stdc++.h> using namespace std; using ll = long long; using vi = vector<int>; using vvi = vector<vi>; using vd = vector<double>; using vvd = vector<vd>; using vl = vector<ll>; using vvl = vector<vl>; using pii = pair<int, int>; using vs = vector<string>; #define rep(i, n) range(i, 0, n) #define range(i, a...
replace
55
57
55
62
0
p03240
C++
Time Limit Exceeded
#include <bits/stdc++.h> using namespace std; int main() { int n; cin >> n; int x[111], y[111], h[111], z; for (int i = 0; i < n; i++) { cin >> x[i] >> y[i] >> h[i]; if (h[i]) z = i; } for (int i = 0; i < 101; i++) { for (int j = 0; j < 101; j++) { int a = 1, b = 2e9; while (...
#include <bits/stdc++.h> using namespace std; int main() { int n; cin >> n; int x[111], y[111], h[111], z; for (int i = 0; i < n; i++) { cin >> x[i] >> y[i] >> h[i]; if (h[i]) z = i; } for (int i = 0; i < 101; i++) { for (int j = 0; j < 101; j++) { int a = 1, b = 1e9 + 1000; ...
replace
15
16
15
16
TLE
p03240
C++
Runtime Error
#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 i, j, k; ll N, H, hight, count = 0; bool judge; cin >> N; vector<ll> x(N); vector<ll> y(N); vector<ll> h(N); rep(i, N) cin >> x[i] >> y[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 i, j, k; ll N, H, hight, count = 0; bool judge; cin >> N; vector<ll> x(N); vector<ll> y(N); vector<ll> h(N); rep(i, N) cin >> x[i] >> y[i] >>...
delete
27
29
27
27
0
p03240
C++
Runtime Error
#include <algorithm> #include <cassert> #include <climits> #include <cmath> #include <functional> #include <iostream> #include <map> #include <numeric> #include <set> #include <string> #include <tuple> #include <vector> using namespace std; template <typename T> inline T get() { T x; cin >> x; return x; } int ...
#include <algorithm> #include <cassert> #include <climits> #include <cmath> #include <functional> #include <iostream> #include <map> #include <numeric> #include <set> #include <string> #include <tuple> #include <vector> using namespace std; template <typename T> inline T get() { T x; cin >> x; return x; } int ...
replace
37
38
37
38
0
p03240
C++
Time Limit Exceeded
#include <algorithm> #include <cassert> #include <cctype> #include <cmath> #include <cstdarg> #include <cstdio> #include <cstdlib> #include <cstring> #include <fstream> #include <iostream> #include <map> #include <numeric> #include <queue> #include <set> #include <sstream> #include <stack> #include <string> #include <s...
#include <algorithm> #include <cassert> #include <cctype> #include <cmath> #include <cstdarg> #include <cstdio> #include <cstdlib> #include <cstring> #include <fstream> #include <iostream> #include <map> #include <numeric> #include <queue> #include <set> #include <sstream> #include <stack> #include <string> #include <s...
replace
65
66
65
78
TLE
p03240
C++
Runtime Error
#include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < (int)n; i++) #define all(c) (c).begin(), (c).end() #define pb push_back #define dbg(...) \ do { \ cerr << __LINE__ <<...
#include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < (int)n; i++) #define all(c) (c).begin(), (c).end() #define pb push_back #define dbg(...) \ do { \ cerr << __LINE__ <<...
insert
68
68
68
69
-11
p03240
C++
Time Limit Exceeded
#include <algorithm> #include <cmath> #include <cstdlib> #include <iostream> #include <stack> #include <vector> using namespace std; #define rep(i, n) for (int i = 0; i < (int)(n); i++) vector<int> x, y, h; int is_ok(int Cx, int Cy, int X_base, int Y_base, int h_base, int X, int Y, int h) { if (h > 0 &&...
#include <algorithm> #include <cmath> #include <cstdlib> #include <iostream> #include <stack> #include <vector> using namespace std; #define rep(i, n) for (int i = 0; i < (int)(n); i++) vector<int> x, y, h; int is_ok(int Cx, int Cy, int X_base, int Y_base, int h_base, int X, int Y, int h) { if (h > 0 &&...
delete
75
78
75
75
TLE
p03240
C++
Time Limit Exceeded
#include <algorithm> #include <iomanip> #include <iostream> #include <map> #include <stdio.h> #include <string> #include <vector> using namespace std; int main(void) { int n; cin >> n; int cx, cy, ch; vector<int> x(n), y(n), h(n); for (int i = 0; i < n; i++) { cin >> x[i] >> y[i] >> h[i]; } for (ch =...
#include <algorithm> #include <iomanip> #include <iostream> #include <map> #include <stdio.h> #include <string> #include <vector> using namespace std; int main(void) { int n; cin >> n; int cx, cy, ch; vector<int> x(n), y(n), h(n); for (int i = 0; i < n; i++) { cin >> x[i] >> y[i] >> h[i]; } for (cx =...
replace
17
27
17
32
TLE
p03240
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; using ll = long long; using ld = long double; using vi = vector<int>; using vvi = vector<vi>; using vvvi = vector<vvi>; using vll = vector<ll>; using vvll = vector<vll>; using vvvll = vector<vvll>; using vs = vector<string>; using pll = pair<ll, ll>; using vp = vector<pll>;...
#include <bits/stdc++.h> using namespace std; using ll = long long; using ld = long double; using vi = vector<int>; using vvi = vector<vi>; using vvvi = vector<vvi>; using vll = vector<ll>; using vvll = vector<vll>; using vvvll = vector<vvll>; using vs = vector<string>; using pll = pair<ll, ll>; using vp = vector<pll>;...
replace
87
88
87
90
0
p03240
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; int CalHeight(int Cx, int Cy, int H, int h, int x, int y) { if (h != 0) return abs(x - Cx) + abs(y - Cy) + h; else if (H <= abs(x - Cx) + abs(y - Cy)) return H; else return -1; } int main() { int N, cnt = 0, hs, xs, ys; cin >> N; int *x = new int[N...
#include <bits/stdc++.h> using namespace std; int CalHeight(int Cx, int Cy, int H, int h, int x, int y) { if (h != 0) return abs(x - Cx) + abs(y - Cy) + h; else if (H <= abs(x - Cx) + abs(y - Cy)) return H; else return -1; } int main() { int N, cnt = 0, hs, xs, ys; cin >> N; int *x = new int[N...
delete
34
35
34
34
1
p03240
C++
Time Limit Exceeded
#include <bits/stdc++.h> #define GET_REP(_1, _2, _3, NAME, ...) NAME #define rep(...) GET_REP(__VA_ARGS__, irep, _rep)(__VA_ARGS__) #define rep1(...) GET_REP(__VA_ARGS__, irep1, _rep1)(__VA_ARGS__) #define _rep(i, n) irep(i, 0, n) #define _rep1(i, n) irep1(i, 1, n) #define irep(i, a, n) for (int i = a; i < (int)(n); ++...
#include <bits/stdc++.h> #define GET_REP(_1, _2, _3, NAME, ...) NAME #define rep(...) GET_REP(__VA_ARGS__, irep, _rep)(__VA_ARGS__) #define rep1(...) GET_REP(__VA_ARGS__, irep1, _rep1)(__VA_ARGS__) #define _rep(i, n) irep(i, 0, n) #define _rep1(i, n) irep1(i, 1, n) #define irep(i, a, n) for (int i = a; i < (int)(n); ++...
replace
38
40
38
39
TLE
p03240
Python
Time Limit Exceeded
N = int(input()) P = [list(map(int, input().split())) for i in range(N)] i = 0 while 1: if P[0][2] > 0: break i += 1 x0, y0, h0 = P[i] for cy in range(101): for cx in range(101): h = h0 + abs(cx - x0) + abs(cy - y0) for x, y, h1 in P: if h1 != max(h - abs(cx - x) - abs(c...
N = int(input()) P = [list(map(int, input().split())) for i in range(N)] i = 0 while 1: if P[i][2] > 0: break i += 1 x0, y0, h0 = P[i] for cy in range(101): for cx in range(101): h = h0 + abs(cx - x0) + abs(cy - y0) for x, y, h1 in P: if h1 != max(h - abs(cx - x) - abs(c...
replace
5
6
5
6
TLE
p03240
Python
Runtime Error
# -*- coding: utf-8 -*- N = int(input()) X, Y, H = [], [], [] for _ in range(N): x, y, h = map(int, input().split()) X.append(x) Y.append(y) H.append(h) for x in range(101): for y in range(101): hc = {H[i] + abs(X[i] - x) + abs(Y[i] - y) for i in range(N) if H[i] > 0} h0 = {H[i] + ...
# -*- coding: utf-8 -*- N = int(input()) X, Y, H = [], [], [] for _ in range(N): x, y, h = map(int, input().split()) X.append(x) Y.append(y) H.append(h) for x in range(101): for y in range(101): hc = {H[i] + abs(X[i] - x) + abs(Y[i] - y) for i in range(N) if H[i] > 0} h0 = {H[i] + ...
replace
14
17
14
18
ValueError: max() arg is an empty sequence
Traceback (most recent call last): File "/home/alex/Documents/bug-detection/input/Project_CodeNet/data/p03240/Python/s122970234.py", line 15, in <module> if len(hc) == 1 and max(h0) <= max(hc): ValueError: max() arg is an empty sequence
p03240
Python
Runtime Error
N = int(input()) data = [tuple(map(int, input().split())) for _ in range(N)] data.sort(key=lambda x: x[2]) for cx in range(101): for cy in range(101): h0 = None for x, y, h in data: if h: h_tmp = h + abs(cx - x) + abs(cy - y) if h_tmp != h0 and h0 is not N...
N = int(input()) data = [tuple(map(int, input().split())) for _ in range(N)] data.sort(key=lambda x: -x[2]) for cx in range(101): for cy in range(101): h0 = None for x, y, h in data: if h: h_tmp = h + abs(cx - x) + abs(cy - y) if h_tmp != h0 and h0 is not ...
replace
2
3
2
3
0
p03240
C++
Time Limit Exceeded
#include <cmath> #include <iostream> using namespace std; int x[102], y[102], h[102]; int c_x, c_y, c_h; int max_h; int main() { int n; scanf("%d", &n); max_h = -1; for (int i = 1; i <= n; i++) { scanf("%d%d%d", x + i, y + i, h + i); max_h = max(max_h, h[i]); } int sign = 1; for (c_h = max_h; sign...
#include <cmath> #include <iostream> using namespace std; int x[102], y[102], h[102]; int c_x, c_y, c_h; int max_h; int main() { int n; scanf("%d", &n); max_h = -1; for (int i = 1; i <= n; i++) { scanf("%d%d%d", x + i, y + i, h + i); max_h = max(max_h, h[i]); } int sign = 1; for (c_h = max_h; sign...
replace
20
21
20
21
TLE
p03240
C++
Time Limit Exceeded
#include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < (int)(n); i++) using namespace std; using ll = long long; using P = pair<ll, ll>; const int INF = 1001001001; const int MOD = 1000000007; template <typename T> void print(const T &v); int main() { int n; cin >> n; vector<int> xs(n), ys(n), hs(n); ...
#include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < (int)(n); i++) using namespace std; using ll = long long; using P = pair<ll, ll>; const int INF = 1001001001; const int MOD = 1000000007; template <typename T> void print(const T &v); int main() { int n; cin >> n; vector<int> xs(n), ys(n), hs(n); ...
replace
19
20
19
20
TLE
p03240
C++
Time Limit Exceeded
#include <algorithm> #include <bits/stdc++.h> #include <iostream> using namespace std; int main() { int a; cin >> a; long long int x[110], y[110], h[110]; for (int i = 0; i < a; i++) { cin >> x[i] >> y[i] >> h[i]; } for (int posx = 0; posx <= 100; posx++) { for (int posy = 0; posy <= 100; posy...
#include <algorithm> #include <bits/stdc++.h> #include <iostream> using namespace std; int main() { int a; cin >> a; long long int x[110], y[110], h[110]; for (int i = 0; i < a; i++) { cin >> x[i] >> y[i] >> h[i]; } for (int posx = 0; posx <= 100; posx++) { for (int posy = 0; posy <= 100; posy...
replace
19
20
19
20
TLE
p03240
C++
Runtime Error
// 06, 10, 2018, 09:13:45 Rafaelcs cpp #include <bits/stdc++.h> using namespace std; typedef pair<int, int> pii; typedef long double ld; typedef long long ll; typedef unsigned long long ull; const int N = 100; pii p[N + 10]; int h[N + 10]; int n; int can(int i, int j) { int h0 = 1; for (int k = 0; k < n; k++) {...
// 06, 10, 2018, 09:13:45 Rafaelcs cpp #include <bits/stdc++.h> using namespace std; typedef pair<int, int> pii; typedef long double ld; typedef long long ll; typedef unsigned long long ull; const int N = 100; pii p[N + 10]; int h[N + 10]; int n; int can(int i, int j) { int h0 = 1; for (int k = 0; k < n; k++) {...
replace
19
20
19
20
0
p03240
C++
Runtime Error
#include <algorithm> #include <cmath> #include <iostream> #include <map> #include <numeric> #include <queue> #include <set> #include <stack> #include <string> #include <vector> typedef long long ll; #define PI 3.14159265359 #define rep(i, n) for (ll i = 0; i < (ll)(n); i++) #define mp make_pair #define all(v) v.begin...
#include <algorithm> #include <cmath> #include <iostream> #include <map> #include <numeric> #include <queue> #include <set> #include <stack> #include <string> #include <vector> typedef long long ll; #define PI 3.14159265359 #define rep(i, n) for (ll i = 0; i < (ll)(n); i++) #define mp make_pair #define all(v) v.begin...
replace
159
160
159
160
0
p03240
C++
Runtime Error
#include <algorithm> #include <cassert> #include <cmath> #include <cstdio> #include <iomanip> #include <iostream> #include <map> #include <numeric> #include <queue> #include <sstream> #include <vector> using namespace std; using lint = long long; constexpr int MOD = 1000000007, INF = 1111111111; constexpr lint LINF = ...
#include <algorithm> #include <cassert> #include <cmath> #include <cstdio> #include <iomanip> #include <iostream> #include <map> #include <numeric> #include <queue> #include <sstream> #include <vector> using namespace std; using lint = long long; constexpr int MOD = 1000000007, INF = 1111111111; constexpr lint LINF = ...
replace
66
67
66
67
0
p03240
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; using ll = long long; using ld = long double; using vi = vector<int>; using vll = vector<ll>; using P = pair<int, int>; const int INF = 1e9; const ll INFLL = 1e18; const int MOD = 1e9 + 7; const int NIL = -1; const ld PI = acosl(-1); #define rep(i, n) for (int i = 0; i <...
#include <bits/stdc++.h> using namespace std; using ll = long long; using ld = long double; using vi = vector<int>; using vll = vector<ll>; using P = pair<int, int>; const int INF = 1e9; const ll INFLL = 1e18; const int MOD = 1e9 + 7; const int NIL = -1; const ld PI = acosl(-1); #define rep(i, n) for (int i = 0; i <...
replace
45
46
45
46
-6
Fatal glibc error: malloc assertion failure in sysmalloc: (old_top == initial_top (av) && old_size == 0) || ((unsigned long) (old_size) >= MINSIZE && prev_inuse (old_top) && ((unsigned long) old_end & (pagesize - 1)) == 0)
p03240
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; #define fi first #define se second #define rep(i, n) for (int i = 0; i < (n); ++i) #define rrep(i, n) for (int i = 1; i <= (n); ++i) #define drep(i, n) for (int i = (n)-1; i >= 0; --i) #define srep(i, s, t) for (int i = s; i < t; ++i) #define rng(a) a.begin(), a.end() #defi...
#include <bits/stdc++.h> using namespace std; #define fi first #define se second #define rep(i, n) for (int i = 0; i < (n); ++i) #define rrep(i, n) for (int i = 1; i <= (n); ++i) #define drep(i, n) for (int i = (n)-1; i >= 0; --i) #define srep(i, s, t) for (int i = s; i < t; ++i) #define rng(a) a.begin(), a.end() #defi...
replace
111
112
111
112
0
p03240
C++
Time Limit Exceeded
#include <algorithm> #include <bitset> #include <cmath> #include <iostream> #include <list> #include <map> #include <math.h> #include <numeric> #include <queue> #include <set> #include <stack> #include <stdio.h> #include <string> #include <tuple> #include <vector> //  ceil(a/b) (a + (b - 1))/ b using namespace std; #...
#include <algorithm> #include <bitset> #include <cmath> #include <iostream> #include <list> #include <map> #include <math.h> #include <numeric> #include <queue> #include <set> #include <stack> #include <stdio.h> #include <string> #include <tuple> #include <vector> //  ceil(a/b) (a + (b - 1))/ b using namespace std; #...
insert
53
53
53
54
TLE
p03240
C++
Runtime Error
#include <algorithm> #include <cmath> #include <iostream> #include <string> #include <vector> #define ll long long using namespace std; int main() { int N; cin >> N; struct P { int x; int y; ll h; }; P p[N]; P sample; for (int i = 0; i < N; i++) { cin >> p[i].x >> p[i].y >> p[i].h; if...
#include <algorithm> #include <cmath> #include <iostream> #include <string> #include <vector> #define ll long long using namespace std; int main() { int N; cin >> N; struct P { int x; int y; ll h; }; P p[N]; P sample; for (int i = 0; i < N; i++) { cin >> p[i].x >> p[i].y >> p[i].h; if...
replace
32
33
32
33
0
p03240
C++
Runtime Error
#include <algorithm> #include <cassert> #include <chrono> #include <cmath> #include <fstream> #include <functional> #include <iomanip> #include <iostream> #include <limits> #include <list> #include <map> #include <numeric> #include <queue> #include <random> #include <set> #include <stack> #include <string> #include <th...
#include <algorithm> #include <cassert> #include <chrono> #include <cmath> #include <fstream> #include <functional> #include <iomanip> #include <iostream> #include <limits> #include <list> #include <map> #include <numeric> #include <queue> #include <random> #include <set> #include <stack> #include <string> #include <th...
insert
43
43
43
44
0
p03240
C++
Runtime Error
#include <algorithm> #include <cstdlib> #include <iostream> #include <vector> using namespace std; int main() { int N; int x[1000], y[1000], h[1000]; cin >> N; for (int i = 0; i < N; i++) { cin >> x[i] >> y[i] >> h[i]; } vector<int> CX; vector<int> CY; vector<int> HH; for (int cx = 0; cx <= 100;...
#include <algorithm> #include <cstdlib> #include <iostream> #include <vector> using namespace std; int main() { int N; int x[1000], y[1000], h[1000]; cin >> N; for (int i = 0; i < N; i++) { cin >> x[i] >> y[i] >> h[i]; } vector<int> CX; vector<int> CY; vector<int> HH; for (int cx = 0; cx <= 100;...
replace
40
42
40
42
0
p03240
C++
Runtime Error
#include <algorithm> #include <complex> #include <iostream> #include <limits.h> #include <map> #include <math.h> #include <queue> #include <set> #include <stack> #include <string> #include <unordered_map> #include <vector> using namespace std; typedef long long ll; typedef pair<ll, ll> P; int N; ll x[110], y[110], z...
#include <algorithm> #include <complex> #include <iostream> #include <limits.h> #include <map> #include <math.h> #include <queue> #include <set> #include <stack> #include <string> #include <unordered_map> #include <vector> using namespace std; typedef long long ll; typedef pair<ll, ll> P; int N; ll x[110], y[110], z...
insert
66
66
66
67
1
p03240
C++
Time Limit Exceeded
#include <bits/stdc++.h> using namespace std; int main() { int N; cin >> N; vector<int> x(N), y(N), h(N); for (int i = 0; i < N; i++) { cin >> x[i] >> y[i] >> h[i]; } int MAX = 100; for (int posX = 0; posX <= MAX; posX) { for (int posY = 0; posY <= MAX; posY) { int needH = -1; for...
#include <bits/stdc++.h> using namespace std; int main() { int N; cin >> N; vector<int> x(N), y(N), h(N); for (int i = 0; i < N; i++) { cin >> x[i] >> y[i] >> h[i]; } int MAX = 100; for (int posX = 0; posX <= MAX; posX++) { for (int posY = 0; posY <= MAX; posY++) { int needH = -1; ...
replace
14
16
14
16
TLE
p03240
Python
Runtime Error
# https://atcoder.jp/contests/abc112/tasks/abc112_c # ピラミッドの中心は必ず0-100の中にある # Hは1以上 # 与えられる情報だけで一意に定まる # 中心座標をa,bと置いたとき、ある点x,yにおける高さは # h(x,y; a,b)=max(H-|x-a|-|y-b|,0)である。 # ここで、真の高さとの誤差としてe(x,y;a,b)=|h(x,y;a,b) - h(x,y;Cx,Cy)|とすると。 # 任意のx,yでe=0となるa,bが答え。しかしHはわからないので0とする。 # そうすると任意のx,yでe(x,y;a,b)=constとなるa,bが答え。(ただ...
# https://atcoder.jp/contests/abc112/tasks/abc112_c # ピラミッドの中心は必ず0-100の中にある # Hは1以上 # 与えられる情報だけで一意に定まる # 中心座標をa,bと置いたとき、ある点x,yにおける高さは # h(x,y; a,b)=max(H-|x-a|-|y-b|,0)である。 # ここで、真の高さとの誤差としてe(x,y;a,b)=|h(x,y;a,b) - h(x,y;Cx,Cy)|とすると。 # 任意のx,yでe=0となるa,bが答え。しかしHはわからないので0とする。 # そうすると任意のx,yでe(x,y;a,b)=constとなるa,bが答え。(ただ...
replace
42
43
42
43
TLE
p03240
C++
Runtime Error
#include <algorithm> #include <iostream> #include <sstream> #include <string.h> using namespace std; class C { int N; int64_t record[100][3]; int64_t nonZeroPoint[3]; public: void solve() { cout << helper() << endl; } string helper() { ostringstream oss; int64_t h, tmph; bool flag{true}; ...
#include <algorithm> #include <iostream> #include <sstream> #include <string.h> using namespace std; class C { int N; int64_t record[100][3]; int64_t nonZeroPoint[3]; public: void solve() { cout << helper() << endl; } string helper() { ostringstream oss; int64_t h, tmph; bool flag{true}; ...
replace
29
31
29
32
0
p03240
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 n; cin >> n; vector<vector<ll>> v(n, vector<ll>(3)); rep(i, n) { rep(j, 3) { cin >> v[i][j]; } } bool flag = true; for (int x = 0; x <= 100; x++) { for (int y = 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 n; cin >> n; vector<vector<ll>> v(n, vector<ll>(3)); rep(i, n) { rep(j, 3) { cin >> v[i][j]; } } bool flag = true; for (int x = 0; x <= 100; x++) { for (int y = 0;...
replace
32
33
32
33
0
p03240
C++
Time Limit Exceeded
#include <algorithm> #include <cmath> #include <cstdio> #define rep(i, n) for (int i = 0; i < (n); i++) using namespace std; int main() { int n; scanf("%d", &n); int x[100], y[100], h[100]; rep(i, n) scanf("%d%d%d", x + i, y + i, h + i); rep(cy, 101) rep(cx, 101) { int lo = 0, hi = 2e9; while (lo ...
#include <algorithm> #include <cmath> #include <cstdio> #define rep(i, n) for (int i = 0; i < (n); i++) using namespace std; int main() { int n; scanf("%d", &n); int x[100], y[100], h[100]; rep(i, n) scanf("%d%d%d", x + i, y + i, h + i); rep(cy, 101) rep(cx, 101) { int lo = 0, hi = 1e9 + 1000; whi...
replace
15
16
15
16
TLE
p03240
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; #define all(x) (x).begin(), (x).end() #define rep(i, n) for (int i = 0; i < (n); i++) #define chmin(x, y) (x) = min((x), (y)) #define chmax(x, y) (x) = max((x), (y)) #define endl "\n" typedef long long ll; typedef pair<int, int> pii; typedef pair<ll, ll> pll; template <ty...
#include <bits/stdc++.h> using namespace std; #define all(x) (x).begin(), (x).end() #define rep(i, n) for (int i = 0; i < (n); i++) #define chmin(x, y) (x) = min((x), (y)) #define chmax(x, y) (x) = max((x), (y)) #define endl "\n" typedef long long ll; typedef pair<int, int> pii; typedef pair<ll, ll> pll; template <ty...
replace
56
57
56
57
0
p03240
C++
Time Limit Exceeded
#include <algorithm> #include <bitset> #include <functional> #include <iostream> #include <map> #include <math.h> #include <numeric> #include <queue> #include <stdio.h> #include <string> #include <vector> using namespace std; int main() { // input int n; cin >> n; // 全ての項目に対して3重でforループを回して各項目で条件を満たす組み合わせを出力...
#include <algorithm> #include <bitset> #include <functional> #include <iostream> #include <map> #include <math.h> #include <numeric> #include <queue> #include <stdio.h> #include <string> #include <vector> using namespace std; int main() { // input int n; cin >> n; // 全ての項目に対して3重でforループを回して各項目で条件を満たす組み合わせを出力...
replace
46
47
46
47
TLE
p03240
C++
Runtime Error
#include <algorithm> #include <array> #include <bitset> #include <cstdint> #include <deque> #include <functional> #include <iomanip> #include <iostream> #include <limits> #include <memory> #include <numeric> #include <queue> #include <unordered_map> #include <unordered_set> #include <vector> // constexpr std::int64_t ...
#include <algorithm> #include <array> #include <bitset> #include <cstdint> #include <deque> #include <functional> #include <iomanip> #include <iostream> #include <limits> #include <memory> #include <numeric> #include <queue> #include <unordered_map> #include <unordered_set> #include <vector> // constexpr std::int64_t ...
replace
44
45
44
46
0
p03240
C++
Runtime Error
#include <algorithm> #include <bitset> #include <chrono> #include <cmath> #include <iomanip> #include <iostream> #include <list> #include <map> #include <numeric> #include <queue> #include <stack> #include <unordered_map> #include <vector> using namespace std; using ll = long long; const ll INF = (ll)1e18 + 1; const ll...
#include <algorithm> #include <bitset> #include <chrono> #include <cmath> #include <iomanip> #include <iostream> #include <list> #include <map> #include <numeric> #include <queue> #include <stack> #include <unordered_map> #include <vector> using namespace std; using ll = long long; const ll INF = (ll)1e18 + 1; const ll...
replace
27
30
27
30
-11
p03240
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; typedef unsigned long ul; typedef unsigned long long ull; typedef long long ll; typedef vector<ll> vint; typedef vector<vector<ll>> vvint; typedef vector<vector<vector<ll>>> vvvint; typedef vector<string> vstring; typedef vector<vector<string>> vvstring; typedef vector<cha...
#include <bits/stdc++.h> using namespace std; typedef unsigned long ul; typedef unsigned long long ull; typedef long long ll; typedef vector<ll> vint; typedef vector<vector<ll>> vvint; typedef vector<vector<vector<ll>>> vvvint; typedef vector<string> vstring; typedef vector<vector<string>> vvstring; typedef vector<cha...
replace
294
296
294
302
0
p03240
C++
Runtime Error
#include <algorithm> #include <cmath> #include <functional> #include <iomanip> #include <iostream> #include <string> #include <utility> #include <vector> using namespace std; const auto MOD = 1000000007; const int INF = 1e9; const long long LINF = 1e18; #define rep(i, n) for (int i = 0; i < (n); i++) typedef long long...
#include <algorithm> #include <cmath> #include <functional> #include <iomanip> #include <iostream> #include <string> #include <utility> #include <vector> using namespace std; const auto MOD = 1000000007; const int INF = 1e9; const long long LINF = 1e18; #define rep(i, n) for (int i = 0; i < (n); i++) typedef long long...
replace
26
27
26
27
-11
p03240
C++
Time Limit Exceeded
#include <algorithm> #include <iomanip> #include <ios> // std::left, std::right #include <iostream> #include <map> #include <queue> #include <set> #include <string> #define REP(i, n) for (ll i = 0; i < (ll)n; i++) #define INF 1000000000000000 using namespace std; typedef long long ll; typedef double db; typedef string ...
#include <algorithm> #include <iomanip> #include <ios> // std::left, std::right #include <iostream> #include <map> #include <queue> #include <set> #include <string> #define REP(i, n) for (ll i = 0; i < (ll)n; i++) #define INF 1000000000000000 using namespace std; typedef long long ll; typedef double db; typedef string ...
replace
25
27
25
31
TLE
p03241
C++
Time Limit Exceeded
#include <bits/stdc++.h> using namespace std; int main() { int n, m; scanf("%d %d", &n, &m); int ans = 1; for (int i = 1; i <= m; ++i) { int x = i * (n - 1); if (x >= m) break; if ((m - x) % i == 0) ans = i; } return printf("%d", ans), 0; }
#include <bits/stdc++.h> using namespace std; int main() { int n, m; scanf("%d %d", &n, &m); if (n == 1) return printf("%d", m), 0; int ans = 1; for (int i = 1; i <= m; ++i) { int x = i * (n - 1); if (x >= m) break; if ((m - x) % i == 0) ans = i; } return printf("%d", ans), 0...
insert
7
7
7
9
TLE
p03241
C++
Time Limit Exceeded
#include <bits/stdc++.h> using namespace std; typedef long long unsigned int ll; // definition {{{ 1 // scaning {{{ 2 #define Scd(x) scanf("%d", &x) #define Scd2(x, y) scanf("%d%d", &x, &y) #define Scd3(x, y, z) scanf("%d%d%d", &x, &y, &z) #define Scll(x) scanf("%llu", &x) #define Scll2(x, y) scanf("%llu%llu", &x, &...
#include <bits/stdc++.h> using namespace std; typedef long long unsigned int ll; // definition {{{ 1 // scaning {{{ 2 #define Scd(x) scanf("%d", &x) #define Scd2(x, y) scanf("%d%d", &x, &y) #define Scd3(x, y, z) scanf("%d%d%d", &x, &y, &z) #define Scll(x) scanf("%llu", &x) #define Scll2(x, y) scanf("%llu%llu", &x, &...
insert
42
42
42
60
TLE
p03241
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; 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 = b; return 1; } return 0; } typedef long long int ll; #define EPS (1e-7) #define INF ...
#include <bits/stdc++.h> using namespace std; 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 = b; return 1; } return 0; } typedef long long int ll; #define EPS (1e-7) #define INF ...
replace
46
47
46
47
0
p03241
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; #define rep(i, n) for (int i = 0; i < (int)(n); i++) #define rep2(i, s, n) for (int i = (s); i < (int)(n); i++) int main() { int N, M; cin >> N >> M; vector<int> divisor; for (int i = 2; i * i <= M; i++) { if (M % i == 0) { divisor.push_back(i); if ...
#include <bits/stdc++.h> using namespace std; #define rep(i, n) for (int i = 0; i < (int)(n); i++) #define rep2(i, s, n) for (int i = (s); i < (int)(n); i++) int main() { int N, M; cin >> N >> M; vector<int> divisor; divisor.push_back(1); divisor.push_back(M); for (int i = 2; i * i <= M; i++) { if (M %...
insert
9
9
9
11
0
p03241
C++
Time Limit Exceeded
#include <algorithm> #include <cmath> #include <cstdio> #include <cstdlib> #include <cstring> #include <iostream> #include <map> using namespace std; typedef long long LL; LL n, m, p[100010], nump, ans; void getp() { p[0] = 2; for (int x = 3; x <= m; ++x) { bool succ = true; for (int j = 0; j < nump &&...
#include <algorithm> #include <cmath> #include <cstdio> #include <cstdlib> #include <cstring> #include <iostream> #include <map> using namespace std; typedef long long LL; LL n, m, p[100010], nump, ans; void getp() { p[0] = 2; for (int x = 3; x <= m; ++x) { bool succ = true; for (int j = 0; j < nump &&...
replace
31
34
31
40
TLE
p03241
C++
Runtime Error
#include <bits/stdc++.h> const int INF = 1e9; const int MOD = 1e9 + 7; using LL = long long; const LL LINF = 1e18; const double EPS = 1e-10; using namespace std; #define COUT(v) cout << (v) << endl #define CIN(n) \ int(n); ...
#include <bits/stdc++.h> const int INF = 1e9; const int MOD = 1e9 + 7; using LL = long long; const LL LINF = 1e18; const double EPS = 1e-10; using namespace std; #define COUT(v) cout << (v) << endl #define CIN(n) \ int(n); ...
replace
55
94
55
60
1
p03241
C++
Time Limit Exceeded
#include <bits/stdc++.h> using namespace std; using ll = long long; using ld = long double; // #define int long long // signed main(){ int main() { ios_base::sync_with_stdio(false); cin.tie(NULL); int n, m; cin >> n >> m; int d = 1; int ans = 1; while (d <= m) { if (m % d == 0) { if (m / d >= ...
#include <bits/stdc++.h> using namespace std; using ll = long long; using ld = long double; // #define int long long // signed main(){ int main() { ios_base::sync_with_stdio(false); cin.tie(NULL); int n, m; cin >> n >> m; int d = 1; int ans = 1; if (n == 1) { cout << m << "\n"; return 0; } ...
insert
15
15
15
21
TLE
p03241
C++
Runtime Error
// Devarshi #include <bits/stdc++.h> using namespace std; #define mp make_pair #define mt make_tuple #define fi first #define se second #define pb push_back #define ll long long #define all(x) (x).begin(), (x).end() #define rall(x) (x).rbegin(), (x).rend() #define rep(i, n) for (i = 0; i < n; i++) #define forn(i, n) ...
// Devarshi #include <bits/stdc++.h> using namespace std; #define mp make_pair #define mt make_tuple #define fi first #define se second #define pb push_back #define ll long long #define all(x) (x).begin(), (x).end() #define rall(x) (x).rbegin(), (x).rend() #define rep(i, n) for (i = 0; i < n; i++) #define forn(i, n) ...
replace
54
63
54
64
0
p03241
C++
Time Limit Exceeded
#include <algorithm> #include <cctype> #include <cmath> #include <cstdio> #include <functional> #include <iostream> #include <iterator> #include <map> #include <numeric> #include <queue> #include <set> #include <stack> #include <string> #include <tuple> #include <unordered_map> #include <utility> #include <vector> usi...
#include <algorithm> #include <cctype> #include <cmath> #include <cstdio> #include <functional> #include <iostream> #include <iterator> #include <map> #include <numeric> #include <queue> #include <set> #include <stack> #include <string> #include <tuple> #include <unordered_map> #include <utility> #include <vector> usi...
replace
39
42
39
51
TLE
p03241
C++
Time Limit Exceeded
#include <algorithm> #include <cmath> #include <cstring> #include <iomanip> #include <iostream> #include <list> #include <map> #include <numeric> #include <queue> #include <set> #include <stack> #include <string> #include <vector> const int inf = 1e9 + 7; const int mod = 1e9 + 7; #define YES(i) cout << (i ? "YES" : "NO...
#include <algorithm> #include <cmath> #include <cstring> #include <iomanip> #include <iostream> #include <list> #include <map> #include <numeric> #include <queue> #include <set> #include <stack> #include <string> #include <vector> const int inf = 1e9 + 7; const int mod = 1e9 + 7; #define YES(i) cout << (i ? "YES" : "NO...
insert
22
22
22
37
TLE
p03241
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; vector<long> calc(long x) { vector<long> dat; for (int i = 1; i * i <= x; i++) { if (x % i == 0) dat.push_back(i); } return dat; } int main() { long n, m; cin >> n >> m; vector<long> dat = calc(m); // for (auto e : dat) { // cout << e << endl;...
#include <bits/stdc++.h> using namespace std; vector<long> calc(long x) { vector<long> dat; for (int i = 1; i * i <= x; i++) { if (x % i == 0) dat.push_back(i); } return dat; } int main() { long n, m; cin >> n >> m; vector<long> dat = calc(m); // for (auto e : dat) { // cout << e << endl;...
replace
25
26
25
26
0
p03241
C++
Runtime Error
#include <algorithm> #include <cmath> #include <iostream> #include <vector> #define rep(i, n) for (int i = 0; i < (int)(n); i++) #define repR(i, n) for (int i = (n)-1; i > -1; i--) #define rep1(i, n) for (int i = 1; i < (int)(n + 1); i++) #define rep1R(i, n) for (int i = (n); i > 0; i--) typedef long long ll; typedef u...
#include <algorithm> #include <cmath> #include <iostream> #include <vector> #define rep(i, n) for (int i = 0; i < (int)(n); i++) #define repR(i, n) for (int i = (n)-1; i > -1; i--) #define rep1(i, n) for (int i = 1; i < (int)(n + 1); i++) #define rep1R(i, n) for (int i = (n); i > 0; i--) typedef long long ll; typedef u...
replace
16
18
16
17
0
p03241
C++
Time Limit Exceeded
#include <iostream> using namespace std; int main() { int N, M; cin >> N >> M; for (int i = N; i <= M; i++) { if (M % i == 0) { cout << M / i << endl; return 0; } } }
#include <iostream> using namespace std; int main() { int N, M; cin >> N >> M; for (int g = M / N; g > 0; g--) { if (M % g == 0) { cout << g << endl; return 0; } } }
replace
6
9
6
9
TLE
p03241
C++
Time Limit Exceeded
#include <bits/stdc++.h> using namespace std; #define rep(i, N) for (int i = 0; i < int(N); ++i) using ll = long long; const ll MOD = 1e9 + 7; const int INF = 1001001001; // const ll INF = 1000000000000000000LL; // 使い方 int main() { ll n, m; cin >> n >> m; ll ans = 1; for (int i = m; i > 1; i--) { if (m % i...
#include <bits/stdc++.h> using namespace std; #define rep(i, N) for (int i = 0; i < int(N); ++i) using ll = long long; const ll MOD = 1e9 + 7; const int INF = 1001001001; // const ll INF = 1000000000000000000LL; // 使い方 int main() { ll n, m; cin >> n >> m; ll ans = 1; for (int i = m / n; i > 1; i--) { if (m...
replace
13
14
13
14
TLE
p03241
C++
Time Limit Exceeded
#include <iostream> using namespace std; int main() { int n, m, ans = 1; cin >> n >> m; for (int i = 2; n * i <= m; i++) { if ((m - n * i) % i == 0) { ans = i; } } cout << ans << endl; return 0; }
#include <iostream> using namespace std; int main() { int n, m, ans = 1; cin >> n >> m; if (n == 1) { ans = m; } else { for (int i = 2; n * i <= m; i++) { if ((m - n * i) % i == 0) { ans = i; } } } cout << ans << endl; return 0; }
replace
7
10
7
14
TLE
p03241
C++
Runtime Error
#include <algorithm> #include <cmath> #include <functional> #include <iostream> #include <queue> #include <string> #include <vector> using namespace std; const int mod = 1000000007; #define ll long long int main() { int N; ll M; cin >> N >> M; vector<ll> X; for (int i = 1; i * i <= M; i++) { if (M % i ==...
#include <algorithm> #include <cmath> #include <functional> #include <iostream> #include <queue> #include <string> #include <vector> using namespace std; const int mod = 1000000007; #define ll long long int main() { int N; ll M; cin >> N >> M; vector<ll> X; for (int i = 1; i * i <= M; i++) { if (M % i ==...
insert
30
30
30
33
0
p03241
C++
Runtime Error
#include <bits/stdc++.h> #define rep(i, n) for (ll i = 0; i < (n); ++i) #define all(a) (a).begin(), (a).end() #define dunk(a) cout << (a) << endl #define rall(a) (a).rbegin(), (a).rend() const int INF = 2e9; using namespace std; using Graph = vector<vector<int>>; typedef pair<int, int> P; typedef long long ll; int mai...
#include <bits/stdc++.h> #define rep(i, n) for (ll i = 0; i < (n); ++i) #define all(a) (a).begin(), (a).end() #define dunk(a) cout << (a) << endl #define rall(a) (a).rbegin(), (a).rend() const int INF = 2e9; using namespace std; using Graph = vector<vector<int>>; typedef pair<int, int> P; typedef long long ll; int mai...
replace
15
16
15
16
-6
terminate called after throwing an instance of 'std::bad_alloc' what(): std::bad_alloc
p03241
Python
Runtime Error
import math N, M = map(int, input().split()) d = max(d for d in range(1, math.ceil(M / (N - 1))) if M % d == 0) print(d)
import math N, M = map(int, input().split()) if N == 1: print(M) else: d = max(d for d in range(1, math.ceil(M / (N - 1))) if M % d == 0) print(d)
replace
4
6
4
9
0
p03241
Python
Time Limit Exceeded
n, m = [int(_) for _ in input().split(" ")] print(max([i for i in range(1, m // n + 1) if m % i == 0]))
n, m = [int(_) for _ in input().split(" ")] ds = [i for i in range(1, int(m**0.5) + 1) if m % i == 0] ds.extend([m // i for i in ds]) print(max([i for i in ds if i <= m // n]))
replace
1
2
1
5
TLE
p03241
Python
Time Limit Exceeded
N, M = map(int, input().split()) ceil = M / N tmp = 1 mx = 0 while ceil >= tmp: if (M - tmp * (N - 1)) % tmp == 0: mx = tmp tmp += 1 print(mx)
N, M = map(int, input().split()) ceil = M // N for i in range(1, ceil + 1)[::-1]: tmp = M - i * (N - 1) if tmp > 0 and tmp % i == 0: print(i) break
replace
1
10
1
7
TLE
p03241
Python
Time Limit Exceeded
N, M = map(int, input().split()) print(max(d for d in range(1, M // N + 1) if M % d == 0))
N, M = map(int, input().split()) print(next(d for d in reversed(range(M // N + 1)) if M % d == 0))
replace
1
2
1
2
TLE
p03241
Python
Time Limit Exceeded
# https://atcoder.jp/contests/abc112/tasks/abc112_d n, m = map(int, input().split()) ans = 1 i = 1 limit = m / n while i <= limit: if m % i == 0 and m // i >= n: ans = max(ans, i) i += 1 print(ans)
# https://atcoder.jp/contests/abc112/tasks/abc112_d n, m = map(int, input().split()) if n == 1: ans = m else: ans = 1 i = 1 limit = m / n while i <= limit: if m % i == 0 and m // i >= n: ans = max(ans, i) i += 1 print(ans)
replace
3
10
3
13
TLE
p03241
C++
Time Limit Exceeded
#include <assert.h> #include <bits/stdc++.h> using namespace std; int main() { int n, m; cin >> n >> m; int ans = 1; for (int i = 1; i <= m; i++) if (m % i == 0 && m / i >= n) ans = i; cout << ans << endl; return 0; }
#include <assert.h> #include <bits/stdc++.h> using namespace std; int main() { int n, m; cin >> n >> m; for (int i = m / n; i > 0; i--) if (m % i == 0 && m / i >= n) { cout << i << endl; return 0; } return 0; }
replace
8
13
8
13
TLE
p03241
C++
Time Limit Exceeded
#include <algorithm> #include <iostream> using namespace std; int main() { int n, m; cin >> n >> m; int a, ans = 1; a = m / n; for (size_t i = 1; i < a + 1; i++) { if (m % i == 0) { if (ans < i) { ans = i; } } } cout << ans << endl; }
#include <algorithm> #include <iostream> using namespace std; int main() { int n, m; cin >> n >> m; int a, ans = 1; a = m / n; if (m % n == 0) { cout << m / n << endl; return 0; } for (size_t i = 1; i < a + 1; i++) { if (m % i == 0) { if (ans < i) { ans = i; } } } c...
insert
8
8
8
12
TLE
p03241
Python
Runtime Error
N, M = map(int, input().split()) # 項数N, Aの和M ans = 1 if N == 1: print(M) exit() for i in range(1000000): if (M >= N * i) and (M % i == 0): ans = i print(ans)
N, M = map(int, input().split()) # 項数N, Aの和M ans = 1 for i in range(1, int(M ** (1 / 2)) + 1): if M % i != 0: continue j = M // i # jはどんどん小さくなる if j >= N: ans = max(ans, i) if i >= N: ans = max(ans, j) print(ans)
replace
3
11
3
11
ZeroDivisionError: integer division or modulo by zero
Traceback (most recent call last): File "/home/alex/Documents/bug-detection/input/Project_CodeNet/data/p03241/Python/s190829031.py", line 10, in <module> if (M >= N * i) and (M % i == 0): ZeroDivisionError: integer division or modulo by zero
p03241
C++
Time Limit Exceeded
#include <bits/stdc++.h> #define MAX_N 100000 #define MAX_M 1000000000 typedef long long int ll; int main() { int n; ll m; std::cin >> n >> m; int ans = 1, tmp = 2; while (n * tmp <= m) { if (m % tmp == 0) ans = tmp; ++tmp; } std::cout << ans << std::endl; }
#include <bits/stdc++.h> #define MAX_N 100000 #define MAX_M 1000000000 typedef long long int ll; int main() { int n; ll m; std::cin >> n >> m; if (n == 1) { std::cout << m << std::endl; return 0; } ll ans = 1, tmp = 2; while (tmp * tmp <= m) { if (n * tmp > m) break; if (m % tmp...
replace
12
16
12
27
TLE
p03241
C++
Time Limit Exceeded
#include <algorithm> #include <cmath> #include <deque> #include <iomanip> #include <iostream> #include <map> #include <queue> #include <set> #include <stack> #include <string> #include <tuple> #include <utility> #include <vector> using namespace std; #define rep(i, n) for (int i = 0; i < (n); i++) using ll = long long...
#include <algorithm> #include <cmath> #include <deque> #include <iomanip> #include <iostream> #include <map> #include <queue> #include <set> #include <stack> #include <string> #include <tuple> #include <utility> #include <vector> using namespace std; #define rep(i, n) for (int i = 0; i < (n); i++) using ll = long long...
insert
22
22
22
26
TLE
p03241
C++
Runtime Error
#include <algorithm> #include <iostream> using namespace std; int main() { int n, m; cin >> n >> m; int s; if (m % n == 0) s = m / n; else { int s1 = m / n; s = s1 - 1; while ((m - (n - 1) * s) % s != 0) s--; } cout << s; return 0; }
#include <algorithm> #include <iostream> using namespace std; int main() { int n, m; cin >> n >> m; int s; if (m % n == 0) s = m / n; else { s = m / (n + 1); while ((m - (n - 1) * s) % s != 0) s--; } cout << s; return 0; }
replace
10
12
10
11
0
p03241
C++
Time Limit Exceeded
#include <algorithm> #include <bits/stdc++.h> #include <functional> #include <iostream> #include <math.h> #include <string> using namespace std; typedef long long ll; #define pb pushback #define fr(i, n) for (int i = 0; i < n; i++) #define fro(i, j, n) for (int i = j; i < n; i++) #define ifr(i, n) for (int i = n - 1; i...
#include <algorithm> #include <bits/stdc++.h> #include <functional> #include <iostream> #include <math.h> #include <string> using namespace std; typedef long long ll; #define pb pushback #define fr(i, n) for (int i = 0; i < n; i++) #define fro(i, j, n) for (int i = j; i < n; i++) #define ifr(i, n) for (int i = n - 1; i...
replace
17
18
17
18
TLE
p03241
C++
Runtime Error
/* Simplicity and Goodness */ #include <bits/stdc++.h> #include <ext/pb_ds/assoc_container.hpp> #include <ext/pb_ds/tree_policy.hpp> using namespace __gnu_pbds; using namespace std; typedef tree<int, null_type, less<int>, rb_tree_tag, tree_order_statistics_node_update> indexed_set; void my_dbg() { c...
/* Simplicity and Goodness */ #include <bits/stdc++.h> #include <ext/pb_ds/assoc_container.hpp> #include <ext/pb_ds/tree_policy.hpp> using namespace __gnu_pbds; using namespace std; typedef tree<int, null_type, less<int>, rb_tree_tag, tree_order_statistics_node_update> indexed_set; void my_dbg() { c...
replace
52
53
52
53
0
p03241
C++
Time Limit Exceeded
#include <bits/stdc++.h> #define r(i, n) for (int i = 0; i < n; i++) #define int long long using namespace std; typedef pair<int, int> P; typedef pair<int, P> P2; #define fi first #define se second int dx[] = {0, 1, 0, -1}; int dy[] = {-1, 0, 1, 0}; signed main() { int n, m; cin >> n >> m; for (int i = 450000000...
#include <bits/stdc++.h> #define r(i, n) for (int i = 0; i < n; i++) #define int long long using namespace std; typedef pair<int, int> P; typedef pair<int, P> P2; #define fi first #define se second int dx[] = {0, 1, 0, -1}; int dy[] = {-1, 0, 1, 0}; signed main() { int n, m; cin >> n >> m; vector<int> v; for (...
replace
14
15
14
28
TLE
p03241
C++
Time Limit Exceeded
#include <bits/stdc++.h> using namespace std; #define FOR(i, a, b) for (int i = (a); i < static_cast<int>(b); i++) #define FORR(i, a, b) for (int i = (a); i >= static_cast<int>(b); i--) #define rep(i, n) FOR(i, 0, n) #define repall(i, arr) for (auto &i : (arr)) #define all(x) (x).begin(), (x).end() #define pb push_bac...
#include <bits/stdc++.h> using namespace std; #define FOR(i, a, b) for (int i = (a); i < static_cast<int>(b); i++) #define FORR(i, a, b) for (int i = (a); i >= static_cast<int>(b); i--) #define rep(i, n) FOR(i, 0, n) #define repall(i, arr) for (auto &i : (arr)) #define all(x) (x).begin(), (x).end() #define pb push_bac...
replace
25
28
25
28
TLE
p03241
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; #define rep(i, b) for (i = 0; i < b; ++i) #define repp(i, a, b) for (i = a; i < b; ++i) #define per(i, n) for (i = n - 1; i >= 0; i--) #define endl "\n" #define pb push_back typedef long long int lli; const lli mod = 1000000007; typedef vector<lli> vi; typedef pair<lli, lli...
#include <bits/stdc++.h> using namespace std; #define rep(i, b) for (i = 0; i < b; ++i) #define repp(i, a, b) for (i = a; i < b; ++i) #define per(i, n) for (i = n - 1; i >= 0; i--) #define endl "\n" #define pb push_back typedef long long int lli; const lli mod = 1000000007; typedef vector<lli> vi; typedef pair<lli, lli...
replace
23
24
23
24
0
p03241
C++
Time Limit Exceeded
#include <iostream> // #include <iomanip> // #include <algorithm> // #include <numeric> // #include <queue> // #include <stack> #include <math.h> // #include <vector> // #include <string> typedef long long LL; using namespace std; int main() { LL n; LL m; LL ans; LL ans_l = 1; LL ans_h; LL tmp; cin >> n ...
#include <iostream> // #include <iomanip> // #include <algorithm> // #include <numeric> // #include <queue> // #include <stack> #include <math.h> // #include <vector> // #include <string> typedef long long LL; using namespace std; int main() { LL n; LL m; LL ans; LL ans_l = 1; LL ans_h; LL tmp; cin >> n ...
delete
32
35
32
32
TLE