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
p02763
C++
Runtime Error
// Catchharsh #include <bits/stdc++.h> #define ll long long int #define ld long double #define IOS \ ios_base::sync_with_stdio(false); \ cin.tie(NULL); ...
// Catchharsh #include <bits/stdc++.h> #define ll long long int #define ld long double #define IOS \ ios_base::sync_with_stdio(false); \ cin.tie(NULL); ...
replace
33
34
33
34
-11
p02763
C++
Time Limit Exceeded
#include <bits/stdc++.h> #define ll long long #define MODV 1000000007 #define INFLL LLONG_MAX // 9223372036854775807 #define EPS 1e-9 #define rep(i, n) for (ll i = 0, i##_len = (ll)(n); i < i##_len; i++) #define repf(i, n) for (ll i = 1, i##_len = (ll)(n + 1); i < i##_len; i++) #define all(v) v.begin(), v.end() #define...
#include <bits/stdc++.h> #define ll long long #define MODV 1000000007 #define INFLL LLONG_MAX // 9223372036854775807 #define EPS 1e-9 #define rep(i, n) for (ll i = 0, i##_len = (ll)(n); i < i##_len; i++) #define repf(i, n) for (ll i = 1, i##_len = (ll)(n + 1); i < i##_len; i++) #define all(v) v.begin(), v.end() #define...
replace
60
63
60
63
TLE
p02763
C++
Time Limit Exceeded
#include <bits/stdc++.h> using namespace std; #define rep(i, n) for (int i = 0; i < (int)(n); i++) #define rep1(i, n) for (int i = 1; i <= (int)(n); i++) typedef int64_t Int; int main() { Int N, Q; string s; cin >> N >> s >> Q; set<Int> S[26]; rep(i, N) { rep(j, 26) { if (s[i] == 'a' + j) ...
#include <bits/stdc++.h> using namespace std; #define rep(i, n) for (int i = 0; i < (int)(n); i++) #define rep1(i, n) for (int i = 1; i <= (int)(n); i++) typedef int64_t Int; int main() { Int N, Q; string s; cin >> N >> s >> Q; set<Int> S[26]; rep(i, N) { S[s[i] - 'a'].insert(i); } rep(i, 26) S[i].insert...
replace
13
20
13
15
TLE
p02763
C++
Time Limit Exceeded
#include <algorithm> #include <bits/stdc++.h> #define int long long using namespace std; typedef pair<int, int> P; #define rep(i, n) for (int i = 0; i < (int)(n); i++) #define INF 1000000000000 typedef long long ll; typedef vector<ll> vll; typedef vector<vll> vvll; typedef vector<bool> vb; typedef vector<vb> vvb; typed...
#include <algorithm> #include <bits/stdc++.h> #define int long long using namespace std; typedef pair<int, int> P; #define rep(i, n) for (int i = 0; i < (int)(n); i++) #define INF 1000000000000 typedef long long ll; typedef vector<ll> vll; typedef vector<vll> vvll; typedef vector<bool> vb; typedef vector<vb> vvb; typed...
replace
80
81
80
81
TLE
p02763
C++
Time Limit Exceeded
#include <bits/stdc++.h> #define REP(i, n) for (int i = 0; i < n; i++) #define REPR(i, n) for (int i = n; i >= 0; i--) #define FOR(i, m, n) for (int i = m; i < n; i++) #define FORR(i, m, n) for (int i = m; i >= n; i--) #define ALL(x) (x).begin(), (x).end() using namespace std; typedef long long ll; typedef pair<ll, l...
#include <bits/stdc++.h> #define REP(i, n) for (int i = 0; i < n; i++) #define REPR(i, n) for (int i = n; i >= 0; i--) #define FOR(i, m, n) for (int i = m; i < n; i++) #define FORR(i, m, n) for (int i = m; i >= n; i--) #define ALL(x) (x).begin(), (x).end() using namespace std; typedef long long ll; typedef pair<ll, l...
replace
42
46
42
43
TLE
p02763
C++
Runtime Error
#include <algorithm> #include <bitset> #include <cassert> #include <cctype> #include <climits> #include <cmath> #include <cstdint> #include <cstdio> #include <cstdlib> #include <functional> #include <iomanip> #include <iostream> #include <map> #include <numeric> #include <queue> #include <set> #include <stack> #include...
#include <algorithm> #include <bitset> #include <cassert> #include <cctype> #include <climits> #include <cmath> #include <cstdint> #include <cstdio> #include <cstdlib> #include <functional> #include <iomanip> #include <iostream> #include <map> #include <numeric> #include <queue> #include <set> #include <stack> #include...
replace
73
74
73
74
0
p02763
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; typedef long long ll; const ll MOD = 1e9 + 7; const int iinf = 1 << 28; const long long llinf = 1ll << 60; const double PI = 3.14159265; // int st[1050000][26]; // const int mid = 524288; int st[16][26]; const int mid = 8; void upd(int idx, char c) { int v = c - 'a'; ...
#include <bits/stdc++.h> using namespace std; typedef long long ll; const ll MOD = 1e9 + 7; const int iinf = 1 << 28; const long long llinf = 1ll << 60; const double PI = 3.14159265; int st[1050000][26]; const int mid = 524288; // int st[16][26]; // const int mid = 8; void upd(int idx, char c) { int v = c - 'a'; ...
replace
8
12
8
12
0
p02763
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; #define popcnt(a) __builtin_popcount(a) #define error(args...) \ { \ cerr << "LINE " << __LINE__; ...
#include <bits/stdc++.h> using namespace std; #define popcnt(a) __builtin_popcount(a) #define error(args...) \ { \ cerr << "LINE " << __LINE__; ...
replace
21
22
21
22
0
LINE 39 m = 6
p02763
C++
Time Limit Exceeded
#include <algorithm> #include <cmath> #include <deque> #include <functional> #include <iostream> #include <map> #include <queue> #include <set> #include <stack> #include <string> #include <vector> using namespace std; #define ll long long const int mod = 1000000007; const int MOD = 998244353; const ll INF = 10000000000...
#include <algorithm> #include <cmath> #include <deque> #include <functional> #include <iostream> #include <map> #include <queue> #include <set> #include <stack> #include <string> #include <vector> using namespace std; #define ll long long const int mod = 1000000007; const int MOD = 998244353; const ll INF = 10000000000...
replace
46
47
46
47
TLE
p02763
C++
Runtime Error
#pragma GCC optimize("O3", "unroll-loops") // #pragma GCC target("avx2") #include <bits/stdc++.h> #include <stdio.h> using namespace std; #define ull unsigned long long #define si short int #define ll long long #define ld long double #define pb push_back #define pii pair<int, int> #define pil pair<int, ll> #define pli...
#pragma GCC optimize("O3", "unroll-loops") // #pragma GCC target("avx2") #include <bits/stdc++.h> #include <stdio.h> using namespace std; #define ull unsigned long long #define si short int #define ll long long #define ld long double #define pb push_back #define pii pair<int, int> #define pil pair<int, ll> #define pli...
replace
21
22
21
22
0
p02763
C++
Runtime Error
#include <algorithm> #include <bitset> #include <cassert> #include <cctype> #include <cmath> #include <complex> #include <cstdlib> #include <cstring> #include <fstream> #include <functional> #include <iomanip> #include <iostream> #include <iterator> #include <list> #include <map> #include <queue> #include <random> #inc...
#include <algorithm> #include <bitset> #include <cassert> #include <cctype> #include <cmath> #include <complex> #include <cstdlib> #include <cstring> #include <fstream> #include <functional> #include <iomanip> #include <iostream> #include <iterator> #include <list> #include <map> #include <queue> #include <random> #inc...
replace
61
62
61
62
0
p02763
C++
Runtime Error
#include <algorithm> #include <iostream> #include <queue> #include <string> #include <vector> using ll = long long; using namespace std; #include <functional> #include <limits> #define ASSIGN_I \ [](T &ival, T x) { ival = x; } // i番目にxを代入(点更新のデフォルト) t...
#include <algorithm> #include <iostream> #include <queue> #include <string> #include <vector> using ll = long long; using namespace std; #include <functional> #include <limits> #define ASSIGN_I \ [](T &ival, T x) { ival = x; } // i番目にxを代入(点更新のデフォルト) t...
replace
119
121
119
121
0
p02763
C++
Time Limit Exceeded
#include <iostream> #include <set> #include <string> using namespace std; int main(void) { int n, q; string s; cin >> n >> s >> q; set<int> st[26]; for (int i = 0; i < n; i++) { st[s[i] - 'a'].insert(i + 1); } for (int i = 0; i < q; i++) { int t; cin >> t; if (t == 1) { int p; ...
#include <iostream> #include <set> #include <string> using namespace std; int main(void) { int n, q; string s; cin >> n >> s >> q; set<int> st[26]; for (int i = 0; i < n; i++) { st[s[i] - 'a'].insert(i + 1); } for (int i = 0; i < q; i++) { int t; cin >> t; if (t == 1) { int p; ...
replace
33
34
33
34
TLE
p02763
C++
Time Limit Exceeded
#include <bits/stdc++.h> #pragma GCC optimize("O3") using namespace std; using int64 = long long; const int mod = 1e9 + 7; const int64 infll = (1LL << 58) - 1; const int inf = (1 << 30) - 1; struct IoSetup { IoSetup() { cin.tie(nullptr); ios::sync_with_stdio(false); cout << fixed << setprecision(10); ...
#include <iomanip> #include <iostream> #include <string> #include <vector> using namespace std; using int64 = long long; const int mod = 1e9 + 7; const int64 infll = (1LL << 58) - 1; const int inf = (1 << 30) - 1; struct IoSetup { IoSetup() { cin.tie(nullptr); ios::sync_with_stdio(false); cout << fixe...
replace
0
2
0
5
TLE
p02763
C++
Time Limit Exceeded
/* lib.cpp */ #include <algorithm> #include <bitset> #include <climits> #include <cmath> #include <cstdio> #include <cstdlib> #include <deque> #include <iomanip> #include <iostream> #include <list> #include <map> #include <queue> #include <set> #include <stack> #include <string> #include <vector> #define DEBUG(x) cou...
/* lib.cpp */ #include <algorithm> #include <bitset> #include <climits> #include <cmath> #include <cstdio> #include <cstdlib> #include <deque> #include <iomanip> #include <iostream> #include <list> #include <map> #include <queue> #include <set> #include <stack> #include <string> #include <vector> #define DEBUG(x) cou...
replace
210
211
210
211
TLE
p02763
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; int main() { int n; string s; cin >> n; cin >> s; int q; cin >> q; set<int> pos[26]; for (int i = 0; i < n; i++) { pos[s[i] - 'a'].insert(i); } while (q-- > 0) { int type; cin >> type; if (type == 1) { int i; char c; ...
#include <bits/stdc++.h> using namespace std; int main() { int n; string s; cin >> n; cin >> s; int q; cin >> q; set<int> pos[26]; for (int i = 0; i < n; i++) { pos[s[i] - 'a'].insert(i); } while (q-- > 0) { int type; cin >> type; if (type == 1) { int i; char c; ...
replace
24
25
24
25
0
p02763
C++
Memory Limit Exceeded
#include <algorithm> #include <iostream> #include <map> #include <math.h> #include <queue> #include <set> #include <stdio.h> using namespace std; typedef long long ll; typedef pair<ll, ll> P; ll N, S, Q; ll q[500001]; map<char, int>::iterator ite; ll A[500001][20][26]; int B[500001]; int ans[26]; int henkan(char s) { ...
#include <algorithm> #include <iostream> #include <map> #include <math.h> #include <queue> #include <set> #include <stdio.h> using namespace std; typedef long long ll; typedef pair<ll, ll> P; int N, S, Q; int A[500001][20][26]; int B[500001]; int ans[26]; int henkan(char s) { if (s == 'a') return 0; if (s == '...
replace
10
14
10
12
MLE
p02763
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; #define INF 1000000007 #define ll long long #define F first #define S second #define pii pair<ll int, ll int> #define pb push_back #define ppb pop_back #define vi vector<ll int> int seg[2000000][26]; int input[500001][26]; void construct_tree(int low, int high, int pos) ...
#include <bits/stdc++.h> using namespace std; #define INF 1000000007 #define ll long long #define F first #define S second #define pii pair<ll int, ll int> #define pb push_back #define ppb pop_back #define vi vector<ll int> int seg[2000000][26]; int input[500001][26]; void construct_tree(int low, int high, int pos) ...
replace
61
63
61
63
-11
p02763
C++
Time Limit Exceeded
#include <algorithm> #include <iostream> #include <set> #include <vector> using namespace std; typedef long long ll; void solve() { ll n, q; string s; cin >> n >> s >> q; vector<set<ll>> st(26); for (int i = 0; i < n; i++) { int x = s[i] - 'a'; st[x].insert(i); } cout << endl; for (int i = 0; i...
#include <algorithm> #include <iostream> #include <set> #include <vector> using namespace std; typedef long long ll; void solve() { ll n, q; string s; cin >> n >> s >> q; vector<set<ll>> st(26); for (int i = 0; i < n; i++) { int x = s[i] - 'a'; st[x].insert(i); } cout << endl; for (int i = 0; i...
replace
32
34
32
34
TLE
p02763
C++
Runtime Error
// #define _GLIBCXX_DEBUG // #include <atcoder/all> #include <bits/stdc++.h> #ifndef ATCODER_INTERNAL_TYPE_TRAITS_HPP #define ATCODER_INTERNAL_TYPE_TRAITS_HPP 1 #include <cassert> #include <numeric> #include <type_traits> namespace atcoder { namespace internal { #ifndef _MSC_VER template <class T> using is_signed_...
// #define _GLIBCXX_DEBUG // #include <atcoder/all> #include <bits/stdc++.h> #ifndef ATCODER_INTERNAL_TYPE_TRAITS_HPP #define ATCODER_INTERNAL_TYPE_TRAITS_HPP 1 #include <cassert> #include <numeric> #include <type_traits> namespace atcoder { namespace internal { #ifndef _MSC_VER template <class T> using is_signed_...
replace
194
196
194
196
0
p02763
C++
Runtime Error
/*input abcdefgh 4 1 2 a 1 8 g 2 1 3 2 1 8 */ /* ______________ | ) | ) / |______/...
/*input abcdefgh 4 1 2 a 1 8 g 2 1 3 2 1 8 */ /* ______________ | ) | ) / |______/...
replace
123
124
123
124
0
p02763
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; int seg(int l, int r, int n, int nl, int nr, vector<int> &t) { if (r <= nl || nr <= l) return 0; else if (l <= nl && nr <= r) return t[n]; else { int mid = (nl + nr) / 2; return seg(l, r, n * 2, nl, mid, t) + seg(l, r, n * 2 + 1, mid, nr, t); } } int...
#include <bits/stdc++.h> using namespace std; int seg(int l, int r, int n, int nl, int nr, vector<int> &t) { if (r <= nl || nr <= l) return 0; else if (l <= nl && nr <= r) return t[n]; else { int mid = (nl + nr) / 2; return seg(l, r, n * 2, nl, mid, t) + seg(l, r, n * 2 + 1, mid, nr, t); } } int...
replace
17
18
17
18
0
p02763
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; template <typename T> void print(T t) { cout << t << endl; } template <typename T, typename... Args> void print(T t, Args... args) { cout << t << " "; print(args...); } #define IOS \ ios::sync_with_s...
#include <bits/stdc++.h> using namespace std; template <typename T> void print(T t) { cout << t << endl; } template <typename T, typename... Args> void print(T t, Args... args) { cout << t << " "; print(args...); } #define IOS \ ios::sync_with_s...
replace
19
20
19
20
0
p02763
C++
Runtime Error
#pragma GCC target("avx2") #pragma GCC optimize("O3", "unroll-loops") #include <bits/stdc++.h> using namespace std; #define int long long #define fastIO() \ ios_base::sync_with_stdio(false); \ cin.tie(0); ...
#pragma GCC target("avx2") #pragma GCC optimize("O3", "unroll-loops") #include <bits/stdc++.h> using namespace std; #define int long long #define fastIO() \ ios_base::sync_with_stdio(false); \ cin.tie(0); ...
replace
52
53
52
53
-11
p02763
C++
Runtime Error
#include <bits/stdc++.h> #include <string> using namespace std; #define ll long long #define ull unsigned long long #define si(X) scanf("%d", &(X)) #define sll(X) scanf("%lld", &(X)) #define INFL 0x3f3f3f3f3f3f3f3fLL const int mod = 1e9 + 7; ll gcd(ll a, ll b) { if (b == 0) return a; return gcd(b, a % b); } ll ...
#include <bits/stdc++.h> #include <string> using namespace std; #define ll long long #define ull unsigned long long #define si(X) scanf("%d", &(X)) #define sll(X) scanf("%lld", &(X)) #define INFL 0x3f3f3f3f3f3f3f3fLL const int mod = 1e9 + 7; ll gcd(ll a, ll b) { if (b == 0) return a; return gcd(b, a % b); } ll ...
replace
29
30
29
30
0
p02764
C++
Time Limit Exceeded
#include <algorithm> #include <cmath> #include <iomanip> #include <iostream> #include <queue> using namespace std; struct Node { double x, y, r; Node(double x, double y, double r) : x(x), y(y), r(r) {} }; int n, k; vector<int> x, y, c; double distance(double px, double py) { vector<double> dis(n); for (int...
#include <algorithm> #include <cmath> #include <iomanip> #include <iostream> #include <queue> using namespace std; struct Node { double x, y, r; Node(double x, double y, double r) : x(x), y(y), r(r) {} }; int n, k; vector<int> x, y, c; double distance(double px, double py) { vector<double> dis(n); for (int...
replace
55
56
55
56
TLE
p02764
C++
Time Limit Exceeded
#include <cmath> #include <iomanip> #include <iostream> #include <vector> using namespace std; struct point { double x, y; }; int n, k, EPS = 1000; double l = 0, ri = 1E10; vector<point> p; vector<double> c; double len(point a, point b) { return hypot((a.x - b.x), (a.y - b.y)); } bool yet_ok(double t) { if (n =...
#include <cmath> #include <iomanip> #include <iostream> #include <vector> using namespace std; struct point { double x, y; }; int n, k, EPS = 100; double l = 0, ri = 1E10; vector<point> p; vector<double> c; double len(point a, point b) { return hypot((a.x - b.x), (a.y - b.y)); } bool yet_ok(double t) { if (n ==...
replace
10
11
10
11
TLE
p02764
C++
Runtime Error
#include "bits/stdc++.h" #define _overload3(_1, _2, _3, name, ...) name #define _rep(i, n) repi(i, 0, n) #define repi(i, a, b) for (int i = int(a), i##_len = (b); i < i##_len; ++i) #define MSVC_UNKO(x) x #define rep(...) \ MSVC_UNKO(_overload3(__VA_ARGS__,...
#include "bits/stdc++.h" #define _overload3(_1, _2, _3, name, ...) name #define _rep(i, n) repi(i, 0, n) #define repi(i, a, b) for (int i = int(a), i##_len = (b); i < i##_len; ++i) #define MSVC_UNKO(x) x #define rep(...) \ MSVC_UNKO(_overload3(__VA_ARGS__,...
replace
60
61
60
61
0
p02764
C++
Time Limit Exceeded
#include "bits/stdc++.h" using namespace std; typedef long long ll; typedef pair<int, int> pii; typedef pair<ll, ll> pll; const int INF = 1e9; const ll LINF = 1e18; inline ll gcd(ll a, ll b) { return b ? gcd(b, a % b) : a; } inline ll lcm(ll a, ll b) { return a / gcd(a, b) * b; } template <class S, class T> ostream &op...
#include "bits/stdc++.h" using namespace std; typedef long long ll; typedef pair<int, int> pii; typedef pair<ll, ll> pll; const int INF = 1e9; const ll LINF = 1e18; inline ll gcd(ll a, ll b) { return b ? gcd(b, a % b) : a; } inline ll lcm(ll a, ll b) { return a / gcd(a, b) * b; } template <class S, class T> ostream &op...
replace
305
306
305
306
TLE
p02764
C++
Time Limit Exceeded
#include <cmath> #include <iomanip> #include <iostream> using namespace std; typedef pair<double, double> P; typedef pair<P, P> PP; const double INF = 1e100; pair<pair<double, double>, pair<double, double>> circle_cross_point(double x0, double y0, double r0, double x1, double y1, double r1) { if ...
#include <cmath> #include <iomanip> #include <iostream> using namespace std; typedef pair<double, double> P; typedef pair<P, P> PP; const double INF = 1e100; pair<pair<double, double>, pair<double, double>> circle_cross_point(double x0, double y0, double r0, double x1, double y1, double r1) { if ...
replace
36
37
36
37
TLE
p02764
C++
Time Limit Exceeded
#include <algorithm> #include <cmath> #include <complex> #include <functional> #include <iostream> #include <limits> #include <sstream> #include <string> #include <queue> #include <vector> using namespace std; int N, K; vector<tuple<int, int, int>> info; double nth_distance(double x, double y) { vector<double> di...
#include <algorithm> #include <cmath> #include <complex> #include <functional> #include <iostream> #include <limits> #include <sstream> #include <string> #include <queue> #include <vector> using namespace std; int N, K; vector<tuple<int, int, int>> info; double nth_distance(double x, double y) { vector<double> di...
replace
64
65
64
65
TLE
p02764
C++
Time Limit Exceeded
#include "bits/stdc++.h" using namespace std; #define all(v) (v).begin(), (v).end() #define io ios::sync_with_stdio(0) #define rep(i, a, b) for (int i = a; i <= b; i++) #define rson rt << 1 | 1, mid + 1, r #define lson rt << 1, l, mid #define lll __int128 #define pii pair<int, int> #define fi first #define se second #d...
#include "bits/stdc++.h" using namespace std; #define all(v) (v).begin(), (v).end() #define io ios::sync_with_stdio(0) #define rep(i, a, b) for (int i = a; i <= b; i++) #define rson rt << 1 | 1, mid + 1, r #define lson rt << 1, l, mid #define lll __int128 #define pii pair<int, int> #define fi first #define se second #d...
replace
159
160
159
161
TLE
p02764
C++
Time Limit Exceeded
#pragma GCC optimize("Ofast") #include <bits/stdc++.h> // #include<ext/pb_ds/assoc_container.hpp> // #include<ext/pb_ds/tree_policy.hpp> // #include<ext/pb_ds/tag_and_trait.hpp> // using namespace __gnu_pbds; using namespace std; using ll = long long; #define double long double using datas = pair<ll, ll>; using ddatas ...
#pragma GCC optimize("Ofast") #include <bits/stdc++.h> // #include<ext/pb_ds/assoc_container.hpp> // #include<ext/pb_ds/tree_policy.hpp> // #include<ext/pb_ds/tag_and_trait.hpp> // using namespace __gnu_pbds; using namespace std; using ll = long long; // #define double long double using datas = pair<ll, ll>; using ddat...
replace
8
9
8
9
TLE
p02764
C++
Runtime Error
#ifndef LOCAL #pragma GCC optimize("Ofast,no-stack-protector") #pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,mmx,tune=native") #endif // LOCAL #define _SCL_SECURE_NO_WARNINGS #define _USE_MATH_DEFINES #define _CRT_SECURE_NO_WARNINGS #pragma comment(linker, "/STACK:256000000") // #define push_back pb #define fi...
#ifndef LOCAL #pragma GCC optimize("Ofast,no-stack-protector") #pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,mmx,tune=native") #endif // LOCAL #define _SCL_SECURE_NO_WARNINGS #define _USE_MATH_DEFINES #define _CRT_SECURE_NO_WARNINGS #pragma comment(linker, "/STACK:256000000") // #define push_back pb #define fi...
replace
381
384
381
384
0
p02764
C++
Runtime Error
#pragma GCC optimize("Ofast") #pragma GCC target("avx2") #pragma GCC optimization("unroll-loops") #include <bits/stdc++.h> using namespace std; #define PI 3.14159265358979323846 void *wmem; char memarr[96000000]; template <class T> inline void walloc1d(T **arr, int x, void **mem = &wmem) { static int skip[16] = {0, 1...
#pragma GCC optimize("Ofast") #pragma GCC target("avx") #pragma GCC optimization("unroll-loops") #include <bits/stdc++.h> using namespace std; #define PI 3.14159265358979323846 void *wmem; char memarr[96000000]; template <class T> inline void walloc1d(T **arr, int x, void **mem = &wmem) { static int skip[16] = {0, 15...
replace
1
2
1
2
0
p02764
C++
Time Limit Exceeded
#include <algorithm> #include <cmath> #include <iomanip> #include <iostream> #include <vector> using namespace std; using Vect = pair<long double, long double>; Vect operator+(Vect lhs, Vect rhs) { Vect ret = make_pair(0, 0); ret.first = lhs.first + rhs.first; ret.second = lhs.second + rhs.second; return ret;...
#include <algorithm> #include <cmath> #include <iomanip> #include <iostream> #include <vector> using namespace std; using Vect = pair<long double, long double>; Vect operator+(Vect lhs, Vect rhs) { Vect ret = make_pair(0, 0); ret.first = lhs.first + rhs.first; ret.second = lhs.second + rhs.second; return ret;...
replace
65
66
65
66
TLE
p02765
Python
Runtime Error
n, r = map(int, input()) if n >= 10: print(r) else: print(r + 100 * (10 - n))
n, r = map(int, input().split()) if n >= 10: print(r) else: print(r + 100 * (10 - n))
replace
0
1
0
1
ValueError: invalid literal for int() with base 10: ' '
Traceback (most recent call last): File "/home/alex/Documents/bug-detection/input/Project_CodeNet/data/p02765/Python/s819191130.py", line 1, in <module> n, r = map(int, input()) ValueError: invalid literal for int() with base 10: ' '
p02765
C++
Runtime Error
#include <algorithm> #include <climits> #include <cmath> #include <cstring> #include <iomanip> #include <iostream> #include <map> #include <numeric> #include <queue> #include <set> #include <stack> #include <unordered_map> #include <unordered_set> #include <vector> #define vi vector<float> #define vl vector<long long> ...
#include <algorithm> #include <climits> #include <cmath> #include <cstring> #include <iomanip> #include <iostream> #include <map> #include <numeric> #include <queue> #include <set> #include <stack> #include <unordered_map> #include <unordered_set> #include <vector> #define vi vector<float> #define vl vector<long long> ...
replace
33
37
33
37
0
p02765
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; int main() { long long n, a, b, s; s = 0; cin >> n >> a >> b; long long v[100000008][1000000008]; for (int i = 0; i < n; i++) { v[i][0] = 1; v[i][i] = 1; } for (int i = 2; i < n; i++) { for (int j = 1; j < i; j++) { v[i][j] = (v[i - 1][j - 1...
#include <bits/stdc++.h> using namespace std; int main() { int n, k; cin >> n >> k; if (n > 9) cout << k << endl; else cout << k + 100 * (10 - n) << endl; }
replace
4
24
4
10
-11
p02765
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; #define test \ int t; \ cin >> t; \ while (t--) #define fast ...
#include <bits/stdc++.h> using namespace std; #define test \ int t; \ cin >> t; \ while (t--) #define fast ...
replace
30
32
30
32
0
p02765
C++
Time Limit Exceeded
#include <bits/stdc++.h> using namespace std; const long long int mod = 1000000007; int main() { vector<vector<vector<long long>>> U( 10000, vector<vector<long long>>(100, vector<long long>(12, 1000))); for (size_t i = 0; true; i++) { } int N, M; cin >> N >> M; cout << M + (max(0, 10 - N) * 100); }
#include <bits/stdc++.h> using namespace std; const long long int mod = 1000000007; int main() { vector<vector<vector<long long>>> U( 10000, vector<vector<long long>>(100, vector<long long>(12, 1000))); int N, M; cin >> N >> M; cout << M + (max(0, 10 - N) * 100); }
replace
7
9
7
8
TLE
p02765
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; #define fast ios_base::sync_with_stdio(false), cin.tie(NULL), cout.tie(NULL) #define mod 1000000007 #define M 100001 #define endl "\n" #define all(a) (a).begin(), (a).end() #define lp(i, a, b) for (i = a; i < b; i++) #define lpr(i, a, b) for (i = a; i >= b; i--) #define F ...
#include <bits/stdc++.h> using namespace std; #define fast ios_base::sync_with_stdio(false), cin.tie(NULL), cout.tie(NULL) #define mod 1000000007 #define M 100001 #define endl "\n" #define all(a) (a).begin(), (a).end() #define lp(i, a, b) for (i = a; i < b; i++) #define lpr(i, a, b) for (i = a; i >= b; i--) #define F ...
replace
24
28
24
28
0
p02765
C++
Runtime Error
// DEEPANSHU RAWAT // BTECH/10530/18 #include <bits/stdc++.h> #define ull unsigned long long #define lld long long int #define infi LLONG_MAX #define ninfi LLONG_MIN #define ff first #define ss second #define pb push_back #define mp make_pair #define e endl #define mod 998244353 using namespace std; int main() { io...
// DEEPANSHU RAWAT // BTECH/10530/18 #include <bits/stdc++.h> #define ull unsigned long long #define lld long long int #define infi LLONG_MAX #define ninfi LLONG_MIN #define ff first #define ss second #define pb push_back #define mp make_pair #define e endl #define mod 998244353 using namespace std; int main() { io...
replace
20
24
20
26
0
p02765
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; #define ll long long #define MOD 1000000007 #define pb push_back #define mp make_pair #define mt make_tuple #define all(x) (x).begin(), (x).end() int main() { #ifndef ONLINE_JUDGE freopen("input.txt", "r", stdin); freopen("output.txt", "w", stdout); #endif ios::sy...
#include <bits/stdc++.h> using namespace std; #define ll long long #define MOD 1000000007 #define pb push_back #define mp make_pair #define mt make_tuple #define all(x) (x).begin(), (x).end() int main() { // #ifndef ONLINE_JUDGE // freopen("input.txt", "r", stdin); // freopen("output.txt", "w", stdout); //...
replace
12
16
12
16
0
p02765
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; typedef long long int ll; typedef vector<int> vi; #define IOS \ ios::sync_with_stdio(false); \ cin.tie(NULL); ...
#include <bits/stdc++.h> using namespace std; typedef long long int ll; typedef vector<int> vi; #define IOS \ ios::sync_with_stdio(false); \ cin.tie(NULL); ...
replace
25
30
25
30
0
p02765
C++
Runtime Error
#include <stdio.h> int main(void) { int n, r, a; scanf("%d,&n"); scanf("%d,&r"); if (n >= 10) a = r; else a = r + 100 * (10 - n); printf("%d\n", a); return 0; }
#include <stdio.h> int main(void) { int n, r, a; scanf("%d", &n); scanf("%d", &r); if (n >= 10) a = r; else a = r + 100 * (10 - n); printf("%d\n", a); return 0; }
replace
4
6
4
6
-11
p02765
C++
Runtime Error
#include <bits/stdc++.h> #define FILE #define fr first #define se second using namespace std; const long long N = 2e5 + 7; const long long inf = 1e9 + 7; const long long mod = 1e9 + 7; int n; int k; int main() { #ifdef FILE freopen("input.txt", "r", stdin); freopen("output.txt", "w", stdout); #endif ios_base...
#include <bits/stdc++.h> #define FILE #define fr first #define se second using namespace std; const long long N = 2e5 + 7; const long long inf = 1e9 + 7; const long long mod = 1e9 + 7; int n; int k; int main() { #ifdef FILEs freopen("input.txt", "r", stdin); freopen("output.txt", "w", stdout); #endif ios_bas...
replace
15
16
15
16
0
p02766
C++
Time Limit Exceeded
#include <algorithm> #include <bits/stdc++.h> #include <cmath> #include <iomanip> #include <ios> #include <iostream> #include <map> #include <vector> #define REP(i, n) for (int i = 0; i < (int)(n); ++i) #define REP2(i, m, n) for (int i = (m); i < (int)(n); ++i) #define REPR(i, n) for (int i = (n)-1; i >= 0; --i) #defin...
#include <algorithm> #include <bits/stdc++.h> #include <cmath> #include <iomanip> #include <ios> #include <iostream> #include <map> #include <vector> #define REP(i, n) for (int i = 0; i < (int)(n); ++i) #define REP2(i, m, n) for (int i = (m); i < (int)(n); ++i) #define REPR(i, n) for (int i = (n)-1; i >= 0; --i) #defin...
insert
102
102
102
103
TLE
p02766
C++
Time Limit Exceeded
#include <bits/stdc++.h> #include <iostream> #include <string> using namespace std; int main() { int n, k; cin >> n >> k; int ans = 0; while (n / k >= 0) { ans++; n /= k; } cout << ans << endl; return 0; }
#include <bits/stdc++.h> #include <iostream> #include <string> using namespace std; int main() { int n, k; cin >> n >> k; int ans = 0; while (n > 0) { ans++; n /= k; } cout << ans << endl; return 0; }
replace
11
12
11
12
TLE
p02766
C++
Time Limit Exceeded
#include <bits/stdc++.h> using namespace std; int main() { long long int N, K, ans = 0; cin >> N >> K; for (int i = 0;; i++) { if (pow(K, i) < N && pow(K, i + 1) > N) { ans = i + 1; break; } } cout << ans; return 0; }
#include <bits/stdc++.h> using namespace std; int main() { long long int N, K, ans = 0; cin >> N >> K; while (N) { N /= K; ans++; } cout << ans; return 0; }
replace
7
12
7
11
TLE
p02766
C++
Time Limit Exceeded
#include <iostream> using namespace std; int main() { int N, K; cin >> N >> K; int ans = 0; while (N > 0) { N / K; ans++; } cout << ans << endl; }
#include <iostream> using namespace std; int main() { int N, K; cin >> N >> K; int ans = 0; while (N > 0) { N /= K; ans++; } cout << ans << endl; }
replace
7
8
7
8
TLE
p02766
C++
Time Limit Exceeded
#include <bits/stdc++.h> using namespace std; #define rep(i, n) for (int i = 0; i < (int)(n); i++) int main() { int n, k; cin >> n >> k; int cnt = 0; while (n > 0) { cnt++; n / k; } cout << cnt << endl; return 0; }
#include <bits/stdc++.h> using namespace std; #define rep(i, n) for (int i = 0; i < (int)(n); i++) int main() { int n, k; cin >> n >> k; int cnt = 0; while (n > 0) { cnt++; n = n / k; } cout << cnt << endl; return 0; }
replace
10
11
10
11
TLE
p02766
C++
Time Limit Exceeded
#include <iostream> using namespace std; int main() { int n; int k; cin >> n >> k; int result = 0; for (int i = 0; i < 1000000000; i++) { n = n / k; result++; } cout << result << endl; }
#include <iostream> using namespace std; int main() { int n; int k; cin >> n >> k; int result = 0; while (n > 0) { n = n / k; result++; } cout << result << endl; }
replace
9
10
9
10
TLE
p02766
C++
Time Limit Exceeded
#include <bits/stdc++.h> using namespace std; typedef long long ll; int main() { ll n, k; cin >> n >> k; int i = 1; while (true) { if (n < pow(k, i)) { cout << i << endl; return 0; } } }
#include <bits/stdc++.h> using namespace std; typedef long long ll; int main() { ll n, k; cin >> n >> k; int i = 1; while (true) { if (n < pow(k, i)) { cout << i << endl; return 0; } else i++; } }
replace
12
13
12
14
TLE
p02766
C++
Time Limit Exceeded
#include <bits/stdc++.h> using namespace std; int n, k; int main() { cin >> n >> k; int c = 0; while (n != 1) { n /= k; c++; } cout << ++c; return 0; }
#include <bits/stdc++.h> using namespace std; int n, k; int main() { cin >> n >> k; int c = 0; while (n >= k) { n /= k; c++; } cout << ++c; return 0; }
replace
8
9
8
9
TLE
p02766
C++
Time Limit Exceeded
#include <bits/stdc++.h> using namespace std; int main() { int n, k, a; cin >> n >> k; while (n > k) { if (n / k > k) { n /= k; a++; } } a++; cout << a << endl; }
#include <bits/stdc++.h> using namespace std; int main() { int n, k, a; cin >> n >> k; a = 0; while (n >= k) { n /= k; a++; } a++; cout << a << endl; }
replace
6
11
6
10
TLE
p02766
C++
Runtime Error
#include <iostream> using namespace std; int main() { int N, K; cin >> N >> K; int tmp = N; int count = 0; do { tmp = tmp / K; count++; } while (tmp > 0); cout << count << endl; return 1; }
#include <iostream> using namespace std; int main() { int N, K; cin >> N >> K; int tmp = N; int count = 0; do { tmp = tmp / K; count++; } while (tmp > 0); cout << count << endl; return 0; }
replace
16
17
16
17
1
p02766
C++
Runtime Error
#include <algorithm> #include <bits/stdc++.h> #include <climits> #include <cmath> #include <cstdio> #include <cstdlib> #include <ext/pb_ds/assoc_container.hpp> #include <ext/pb_ds/tree_policy.hpp> #include <iomanip> #include <map> #include <queue> #include <set> #include <stack> #include <string> #include <utility> #in...
#include <algorithm> #include <bits/stdc++.h> #include <climits> #include <cmath> #include <cstdio> #include <cstdlib> #include <ext/pb_ds/assoc_container.hpp> #include <ext/pb_ds/tree_policy.hpp> #include <iomanip> #include <map> #include <queue> #include <set> #include <stack> #include <string> #include <utility> #in...
replace
43
48
43
48
0
p02766
C++
Time Limit Exceeded
#include <bits/stdc++.h> using namespace std; int main() { int N, K; cin >> N >> K; int ans = 0; while (N > 0) { N / K; ans++; } cout << ans << endl; }
#include <bits/stdc++.h> using namespace std; int main() { int N, K; cin >> N >> K; int ans = 0; while (N > 0) { N /= K; ans++; } cout << ans << endl; }
replace
8
9
8
9
TLE
p02766
C++
Runtime Error
#include <iostream> int main(void) { long n; int k; int counter = 1; while (n >= k) { counter += 1; n = (n - n % k) / k; } std::cout << counter; }
#include <iostream> int main(void) { long n; int k; int counter = 1; std::cin >> n >> k; while (n >= k) { counter += 1; n = (n - n % k) / k; } std::cout << counter; }
insert
5
5
5
6
0
p02766
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; string st; int main() { int n, p, d; char c; do { d = n % p; n = n / p; if (d >= 0 && d <= 9) { c = d + '0'; } else { c = d + 55; } st = c + st; } while (n != 0); cout << st.size(); return 0; }
#include <bits/stdc++.h> using namespace std; string st; int main() { int n, p, d; cin >> n >> p; char c; do { d = n % p; n = n / p; if (d >= 0 && d <= 9) { c = d + '0'; } else { c = d + 55; } st = c + st; } while (n != 0); cout << st.size(); return 0; }
insert
5
5
5
6
0
p02766
Python
Runtime Error
MAX_N = 1_000_000_000 n, k = map(int, input().split()) for i in range(MAX_N): if n < pow(k, i): print(i) break
MAX_N = pow(10, 9) n, k = map(int, input().split()) for i in range(MAX_N): if n < pow(k, i): print(i) break
replace
0
1
0
1
0
p02766
Python
Time Limit Exceeded
n, k = map(int, input().split()) for i in range(2**n): # if k ** (i - 1) - 1 < n <= k ** i - 1: if n <= k**i - 1: print(i) exit()
n, k = map(int, input().split()) for i in range(2**31): if n <= k**i - 1: print(i) exit()
replace
2
4
2
3
TLE
p02766
C++
Time Limit Exceeded
#include <bits/stdc++.h> #define ll long long using namespace std; int main() { int N, K; cin >> N >> K; int ans = 0; while (N > 0) { N / K; ans++; } cout << ans << endl; return 0; }
#include <bits/stdc++.h> #define ll long long using namespace std; int main() { int N, K; cin >> N >> K; int ans = 0; while (N > 0) { N /= K; ans++; } cout << ans << endl; return 0; }
replace
10
11
10
11
TLE
p02766
C++
Time Limit Exceeded
#include <bits/stdc++.h> using namespace std; int main() { double N, R, ans; cin >> N >> R; for (long long i = 1; i <= 100000000; i++) { if (N >= pow(R, i) && N < pow(R, i + 1)) { ans = i + 1; break; } } cout << ans << endl; }
#include <bits/stdc++.h> using namespace std; int main() { double N, R, ans; cin >> N >> R; for (int i = 0; i <= 30; i++) { if (N >= pow(R, i) && N < pow(R, i + 1)) { ans = i + 1; break; } } cout << ans << endl; }
replace
5
6
5
6
TLE
p02766
C++
Time Limit Exceeded
#include <iostream> using namespace std; int main() { int N, K, count = 0; cin >> N >> K; while (N >= K) { count++; } cout << count + 1 << endl; }
#include <iostream> using namespace std; int main() { int N, K, count = 0; cin >> N >> K; while (N >= K) { count++; N = N / K; } cout << count + 1 << endl; }
insert
7
7
7
8
TLE
p02766
C++
Runtime Error
#include "bits/stdc++.h" #define allr(x) x.rbegin(), x.rend() #define all(x) x.begin(), x.end() #define sp " " #define double long double #define pb push_back #define ff first #define int long long #define ss second #define vi vector<int> #define mem(ara, a) memset(ara, a, sizeof(ara)) #define bruh freopen("bruh.txt", ...
#include "bits/stdc++.h" #define allr(x) x.rbegin(), x.rend() #define all(x) x.begin(), x.end() #define sp " " #define double long double #define pb push_back #define ff first #define int long long #define ss second #define vi vector<int> #define mem(ara, a) memset(ara, a, sizeof(ara)) #define bruh freopen("bruh.txt", ...
replace
23
25
23
25
0
p02766
C++
Time Limit Exceeded
#include <iostream> using namespace std; int main() { int n, k, cnt = 0; cin >> n >> k; while (n % k >= 0) { cnt++; n /= k; } cout << cnt << endl; return 0; }
#include <iostream> using namespace std; int main() { int n, k, cnt = 0; cin >> n >> k; while (n > 0) { cnt++; n /= k; } cout << cnt << endl; return 0; }
replace
8
9
8
9
TLE
p02766
C++
Time Limit Exceeded
#include <bits/stdc++.h> using namespace std; int main() { int N, K; cin >> N >> K; int kai = N, count = 0; while (kai != 0) { kai = N / K; count++; } cout << count << endl; }
#include <bits/stdc++.h> using namespace std; int main() { int N, K; cin >> N >> K; int count = 0; while (N != 0) { N = N / K; count++; } cout << count << endl; }
replace
7
10
7
10
TLE
p02766
C++
Runtime Error
#define _CRT_SECURE_NO_WARNINGS #include <algorithm> #include <chrono> #include <cmath> #include <cstdio> #include <cstring> #include <functional> #include <iostream> #include <map> #include <queue> #include <random> #include <stack> #include <string> #include <unordered_map> #include <unordered_set> #include <vector> ...
#define _CRT_SECURE_NO_WARNINGS #include <algorithm> #include <chrono> #include <cmath> #include <cstdio> #include <cstring> #include <functional> #include <iostream> #include <map> #include <queue> #include <random> #include <stack> #include <string> #include <unordered_map> #include <unordered_set> #include <vector> ...
replace
38
39
38
39
0
p02766
C++
Runtime Error
#include <algorithm> #include <assert.h> #include <bitset> #include <complex> #include <deque> #include <functional> #include <iomanip> #include <iostream> #include <map> #include <math.h> #include <numeric> #include <queue> #include <set> #include <stack> #include <string> #include <vector> using namespace std; #def...
#include <algorithm> #include <assert.h> #include <bitset> #include <complex> #include <deque> #include <functional> #include <iomanip> #include <iostream> #include <map> #include <math.h> #include <numeric> #include <queue> #include <set> #include <stack> #include <string> #include <vector> using namespace std; #def...
replace
32
34
32
34
0
p02766
C++
Runtime Error
#include <bits/stdc++.h> #include <cmath> #include <cstdlib> using namespace std; int main() { int N; int K; cin >> N >> K; int L = 1; for (int i = 0; i < N; i++) { if (N / K != 0) { L++; K *= K; } else break; } cout << L << endl; }
#include <bits/stdc++.h> #include <cmath> #include <cstdlib> using namespace std; int main() { int N; int K; cin >> N >> K; int L = 1; while (N / K != 0) { L++; N /= K; } cout << L << endl; }
replace
9
15
9
12
0
p02766
C++
Time Limit Exceeded
#include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < (n); ++i) using namespace std; using ll = long long; // using P = pair<int,int>; int main() { int n, k; int counts = 0; cin >> n >> k; while (n != 1) { counts++; n /= k; } cout << counts + 1 << endl; }
#include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < (n); ++i) using namespace std; using ll = long long; // using P = pair<int,int>; int main() { int n, k; int counts = 0; cin >> n >> k; while (n >= k) { counts++; n /= k; } cout << counts + 1 << endl; }
replace
10
11
10
11
TLE
p02766
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; int main() { long n, k, c; cin >> n, k; c = 0; while (n) { c++; n = n / k; } cout << c; return 0; }
#include <bits/stdc++.h> using namespace std; int main() { long n, k, c; cin >> n >> k; c = 0; while (n) { c++; n = n / k; } cout << c; return 0; }
replace
5
6
5
6
0
p02766
Python
Time Limit Exceeded
n, k = map(int, input().split()) counter = 1 while n != 1: n = int(n / k) counter += 1 print(counter)
n, k = map(int, input().split()) counter = 1 while n >= k: n = int(n / k) counter += 1 print(counter)
replace
2
3
2
3
TLE
p02766
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; typedef pair<int, int> P; int main() { int N, K; cin >> N >> K; int ans = 1; int tmp = N; while (1) { if (tmp == 1) break; tmp /= K; ans++; } cout << ans << endl; return...
#include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < (n); i++) using namespace std; typedef long long ll; typedef pair<int, int> P; int main() { int N, K; cin >> N >> K; int ans = 1; int tmp = N; while (1) { if (tmp < K) break; tmp /= K; ans++; } cout << ans << endl; return ...
replace
12
13
12
13
TLE
p02767
C++
Runtime Error
#include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < (n); ++i) #define all(a) (a).begin(), (a).end() #define dunk(a) cout << (a) << endl using namespace std; typedef long long ll; int main() { int N; cin >> N; vector<int> X(N); rep(i, N) cin >> X[i]; vector<int> S(X[N - 1] - X[0] + 1); for (int...
#include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < (n); ++i) #define all(a) (a).begin(), (a).end() #define dunk(a) cout << (a) << endl using namespace std; typedef long long ll; int main() { int N; cin >> N; vector<int> X(N); rep(i, N) cin >> X[i]; sort(all(X)); vector<int> S(X[N - 1] - X[0] +...
insert
12
12
12
13
0
p02767
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); vector<int> cost(100); int camp; for (int i = 1; i < 101; i++) { for (int j = 0; j < n; j++) { camp = i; cost.at(i - 1) += (i - vec.at(j)) ...
#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); vector<int> cost(100); int camp; for (int i = 1; i < 101; i++) { for (int j = 0; j < n; j++) { camp = i; cost.at(i - 1) += (i - vec.at(j)) ...
replace
23
25
23
25
-6
terminate called after throwing an instance of 'std::out_of_range' what(): vector::_M_range_check: __n (which is 100) >= this->size() (which is 100)
p02767
C++
Time Limit Exceeded
#include <bits/stdc++.h> #define int long long #define fastio \ ios::sync_with_stdio(0); \ cin.tie(0); \ cout.tie(0) using namespac...
#include <bits/stdc++.h> #define int long long #define fastio \ ios::sync_with_stdio(0); \ cin.tie(0); \ cout.tie(0) using namespac...
replace
27
29
27
29
TLE
p02767
C++
Runtime Error
#include <algorithm> #include <iostream> #include <string> #include <vector> using namespace std; int main(void) { int n; cin >> n; int max_x = 0; vector<int> X; for (int i = 0; i < n; i++) { int x; cin >> x; if (max_x < x) { max_x = x; } X.push_back(x); } vector<long> HP; ...
#include <algorithm> #include <iostream> #include <string> #include <vector> using namespace std; int main(void) { int n; cin >> n; int max_x = 0; vector<int> X; for (int i = 0; i < n; i++) { int x; cin >> x; if (max_x < x) { max_x = x; } X.push_back(x); } vector<long> HP; ...
replace
26
27
26
27
0
p02767
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; int main() { int n; cin >> n; vector<int> x(n); for (int i = 0; i < n; i++) { cin >> x.at(i); } sort(x.begin(), x.end()); int ans = 1e8; for (int i = x.at(0); i <= x.at(n - 1); i++) { int sum = 0; for (int j = 0; j < n; j++) { sum += pow(x...
#include <bits/stdc++.h> using namespace std; int main() { int n; cin >> n; vector<int> x(n); for (int i = 0; i < n; i++) { cin >> x.at(i); } sort(x.begin(), x.end()); int ans = 1e8; for (int i = x.at(0); i <= x.at(n - 1); i++) { int sum = 0; for (int j = 0; j < n; j++) { sum += pow(x...
replace
15
16
15
16
-6
terminate called after throwing an instance of 'std::out_of_range' what(): vector::_M_range_check: __n (which is 2) >= this->size() (which is 2)
p02767
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; #define fast ios_base::sync_with_stdio(false), cin.tie(NULL), cout.tie(NULL) #define mod 1000000007 #define qmod 998244353 #define M 1000001 #define endl "\n" #define all(a) (a).begin(), (a).end() #define rep(i, a, b) for (int i = a; i < b; ++i) #define repr(i, a, b) for (...
#include <bits/stdc++.h> using namespace std; #define fast ios_base::sync_with_stdio(false), cin.tie(NULL), cout.tie(NULL) #define mod 1000000007 #define qmod 998244353 #define M 1000001 #define endl "\n" #define all(a) (a).begin(), (a).end() #define rep(i, a, b) for (int i = a; i < b; ++i) #define repr(i, a, b) for (...
replace
25
29
25
29
-11
p02767
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; int main() { int n; cin >> n; vector<int> a(n); for (int i = 0; i < n; i++) { cin >> a.at(i); } int un; if (n % 2 == 0) un = (a.at((n - 1) / 2 + 1) - a.at((n - 1) / 2)) / 2 + a.at((n - 1) / 2); else un = a.at(n - 1 / 2); long int ans = 0; fo...
#include <bits/stdc++.h> using namespace std; int main() { int n; cin >> n; vector<int> a(n); for (int i = 0; i < n; i++) { cin >> a.at(i); } int ans = 1000000; for (int i = 1; i < 101; i++) { int b = 0; for (int h = 0; h < n; h++) { b += pow(i - a.at(h), 2); } ans = min(ans, b)...
replace
10
18
10
17
0
p02767
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; #define ll long long #define MOD 1000000007 #define pb push_back #define mp make_pair #define mt make_tuple #define all(x) (x).begin(), (x).end() ll sqr(ll x) { return x * x; } int main() { #ifndef ONLINE_JUDGE freopen("input.txt", "r", stdin); freopen("output.txt",...
#include <bits/stdc++.h> using namespace std; #define ll long long #define MOD 1000000007 #define pb push_back #define mp make_pair #define mt make_tuple #define all(x) (x).begin(), (x).end() ll sqr(ll x) { return x * x; } int main() { // #ifndef ONLINE_JUDGE // freopen("input.txt", "r", stdin); // freopen(...
replace
14
18
14
18
0
p02767
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; int main() { int n; cin >> n; vector<int> x(n); for (int i = 0; i < n; i++) { cin >> x.at(i); } sort(x.begin(), x.end()); vector<int> sum(x.at(n)); for (int i = 0; i < x.at(n); i++) { for (int j = 0; j < n; j++) { sum.at(i) += pow((i + 1 - x.a...
#include <bits/stdc++.h> using namespace std; int main() { int n; cin >> n; vector<int> x(n); for (int i = 0; i < n; i++) { cin >> x.at(i); } sort(x.begin(), x.end()); int max = x.at(n - 1); vector<int> sum(max); for (int i = 0; i < max; i++) { for (int j = 0; j < n; j++) { sum.at(i) +=...
replace
11
13
11
14
-6
terminate called after throwing an instance of 'std::out_of_range' what(): vector::_M_range_check: __n (which is 2) >= this->size() (which is 2)
p02767
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; int main() { int N; vector<int> X(N); cin >> N; for (int i = 0; i < N; i++) cin >> X[i]; int ans = 1e+8; for (int i = 1; i <= 100; i++) { int sum = 0; for (int j = 0; j < N; j++) sum += (X[j] - i) * (X[j] - i); ans = min(ans, sum); } p...
#include <bits/stdc++.h> using namespace std; int main() { int N; int X[120]; cin >> N; for (int i = 0; i < N; i++) cin >> X[i]; int ans = 1e+8; for (int i = 1; i <= 100; i++) { int sum = 0; for (int j = 0; j < N; j++) sum += (X[j] - i) * (X[j] - i); ans = min(ans, sum); } printf(...
replace
5
6
5
6
-6
terminate called after throwing an instance of 'std::length_error' what(): cannot create std::vector larger than max_size()
p02767
C++
Time Limit Exceeded
#include <algorithm> #include <climits> #include <iostream> using namespace std; int main() { int n; int array[100005]; cin >> n; for (int i = 0; i < n; i++) { cin >> array[i]; } sort(array, array + n); int p = array[0]; int minimum = INT_MAX; while (p <= array[n - 1]) { int sum = 0; for ...
#include <algorithm> #include <climits> #include <iostream> using namespace std; int main() { int n; int array[100005]; cin >> n; for (int i = 0; i < n; i++) { cin >> array[i]; } sort(array, array + n); int p = array[0]; int minimum = INT_MAX; while (p <= array[n - 1]) { int sum = 0; for ...
insert
21
21
21
22
TLE
p02767
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; #define FIO ios_base::sync_with_stdio(false), cin.tie(0), cout.tie(0) #define DEBUG(x) cout << '>' << #x << ':' << x << endl; #define forn(i, n) for (int i = 0; i < (int)n; ++i) #define for1(i, n) for (int i = 1; i <= (int)n; ++i) #define forr(i, n) for (int i = (int)n - 1;...
#include <bits/stdc++.h> using namespace std; #define FIO ios_base::sync_with_stdio(false), cin.tie(0), cout.tie(0) #define DEBUG(x) cout << '>' << #x << ':' << x << endl; #define forn(i, n) for (int i = 0; i < (int)n; ++i) #define for1(i, n) for (int i = 1; i <= (int)n; ++i) #define forr(i, n) for (int i = (int)n - 1;...
replace
64
68
64
68
-8
p02767
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; #define endl "\n" // #define int long long const int N = 1005; const int MOD = 1e9 + 7; int main() { #ifndef ONLINE_JUDGE freopen("input.txt", "r", stdin); freopen("output.txt", "w", stdout); #endif ios_base::sync_with_stdio(false); cin.tie(NULL); /* stuff you s...
#include <bits/stdc++.h> using namespace std; #define endl "\n" // #define int long long const int N = 1005; const int MOD = 1e9 + 7; int main() { ios_base::sync_with_stdio(false); cin.tie(NULL); /* stuff you should look for * int overflow, array bounds * special cases (n=1?) * do smth instead of noth...
replace
9
13
9
10
0
p02767
C++
Runtime Error
#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<int> x(n); int sum = 0; int d_sum = 0; rep(i, n) { cin >> x.at(i); sum += x.at(i); d_sum += pow(x.at(i), 2); } int ans = 1000000; for (int i = 0; i < 100; i++...
#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<int> x(n); int sum = 0; int d_sum = 0; rep(i, n) { cin >> x.at(i); sum += x.at(i); d_sum += pow(x.at(i), 2); } int ans = 1000000; for (int i = 1; i <= 100; i+...
replace
16
18
16
18
-6
terminate called after throwing an instance of 'std::out_of_range' what(): vector::_M_range_check: __n (which is 2) >= this->size() (which is 2)
p02767
C++
Time Limit Exceeded
#include <bits/stdc++.h> using namespace std; int main() { int n, nu = 1e9; cin >> n; vector<int> x(n); for (int i = 0; i < n; i++) { cin >> x[i]; } for (int i = 1; i < 100; i++) { int hu = 0; for (int j = 0; j < n; i++) { hu += (x[j] - i) * (x[j] - i); } nu = min(nu, hu); } c...
#include <bits/stdc++.h> using namespace std; int main() { int n, nu = 1e9; cin >> n; vector<int> x(n); for (int i = 0; i < n; i++) { cin >> x[i]; } for (int i = 1; i < 100; i++) { int hu = 0; for (int j = 0; j < n; j++) { hu += (x[j] - i) * (x[j] - i); } nu = min(nu, hu); } c...
replace
12
13
12
13
TLE
p02767
C++
Runtime Error
#include <bits/stdc++.h> #define nl "\n" #define pb push_back #define sp " " typedef long long ll; #define len(x) x.length() #define vsort(x) sort(x.begin(), x.end(); using namespace std; ll inf = 2e18; int main() { ios::sync_with_stdio(false); cin.tie(0); freopen("bruh.txt", "r", stdin); int n; cin >> n; ...
#include <bits/stdc++.h> #define nl "\n" #define pb push_back #define sp " " typedef long long ll; #define len(x) x.length() #define vsort(x) sort(x.begin(), x.end(); using namespace std; ll inf = 2e18; int main() { ios::sync_with_stdio(false); cin.tie(0); // freopen("bruh.txt","r",stdin); int n; cin >> n;...
replace
16
17
16
17
-11
p02767
C++
Runtime Error
#include <algorithm> #include <cmath> #include <iostream> #include <vector> using namespace std; int main() { int n, sum; sum = 0; cin >> n; vector<int> x(n); for (int i = 0; i < n; i++) { cin >> x.at(i); } sort(x.begin(), x.end()); vector<int> s; for (int p = x[0]; p < x[n - 1]; p++) { for...
#include <algorithm> #include <cmath> #include <iostream> #include <vector> using namespace std; int main() { int n, sum; sum = 0; cin >> n; vector<int> x(n); for (int i = 0; i < n; i++) { cin >> x.at(i); } sort(x.begin(), x.end()); vector<int> s; for (int p = x[0]; p <= x[n - 1]; p++) { fo...
replace
18
19
18
19
0
p02767
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; typedef long long ll; int main() { #ifndef ONLINE_JUDGE freopen("input.txt", "r", stdin); freopen("output.txt", "w", stdout); #endif ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0); ll n = 0; cin >> n; vector<ll> v(n, 0); ll mn = 1e9 + 5; ll m...
#include <bits/stdc++.h> using namespace std; typedef long long ll; int main() { ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0); ll n = 0; cin >> n; vector<ll> v(n, 0); ll mn = 1e9 + 5; ll mx = -1e9 + 5; for (int i = 0; i < n; i++) { cin >> v[i]; mn = min(mn, v[i]); mx = max(mx,...
delete
6
11
6
6
0
p02767
Python
Runtime Error
N = int(input()) X_list = list(map(int, input().split())) hp_list = [] for p in range(int(min(X_list)), int(max(X_list))): hp = 0 for x in X_list: hp += abs(x - p) ** 2 hp_list.append(hp) print(min(hp_list))
N = int(input()) X_list = list(map(int, input().split())) hp_list = [] for p in range(int(min(X_list)), int(max(X_list))): hp = 0 for x in X_list: hp += abs(x - p) ** 2 hp_list.append(hp) print(min(hp_list) if len(hp_list) > 0 else 0)
replace
10
11
10
11
0
p02767
Python
Runtime Error
n = int(input()) x = list(map(int, input().split())) sum_list = [] start = min(x) stop = max(x) for i in range(start, stop): sum = 0 for j in x: sum += (i - j) ** 2 sum_list.append(sum) print(min(sum_list))
n = int(input()) x = list(map(int, input().split())) sum_list = [] start = min(x) stop = max(x) for i in range(1, 100): sum = 0 for j in x: sum += (i - j) ** 2 sum_list.append(sum) print(min(sum_list))
replace
6
7
6
7
0
p02767
Python
Runtime Error
n = int(input()) x = list(map(int, input().split())) sum_list = [] start = min(x) stop = max(x) for i in range(start, stop): sum = 0 for j in x: sum += (i - j) ** 2 sum_list.append(sum) print(min(sum_list))
n = int(input()) x = list(map(int, input().split())) sum_list = [] for i in range(1, 100): sum = 0 for j in x: sum += (i - j) ** 2 sum_list.append(sum) print(min(sum_list))
replace
4
7
4
5
0
p02767
Python
Runtime Error
N = int(input()) X = list(map(int, input().split())) minX = min(X) maxX = max(X) li = [] for i in range(minX, maxX): temp = 0 for j in range(N): temp += (X[j] - i) ** 2 li.append(temp) print(min(li))
N = int(input()) X = list(map(int, input().split())) minX = min(X) maxX = max(X) li = [] for i in range(100): temp = 0 for j in range(N): temp += (X[j] - i) ** 2 li.append(temp) print(min(li))
replace
6
7
6
7
0
p02767
Python
Runtime Error
import sys N = int(input()) X = [int(_) for _ in input().split()] ans_list = [] if N == 1: print("0") sys.exit() for i in range(min(X), max(X)): ans = 0 for j in X: ans += (j - i) ** 2 ans_list.append(ans) print(min(ans_list))
import sys N = int(input()) X = [int(_) for _ in input().split()] ans_list = [] if N == 1: print("0") sys.exit() for i in range(min(X), max(X) + 1): ans = 0 for j in X: ans += (j - i) ** 2 ans_list.append(ans) print(min(ans_list))
replace
8
9
8
9
0
p02767
Python
Runtime Error
N = int(input()) points = list(map(int, input().split(" "))) powers = [] for i in range(min(points), max(points)): power = 0 for point in points: power += (i - point) ** 2 powers.append(power) print(min(powers))
N = int(input()) points = list(map(int, input().split(" "))) powers = [] for i in range(min(points), max(points) + 1): power = 0 for point in points: power += (i - point) ** 2 powers.append(power) print(min(powers))
replace
4
5
4
5
0