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
p03003
C++
Time Limit Exceeded
#include <bits/stdc++.h> using namespace std; #define INF 1 << 30 #define endl '\n' #define maxn 2048 #define FASTIO ios_base::sync_with_stdio(false), cin.tie(0), cout.tie(0); typedef long long ll; typedef long double ld; const double PI = acos(-1.0); #define dbg(x) cerr << #x << " = " << x << endl; #define dbg2(x, y) ...
#include <bits/stdc++.h> using namespace std; #define INF 1 << 30 #define endl '\n' #define maxn 2048 #define FASTIO ios_base::sync_with_stdio(false), cin.tie(0), cout.tie(0); typedef long long ll; typedef long double ld; const double PI = acos(-1.0); #define dbg(x) cerr << #x << " = " << x << endl; #define dbg2(x, y) ...
replace
42
43
42
43
TLE
p03003
C++
Runtime Error
#include <algorithm> #include <bitset> #include <cstring> #include <ctype.h> #include <iomanip> #include <iostream> #include <iterator> #include <limits> #include <map> #include <math.h> #include <queue> #include <set> #include <stack> #include <string> #include <unordered_map> #include <unordered_set> #include <vector...
#include <algorithm> #include <bitset> #include <cstring> #include <ctype.h> #include <iomanip> #include <iostream> #include <iterator> #include <limits> #include <map> #include <math.h> #include <queue> #include <set> #include <stack> #include <string> #include <unordered_map> #include <unordered_set> #include <vector...
replace
246
248
246
248
0
p03003
C++
Runtime Error
#include <algorithm> #include <cmath> #include <ctime> #include <fstream> #include <iomanip> #include <iostream> #include <map> #include <queue> #include <sstream> #include <string> #include <vector> using namespace std; #define forn(I, N) for (int I = 0; I < (N); ++I) #define fornd(I, N) for (int I = (N)-1; I >= 0; ...
#include <algorithm> #include <cmath> #include <ctime> #include <fstream> #include <iomanip> #include <iostream> #include <map> #include <queue> #include <sstream> #include <string> #include <vector> using namespace std; #define forn(I, N) for (int I = 0; I < (N); ++I) #define fornd(I, N) for (int I = (N)-1; I >= 0; ...
replace
40
41
40
41
0
p03003
C++
Runtime Error
/*input 20 20 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 */ #include <bits/stdc++.h> using namespace std; #define TEMPLATE #ifdef TEMPLATE typedef long long ll; typedef long double ld; typedef complex<ld> cd; typedef pair<int, int> pi; typedef pair<ll, ll> pl; typedef pair<ld, ld>...
/*input 20 20 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 */ #include <bits/stdc++.h> using namespace std; #define TEMPLATE #ifdef TEMPLATE typedef long long ll; typedef long double ld; typedef complex<ld> cd; typedef pair<int, int> pi; typedef pair<ll, ll> pl; typedef pair<ld, ld>...
replace
105
106
105
106
0
p03003
C++
Runtime Error
#include <iostream> #include <map> #include <vector> using namespace std; constexpr int N_max = 2'000; constexpr int M_max = 2'000; constexpr int mod = 1'000'000'007; #ifdef _MSC_VER constexpr int debug = 1; #else constexpr int debug = 0; #endif // s-pos t-pos static int dp0[2'005][2'005]; static int dp1...
#include <iostream> #include <map> #include <vector> using namespace std; constexpr int N_max = 2'000; constexpr int M_max = 2'000; constexpr int mod = 1'000'000'007; #ifdef _MSC_VER constexpr int debug = 1; #else constexpr int debug = 0; #endif // s-pos t-pos static int dp0[2'005][2'005]; static int dp1...
replace
30
32
30
32
0
p03003
C++
Time Limit Exceeded
#pragma GCC optimize("O3") #pragma GCC target("tune=native") #pragma GCC target("avx") #include <bits/stdc++.h> // 汎用マクロ #define ALL_OF(x) (x).begin(), (x).end() #define REP(i, n) for (long long i = 0, i##_len = (n); i < i##_len; i++) #define RANGE(i, is, ie) \ ...
#pragma GCC optimize("O3") #pragma GCC target("tune=native") #pragma GCC target("avx") #include <bits/stdc++.h> // 汎用マクロ #define ALL_OF(x) (x).begin(), (x).end() #define REP(i, n) for (long long i = 0, i##_len = (n); i < i##_len; i++) #define RANGE(i, is, ie) \ ...
delete
86
89
86
86
TLE
p03003
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; typedef long long ll; const ll MOD = 1e9 + 7; ll N, M; vector<ll> S, T; vector<vector<ll>> Dp; int main() { cin >> N >> M; S.resize(N); for (ll i = 0; i < N; ++i) cin >> S[i]; T.resize(M); for (ll j = 0; j < M; ++j) cin >> T[j]; Dp.resize(N + 1); f...
#include <bits/stdc++.h> using namespace std; typedef long long ll; const ll MOD = 1e9 + 7; ll N, M; vector<ll> S, T; vector<vector<ll>> Dp; int main() { cin >> N >> M; S.resize(N); for (ll i = 0; i < N; ++i) cin >> S[i]; T.resize(M); for (ll j = 0; j < M; ++j) cin >> T[j]; Dp.resize(N + 1); f...
replace
24
25
24
25
0
p03003
C++
Runtime Error
#include <iostream> #include <vector> using namespace std; typedef long long ll; ll N, M; ll inf = 1e9 + 7; int main() { cin >> N >> M; vector<int> S(N + 1, 0), T(N + 1, 0); for (int i = 1; i <= N; i++) cin >> S[i]; for (int j = 1; j <= M; j++) cin >> T[j]; vector<vector<ll>> dp(N + 1, vector<ll>(M +...
#include <iostream> #include <vector> using namespace std; typedef long long ll; ll N, M; ll inf = 1e9 + 7; int main() { cin >> N >> M; vector<int> S(N + 1, 0), T(M + 1, 0); for (int i = 1; i <= N; i++) cin >> S[i]; for (int j = 1; j <= M; j++) cin >> T[j]; vector<vector<ll>> dp(N + 1, vector<ll>(M +...
replace
9
10
9
10
0
p03003
C++
Runtime Error
#include <bits/stdc++.h> #define lowbit(x) (x & (-x)) #define ll long long #define ull unsigned long long #define max(a, b) (a > b ? a : b) #define min(a, b) (a > b ? b : a) #define PI acos(-1.0) #define fir first #define sec second #define SZ(x) (x.size()) #define inf 0x3f3f3f3f #define PB push_back #define MP make_pa...
#include <bits/stdc++.h> #define lowbit(x) (x & (-x)) #define ll long long #define ull unsigned long long #define max(a, b) (a > b ? a : b) #define min(a, b) (a > b ? b : a) #define PI acos(-1.0) #define fir first #define sec second #define SZ(x) (x.size()) #define inf 0x3f3f3f3f #define PB push_back #define MP make_pa...
replace
101
102
101
102
0
p03003
C++
Runtime Error
#include <bits/stdc++.h> #define ll long long int #define ull unsigned long long #define ff first #define ss second #define fast \ ios_base::sync_with_stdio(false); \ cin.tie(0); ...
#include <bits/stdc++.h> #define ll long long int #define ull unsigned long long #define ff first #define ss second #define fast \ ios_base::sync_with_stdio(false); \ cin.tie(0); ...
delete
36
41
36
36
TLE
p03003
C++
Runtime Error
#include <algorithm> #include <bitset> #include <cmath> #include <cstring> #include <functional> #include <iomanip> #include <iostream> #include <iterator> #include <map> #include <numeric> #include <queue> #include <set> #include <stack> #include <string> #include <tuple> #include <utility> #include <vector> using nam...
#include <algorithm> #include <bitset> #include <cmath> #include <cstring> #include <functional> #include <iomanip> #include <iostream> #include <iterator> #include <map> #include <numeric> #include <queue> #include <set> #include <stack> #include <string> #include <tuple> #include <utility> #include <vector> using nam...
replace
20
22
20
22
0
p03003
C++
Runtime Error
#include <iostream> using namespace std; const int MOD = 1000000007; int main() { int N, M, S[2000], T[2000]; int dp[200][200] = {0}; cin >> N >> M; for (int i = 0; i < N; i++) cin >> S[i]; for (int i = 0; i < M; i++) cin >> T[i]; dp[0][0] = S[0] == T[0]; for (int i = 1; i < N; i++) dp[i][0] =...
#include <iostream> using namespace std; const int MOD = 1000000007; int main() { int N, M, S[2000], T[2000]; int dp[2000][2000] = {0}; cin >> N >> M; for (int i = 0; i < N; i++) cin >> S[i]; for (int i = 0; i < M; i++) cin >> T[i]; dp[0][0] = S[0] == T[0]; for (int i = 1; i < N; i++) dp[i][0]...
replace
5
6
5
6
0
p03003
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; using ll = long long; using Pi = pair<int, int>; using Pl = pair<ll, ll>; using vint = vector<int>; using vvint = vector<vint>; using vvvint = vector<vvint>; using vdouble = vector<double>; using vvdouble = vector<vdouble>; using vvvdouble = vector<vvdouble>; using vll = v...
#include <bits/stdc++.h> using namespace std; using ll = long long; using Pi = pair<int, int>; using Pl = pair<ll, ll>; using vint = vector<int>; using vvint = vector<vint>; using vvvint = vector<vvint>; using vdouble = vector<double>; using vvdouble = vector<vdouble>; using vvvdouble = vector<vvdouble>; using vll = v...
replace
72
75
72
78
-6
munmap_chunk(): invalid pointer
p03003
C++
Time Limit Exceeded
#include <bits/stdc++.h> using namespace std; #define ll long long #define REP(i, m, n) for (int i = (int)(m); i < (int)(n); i++) #define rep(i, n) REP(i, 0, n) #define RREP(i, m, n) for (int i = (int)(m); i >= (int)(n); i--) #define rrep(i, n) RREP(i, n - 1, 0) #define all(v) v.begin(), v.end() const int inf = 1e9 + 7...
#include <bits/stdc++.h> using namespace std; #define ll long long #define REP(i, m, n) for (int i = (int)(m); i < (int)(n); i++) #define rep(i, n) REP(i, 0, n) #define RREP(i, m, n) for (int i = (int)(m); i >= (int)(n); i--) #define rrep(i, n) RREP(i, n - 1, 0) #define all(v) v.begin(), v.end() const int inf = 1e9 + 7...
replace
30
32
30
40
TLE
p03003
C++
Runtime Error
#include <bits/stdc++.h> #define mod 1000000007 #define mod998 998244353 #define sp ' ' #define intmax 2147483647 #define llmax 9223372036854775807 #define mkp make_pair typedef long long ll; using namespace std; int N, M, S[200], T[200], DP[201][201], s[201][201]; int main() { cin >> N >> M; for (int i = 0; i < ...
#include <bits/stdc++.h> #define mod 1000000007 #define mod998 998244353 #define sp ' ' #define intmax 2147483647 #define llmax 9223372036854775807 #define mkp make_pair typedef long long ll; using namespace std; int N, M, S[2000], T[2000], DP[2001][2001], s[2001][2001]; int main() { cin >> N >> M; for (int i = 0...
replace
10
11
10
11
0
p03003
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; using ll = long long; typedef pair<int, int> P; ll Mod = 1000000007; int main() { int N, M; cin >> N >> M; int S[N]; int T[M]; for (int i = 0; i < N; i++) cin >> S[i]; for (int i = 0; i < M; i++) cin >> T[i]; ll DP[N + 1][M + 1]; vector<ll> sum(N + ...
#include <bits/stdc++.h> using namespace std; using ll = long long; typedef pair<int, int> P; ll Mod = 1000000007; int main() { int N, M; cin >> N >> M; int S[N]; int T[M]; for (int i = 0; i < N; i++) cin >> S[i]; for (int i = 0; i < M; i++) cin >> T[i]; ll DP[N + 1][M + 1]; vector<ll> sum(M + ...
replace
16
17
16
17
0
p03003
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; #define LL long long #define lowbit(x) ((x) & -(x)) const int maxn = (int)1e5 + 20; const int MOD = 1e9 + 7; LL fp(LL a, LL n, LL m = MOD) { LL res = 1; for (; n; n >>= 1, a = a * a % m) if (n & 1) res = res * a % m; return res; } int n, m; int s[1111], ...
#include <bits/stdc++.h> using namespace std; #define LL long long #define lowbit(x) ((x) & -(x)) const int maxn = (int)1e5 + 20; const int MOD = 1e9 + 7; LL fp(LL a, LL n, LL m = MOD) { LL res = 1; for (; n; n >>= 1, a = a * a % m) if (n & 1) res = res * a % m; return res; } int n, m; int s[3333], ...
replace
18
20
18
20
0
p03003
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; #define _for(i, j, N) for (int i = (j); i < (N); i++) #define _rep(i, j, N) for (int i = (j); i <= (N); i++) #define ALL(x) x.begin(), x.end() #define pb push_back #define mk make_pair typedef long long LL; typedef pair<int, int> Interval; template <typename T> ostream ...
#include <bits/stdc++.h> using namespace std; #define _for(i, j, N) for (int i = (j); i < (N); i++) #define _rep(i, j, N) for (int i = (j); i <= (N); i++) #define ALL(x) x.begin(), x.end() #define pb push_back #define mk make_pair typedef long long LL; typedef pair<int, int> Interval; template <typename T> ostream ...
replace
32
33
32
33
0
p03003
C++
Runtime Error
#include <bits/stdc++.h> #define rep(i, m) for (long long i = 0; i < m; i++) #define per(i, m) for (long long i = m - 1; i >= 0; i--) #define FOR(i, n, m) for (long long i = n; i < m; i++) #define ROF(i, n, m) for (long long i = m - 1; i >= n; i--) #define SORT(v, n) ...
#include <bits/stdc++.h> #define rep(i, m) for (long long i = 0; i < m; i++) #define per(i, m) for (long long i = m - 1; i >= 0; i--) #define FOR(i, n, m) for (long long i = n; i < m; i++) #define ROF(i, n, m) for (long long i = m - 1; i >= n; i--) #define SORT(v, n) ...
replace
172
173
172
173
0
p03003
C++
Runtime Error
#include <algorithm> #include <bitset> #include <cassert> #include <climits> #include <cmath> #include <cstdio> #include <cstring> #include <ctime> #include <deque> #include <fstream> #include <functional> #include <iostream> #include <list> #include <map> #include <numeric> #include <queue> #include <set> #include <ss...
#include <algorithm> #include <bitset> #include <cassert> #include <climits> #include <cmath> #include <cstdio> #include <cstring> #include <ctime> #include <deque> #include <fstream> #include <functional> #include <iostream> #include <list> #include <map> #include <numeric> #include <queue> #include <set> #include <ss...
replace
57
58
57
59
0
p03004
C++
Time Limit Exceeded
#include <bits/stdc++.h> using namespace std::literals::string_literals; using i64 = long long; using std::cin; using std::cout; using std::endl; template <typename T> std::vector<T> make_v(size_t a) { return std::vector<T>(a); } template <typename T, typename... Ts> auto make_v(size_t a, Ts... ts) { return std::...
#include <bits/stdc++.h> using namespace std::literals::string_literals; using i64 = long long; using std::cin; using std::cout; using std::endl; template <typename T> std::vector<T> make_v(size_t a) { return std::vector<T>(a); } template <typename T, typename... Ts> auto make_v(size_t a, Ts... ts) { return std::...
replace
117
118
117
118
TLE
p03004
C++
Time Limit Exceeded
#pragma GCC optimize("O3", "unroll-loops") #include <bits/stdc++.h> using namespace std; const int maxn = 1e5 + 10; pair<double, double> a[maxn]; double dx[maxn], dy[maxn], ans, lb = 0, lbb, rbb, rb = 2e8; int n; char c; double calc(double t) { double u, d, l, r; l = r = a[0].first + t * dx[0], u = d = a[0].sec...
#pragma GCC optimize("O3", "unroll-loops") #include <bits/stdc++.h> using namespace std; const int maxn = 1e5 + 10; pair<double, double> a[maxn]; double dx[maxn], dy[maxn], ans, lb = 0, lbb, rbb, rb = 2e8; int n; char c; double calc(double t) { double u, d, l, r; l = r = a[0].first + t * dx[0], u = d = a[0].sec...
replace
40
41
40
41
TLE
p03004
C++
Time Limit Exceeded
#include <algorithm> #include <cmath> #include <cstdlib> #include <iomanip> #include <iostream> #include <map> #include <queue> #include <set> #include <stack> #include <string> #include <utility> #include <vector> using namespace std; #define REP(i, n) for (ll i = 0; i < n; i++) #define REPR(i, n) for (ll i = n; i >...
#include <algorithm> #include <cmath> #include <cstdlib> #include <iomanip> #include <iostream> #include <map> #include <queue> #include <set> #include <stack> #include <string> #include <utility> #include <vector> using namespace std; #define REP(i, n) for (ll i = 0; i < n; i++) #define REPR(i, n) for (ll i = n; i >...
replace
58
59
58
59
TLE
p03004
C++
Time Limit Exceeded
#include <bits/stdc++.h> using namespace std; using Int = int_fast64_t; Int n; typedef pair<Int, Int> P; vector<P> x, y; constexpr double EPS = 1e-14; double func(double t) { double xmi = 1e10, ymi = 1e10, xma = -1e10, yma = -1e10; for (Int i = 0; i < n; ++i) { xmi = min(xmi, x[i].first + t * x[i].second); ...
#include <bits/stdc++.h> using namespace std; using Int = int_fast64_t; Int n; typedef pair<Int, Int> P; vector<P> x, y; constexpr double EPS = 1e-14; double func(double t) { double xmi = 1e10, ymi = 1e10, xma = -1e10, yma = -1e10; for (Int i = 0; i < n; ++i) { xmi = min(xmi, x[i].first + t * x[i].second); ...
replace
37
38
37
38
TLE
p03004
C++
Time Limit Exceeded
#include <bits/stdc++.h> #ifdef LOCAL_DEBUG #define DEBUG 1 #define CERR \ if (DEBUG) \ cerr #define MACRO(_1, _2, _3, _4, _5, _6, _7, _8, _9, _10, NAME, ...) NAME #define pr(...) ...
#include <bits/stdc++.h> #ifdef LOCAL_DEBUG #define DEBUG 1 #define CERR \ if (DEBUG) \ cerr #define MACRO(_1, _2, _3, _4, _5, _6, _7, _8, _9, _10, NAME, ...) NAME #define pr(...) ...
replace
157
158
157
158
TLE
p03004
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; typedef signed long long ll; #undef _P #define _P(...) (void)printf(__VA_ARGS__) #define FOR(x, to) for (x = 0; x < (to); x++) #define FORR(x, arr) for (auto &x : arr) #define ITR(x, c) for (__typeof(c.begin()) x = c.begin(); x != c.end(); x++) #define ALL(a) (a.begin()), ...
#include <bits/stdc++.h> using namespace std; typedef signed long long ll; #undef _P #define _P(...) (void)printf(__VA_ARGS__) #define FOR(x, to) for (x = 0; x < (to); x++) #define FORR(x, arr) for (auto &x : arr) #define ITR(x, c) for (__typeof(c.begin()) x = c.begin(); x != c.end(); x++) #define ALL(a) (a.begin()), ...
replace
110
111
110
111
-11
p03004
C++
Time Limit Exceeded
#include <bits/stdc++.h> using namespace std; const int N = 1e5 + 5; const double inf = 1e18; double x[N], y[N]; double dx[N], dy[N]; int n; double f(double a) { double minx = inf, maxx = -inf, miny = inf, maxy = -inf; for (int i = 0; i < n; i++) { // n个点 double nx = x[i] + a * dx[i]; double ny = y[i] + a...
#include <bits/stdc++.h> using namespace std; const int N = 1e5 + 5; const double inf = 1e18; double x[N], y[N]; double dx[N], dy[N]; int n; double f(double a) { double minx = inf, maxx = -inf, miny = inf, maxy = -inf; for (int i = 0; i < n; i++) { // n个点 double nx = x[i] + a * dx[i]; double ny = y[i] + a...
replace
24
25
24
26
TLE
p03004
C++
Time Limit Exceeded
#include <algorithm> #include <bitset> #include <cfloat> #include <deque> #include <fstream> #include <functional> #include <iomanip> #include <iostream> #include <limits.h> #include <list> #include <map> #include <math.h> #include <queue> #include <random> #include <set> #include <stack> #include <string.h> #include <...
#include <algorithm> #include <bitset> #include <cfloat> #include <deque> #include <fstream> #include <functional> #include <iomanip> #include <iostream> #include <limits.h> #include <list> #include <map> #include <math.h> #include <queue> #include <random> #include <set> #include <stack> #include <string.h> #include <...
replace
68
69
68
69
TLE
p03004
C++
Time Limit Exceeded
#include <bits/stdc++.h> #if MYDEBUG #include "lib/cp_debug.hpp" #else #define DBG(...) ; #endif #if __cplusplus <= 201402L template <typename T> T gcd(T a, T b) { return ((a % b == 0) ? b : gcd(b, a % b)); } template <typename T> T lcm(T a, T b) { return a / gcd(a, b) * b; } #endif using LL = long long; constexpr L...
#include <bits/stdc++.h> #if MYDEBUG #include "lib/cp_debug.hpp" #else #define DBG(...) ; #endif #if __cplusplus <= 201402L template <typename T> T gcd(T a, T b) { return ((a % b == 0) ? b : gcd(b, a % b)); } template <typename T> T lcm(T a, T b) { return a / gcd(a, b) * b; } #endif using LL = long long; constexpr L...
replace
86
87
86
87
TLE
p03004
C++
Time Limit Exceeded
#include <bits/stdc++.h> using namespace std; #define ll long long struct Point { double x, y; int dx, dy; }; double simulate(vector<Point> points, double t) { double maxX = -1e18, maxY = -1e18, minX = 1e18, minY = 1e18; for (int i = 0; i < points.size(); ++i) { points[i].x += points[i].dx * t; points[i...
#include <bits/stdc++.h> using namespace std; #define ll long long struct Point { double x, y; int dx, dy; }; double simulate(vector<Point> points, double t) { double maxX = -1e18, maxY = -1e18, minX = 1e18, minY = 1e18; for (int i = 0; i < points.size(); ++i) { points[i].x += points[i].dx * t; points[i...
replace
38
39
38
39
TLE
p03004
C++
Time Limit Exceeded
#define LOCAL #include "bits/stdc++.h" using namespace std; #define FAST \ ios_base::sync_with_stdio(false); \ cin.tie(0); #define LLINF ((long long)1e15) // 1234567890987654321 #define INF 1234567890ll #def...
#define LOCAL #include "bits/stdc++.h" using namespace std; #define FAST \ ios_base::sync_with_stdio(false); \ cin.tie(0); #define LLINF ((long long)1e15) // 1234567890987654321 #define INF 1234567890ll #def...
replace
83
84
83
84
TLE
p03004
C++
Time Limit Exceeded
/*** Template Begin ***/ #pragma region template #define USING_NAMESPACE #include <algorithm> #include <array> #include <bitset> #include <cassert> #include <cmath> #include <complex> #include <cstdio> #include <cstdlib> #include <deque> #include <functional> #include <iomanip> #include <iostream> #include <list> #i...
/*** Template Begin ***/ #pragma region template #define USING_NAMESPACE #include <algorithm> #include <array> #include <bitset> #include <cassert> #include <cmath> #include <complex> #include <cstdio> #include <cstdlib> #include <deque> #include <functional> #include <iomanip> #include <iostream> #include <list> #i...
replace
262
268
262
267
TLE
p03004
C++
Time Limit Exceeded
#include <algorithm> #include <assert.h> #include <bitset> #include <cmath> #include <cstdio> #include <cstring> #include <functional> #include <iostream> #include <map> #include <numeric> #include <queue> #include <random> #include <set> #include <sstream> #include <stack> #include <string> #include <typeinfo> #includ...
#include <algorithm> #include <assert.h> #include <bitset> #include <cmath> #include <cstdio> #include <cstring> #include <functional> #include <iostream> #include <map> #include <numeric> #include <queue> #include <random> #include <set> #include <sstream> #include <stack> #include <string> #include <typeinfo> #includ...
replace
66
68
66
68
TLE
p03004
C++
Time Limit Exceeded
#include <bits/stdc++.h> #define _overload(_1, _2, _3, name, ...) name #define _rep(i, n) _range(i, 0, n) #define _range(i, a, b) for (int i = (int)(a); i < (int)(b); ++i) #define rep(...) _overload(__VA_ARGS__, _range, _rep, )(__VA_ARGS__) #define _rrep(i, n) _rrange(i, n, 0) #define _rrange(i, a, b) for (int i = (i...
#include <bits/stdc++.h> #define _overload(_1, _2, _3, name, ...) name #define _rep(i, n) _range(i, 0, n) #define _range(i, a, b) for (int i = (int)(a); i < (int)(b); ++i) #define rep(...) _overload(__VA_ARGS__, _range, _rep, )(__VA_ARGS__) #define _rrep(i, n) _rrange(i, n, 0) #define _rrange(i, a, b) for (int i = (i...
replace
84
85
84
85
TLE
p03004
C++
Time Limit Exceeded
#include <bits/stdc++.h> using namespace std; const int mod = 1e9 + 7, N = 1e5 + 5; int mul(int a, int b) { return (long long)a * b; } typedef long long ll; int n, x[N], y[N], d[N]; const double inf = 1e20; double getans(double mid) { double mnx = inf, mxx = -inf, mny = inf, mxy = -inf; for (int i = 1; i <= n; i++)...
#include <bits/stdc++.h> using namespace std; const int mod = 1e9 + 7, N = 1e5 + 5; int mul(int a, int b) { return (long long)a * b; } typedef long long ll; int n, x[N], y[N], d[N]; const double inf = 1e20; double getans(double mid) { double mnx = inf, mxx = -inf, mny = inf, mxy = -inf; for (int i = 1; i <= n; i++)...
replace
41
43
41
43
TLE
p03004
C++
Time Limit Exceeded
#include <bits/stdc++.h> #define For(i, a, b) for (int(i) = (a); (i) < (b); ++(i)) #define rFor(i, a, b) for (int(i) = (a)-1; (i) >= (b); --(i)) #define rep(i, n) For((i), 0, (n)) #define rrep(i, n) rFor((i), (n), 0) #define fi first #define se second using namespace std; typedef long long lint; typedef pair<int, int> ...
#include <bits/stdc++.h> #define For(i, a, b) for (int(i) = (a); (i) < (b); ++(i)) #define rFor(i, a, b) for (int(i) = (a)-1; (i) >= (b); --(i)) #define rep(i, n) For((i), 0, (n)) #define rrep(i, n) rFor((i), (n), 0) #define fi first #define se second using namespace std; typedef long long lint; typedef pair<int, int> ...
replace
41
42
41
42
TLE
p03004
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; #define MAX 1e8 class V { public: vector<double> l; vector<double> r; V() { l = vector<double>(3, MAX); r = vector<double>(3, -MAX); } void add(double x, int d) { d++; l[d] = min(l[d], x); r[d] = max(r[d], x); } vector<double> intersecti...
#include <bits/stdc++.h> using namespace std; #define MAX 1e8 class V { public: vector<double> l; vector<double> r; V() { l = vector<double>(3, MAX); r = vector<double>(3, -MAX); } void add(double x, int d) { d++; l[d] = min(l[d], x); r[d] = max(r[d], x); } vector<double> intersecti...
replace
148
149
148
149
0
p03004
C++
Time Limit Exceeded
#include <algorithm> #include <cmath> #include <cstdio> typedef long double llf; const int MN = 1e5 + 4; const llf INF = 1e100, EPS = 7e-12, GR = (1 + sqrt(5)) / 2.0; int N; llf ans = INF; struct pnt { llf x, y; llf ox, oy; char c; } pnts[MN]; static inline void mov(pnt &p, llf dt) { switch (p.c) { case 'R': ...
#include <algorithm> #include <cmath> #include <cstdio> typedef long double llf; const int MN = 1e5 + 4; const llf INF = 1e100, EPS = 7e-12, GR = (1 + sqrt(5)) / 2.0; int N; llf ans = INF; struct pnt { llf x, y; llf ox, oy; char c; } pnts[MN]; static inline void mov(pnt &p, llf dt) { switch (p.c) { case 'R': ...
replace
50
51
50
51
TLE
p03004
C++
Time Limit Exceeded
#include <algorithm> #include <cmath> #include <cstdlib> #include <cstring> #include <functional> #include <iomanip> #include <iostream> #include <map> #include <numeric> #include <queue> #include <set> #include <sstream> #include <stack> #include <string> #include <utility> #include <vector> #define BEGIN(x) x.begin(...
#include <algorithm> #include <cmath> #include <cstdlib> #include <cstring> #include <functional> #include <iomanip> #include <iostream> #include <map> #include <numeric> #include <queue> #include <set> #include <sstream> #include <stack> #include <string> #include <utility> #include <vector> #define BEGIN(x) x.begin(...
replace
80
81
80
82
TLE
p03004
C++
Time Limit Exceeded
#include <bits/stdc++.h> using namespace std; using ll = long long; using ld = long double; using VI = vector<int>; using VL = vector<ll>; template <class T> using PQ = priority_queue<T, vector<T>, greater<T>>; #define FOR(i, a, n) for (int(i) = (a); (i) < (n); ++(i)) #define eFOR(i, a, n) for (int(i) = (a); (i) <= (n)...
#include <bits/stdc++.h> using namespace std; using ll = long long; using ld = long double; using VI = vector<int>; using VL = vector<ll>; template <class T> using PQ = priority_queue<T, vector<T>, greater<T>>; #define FOR(i, a, n) for (int(i) = (a); (i) < (n); ++(i)) #define eFOR(i, a, n) for (int(i) = (a); (i) <= (n)...
replace
91
92
91
92
TLE
p03005
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; #define FAST \ ios_base::sync_with_stdio(false); \ cin.tie(NULL); #define ll long long int #define ull unsigned long long int #define ld long double #define mod ...
#include <bits/stdc++.h> using namespace std; #define FAST \ ios_base::sync_with_stdio(false); \ cin.tie(NULL); #define ll long long int #define ull unsigned long long int #define ld long double #define mod ...
replace
31
37
31
32
0
p03005
C++
Runtime Error
#include <iostream> using namespace std; int main() { int N, K; cin >> N >> K; if (K == 1) { cout << 0 << endl; return 0; } return N - K; }
#include <iostream> using namespace std; int main() { int N, K; cin >> N >> K; if (K == 1) { cout << 0 << endl; return 0; } cout << N - K << endl; }
replace
14
15
14
15
1
p03005
C++
Runtime Error
#pragma comment(linker, "/stack:247474112") #pragma GCC optimize("Ofast") #include <bits/stdc++.h> using namespace std; #define IOS ios::sync_with_stdio(0), cin.tie(0), cout.tie(0) #define int long long #define ends ' ' #define endl '\n' #define pb push_back #define x first #define y second #define pii pair<int, int> ...
#pragma comment(linker, "/stack:247474112") #pragma GCC optimize("Ofast") #include <bits/stdc++.h> using namespace std; #define IOS ios::sync_with_stdio(0), cin.tie(0), cout.tie(0) #define int long long #define ends ' ' #define endl '\n' #define pb push_back #define x first #define y second #define pii pair<int, int> ...
delete
14
18
14
14
0
p03005
C++
Runtime Error
#include <bits/stdc++.h> #define ForA(i, b, a) for (int i = a; i >= b; i--) #define ForB(i, a, b) for (int i = a; i <= b; i++) #define IOS \ ios ::sync_with_stdio(false); \ cin.tie(0); ...
#include <bits/stdc++.h> #define ForA(i, b, a) for (int i = a; i >= b; i--) #define ForB(i, a, b) for (int i = a; i <= b; i++) #define IOS \ ios ::sync_with_stdio(false); \ cin.tie(0); ...
replace
50
53
50
53
0
p03005
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; #define REP(i, n) for (int i = 0, i##_len = (n); i < i##_len; ++i) #define INF 2000000007 #define MOD 10e9 + 7 #define MAX 100005 typedef unsigned int uint; typedef unsigned long long int ull; typedef long long int ll; int main() { int N, K; cin >> N >> K; if (K...
#include <bits/stdc++.h> using namespace std; #define REP(i, n) for (int i = 0, i##_len = (n); i < i##_len; ++i) #define INF 2000000007 #define MOD 10e9 + 7 #define MAX 100005 typedef unsigned int uint; typedef unsigned long long int ull; typedef long long int ll; int main() { int N, K; cin >> N >> K; if (K...
replace
19
20
19
20
0
p03006
Python
Runtime Error
import sys from collections import Counter N = int(input()) points = [] for i, line in enumerate(sys.stdin): x, y = map(int, line.split()) points.append([x, y]) if i == N - 1: break counts = [] for i in range(N): for j in range(N): if i == j: continue p = points[j][...
import sys from collections import Counter N = int(input()) points = [] for i, line in enumerate(sys.stdin): x, y = map(int, line.split()) points.append([x, y]) if i == N - 1: break if len(points) == 1: print(1) sys.exit(0) counts = [] for i in range(N): for j in range(N): if i...
insert
10
10
10
13
0
p03006
C++
Runtime Error
#include <algorithm> #include <bitset> #include <cmath> #include <cstring> #include <iomanip> #include <iostream> #include <map> #include <numeric> #include <queue> #include <regex> #include <set> #include <stack> #include <string> #include <vector> const int MOD = 1e9 + 7; const int iINF = 2147483647 / 2; const long ...
#include <algorithm> #include <bitset> #include <cmath> #include <cstring> #include <iomanip> #include <iostream> #include <map> #include <numeric> #include <queue> #include <regex> #include <set> #include <stack> #include <string> #include <vector> const int MOD = 1e9 + 7; const int iINF = 2147483647 / 2; const long ...
replace
103
107
103
106
0
p03006
C++
Time Limit Exceeded
#include <algorithm> #include <array> #include <bitset> #include <cassert> #include <cmath> #include <complex> #include <cstdio> #include <cstdlib> #include <cstring> #include <ctime> #include <deque> #include <functional> #include <iomanip> #include <iostream> #include <limits> #include <list> #include <map> #include ...
#include <algorithm> #include <array> #include <bitset> #include <cassert> #include <cmath> #include <complex> #include <cstdio> #include <cstdlib> #include <cstring> #include <ctime> #include <deque> #include <functional> #include <iomanip> #include <iostream> #include <limits> #include <list> #include <map> #include ...
replace
61
74
61
62
TLE
p03006
C++
Runtime Error
#include <bits/stdc++.h> #define il inline #define pb push_back #define mp make_pair #define fir first #define sec second #define mid ((l + r) >> 1) #define MAXN 1050 #define MAXM #define mod #define inf (1 << 30) #define eps (1e-6) #define alpha 0.75 #define rep(i, x, y) for (register int i = x; i <= y; ++i) #define r...
#include <bits/stdc++.h> #define il inline #define pb push_back #define mp make_pair #define fir first #define sec second #define mid ((l + r) >> 1) #define MAXN 3050 #define MAXM #define mod #define inf (1 << 30) #define eps (1e-6) #define alpha 0.75 #define rep(i, x, y) for (register int i = x; i <= y; ++i) #define r...
replace
7
8
7
8
0
p03006
C++
Runtime Error
#include <algorithm> #include <cmath> #include <complex> #include <cstdio> #include <cstdlib> #include <cstring> #include <deque> #include <functional> #include <iostream> #include <list> #include <map> #include <numeric> #include <queue> #include <set> #include <stack> #include <string> #include <utility> #include <ve...
#include <algorithm> #include <cmath> #include <complex> #include <cstdio> #include <cstdlib> #include <cstring> #include <deque> #include <functional> #include <iostream> #include <list> #include <map> #include <numeric> #include <queue> #include <set> #include <stack> #include <string> #include <utility> #include <ve...
insert
47
47
47
51
0
p03006
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; #define vi vector<int> #define vl vector<long long> #define pb push_back #define ll long long #define all(v) v.begin(), v.end() #define si set<int> #define sl set<long long> #define pair(x, y) pair<x, y> #define frt(i, a, b) for (int i = a; i < b; i++) #define fre(i, a,...
#include <bits/stdc++.h> using namespace std; #define vi vector<int> #define vl vector<long long> #define pb push_back #define ll long long #define all(v) v.begin(), v.end() #define si set<int> #define sl set<long long> #define pair(x, y) pair<x, y> #define frt(i, a, b) for (int i = a; i < b; i++) #define fre(i, a,...
replace
55
56
55
59
0
p03006
C++
Runtime Error
// https://atcoder.jp/contests/ #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 INF 1e9 #define ALL(v) (v).begin(), (v).end() using namespace std; using ll = long long; u...
// https://atcoder.jp/contests/ #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 INF 1e9 #define ALL(v) (v).begin(), (v).end() using namespace std; using ll = long long; u...
replace
47
48
47
48
0
p03006
Python
Runtime Error
N = int(input()) inputs = [[int(i) for i in input().split()] for _ in range(N)] ans = 1 rates = {} for i in range(N): for j in range(N): if i == j: continue vector = (inputs[i][0] - inputs[j][0], inputs[i][1] - inputs[j][1]) rates[vector] = rates.get(vector, 0) + 1 print(N - ma...
N = int(input()) inputs = [[int(i) for i in input().split()] for _ in range(N)] ans = 1 rates = {0: 0} for i in range(N): for j in range(N): if i == j: continue vector = (inputs[i][0] - inputs[j][0], inputs[i][1] - inputs[j][1]) rates[vector] = rates.get(vector, 0) + 1 print(N ...
replace
4
5
4
5
0
p03006
C++
Time Limit Exceeded
#include <algorithm> // sort #include <cstring> #include <fstream> #include <iostream> #include <map> #include <vector> #define REP(i, n) for (long long i = 0; i < (n); i++) typedef long long ll; static const ll MOD = 1000000007; static const ll INF = 1000000000000000000LL; using namespace std; int main() { int N; ...
#include <algorithm> // sort #include <cstring> #include <fstream> #include <iostream> #include <map> #include <vector> #define REP(i, n) for (long long i = 0; i < (n); i++) typedef long long ll; static const ll MOD = 1000000007; static const ll INF = 1000000000000000000LL; using namespace std; int main() { int N; ...
replace
38
40
38
40
TLE
p03006
Python
Runtime Error
from collections import Counter N = int(input()) xys = [] for _ in range(N): xys.append(tuple(map(int, input().split()))) sub = [] for x1, y1 in xys: for x2, y2 in xys: if x1 != x2 or y1 != y2: sub.append((x1 - x2, y1 - y2)) c = Counter(sub) m = max(c.values()) print(N - m)
from collections import Counter N = int(input()) xys = [] for _ in range(N): xys.append(tuple(map(int, input().split()))) sub = [] for x1, y1 in xys: for x2, y2 in xys: if x1 != x2 or y1 != y2: sub.append((x1 - x2, y1 - y2)) if not sub: print(1) exit(0) c = Counter(sub) m = max(...
insert
14
14
14
18
0
p03006
Python
Runtime Error
import collections N = int(input()) x_y = [] for _ in range(N): x_y.append(list(map(int, input().split()))) x_y.sort(key=lambda x: (x[0], x[1])) pq_cand = [] for i in range(N): for j in range(i + 1, N): pq_cand.append((x_y[j][0] - x_y[i][0], x_y[j][1] - x_y[i][1])) pqc = collections.Counter(pq_cand) ...
import collections N = int(input()) if N == 1: print(1) exit() x_y = [] for _ in range(N): x_y.append(list(map(int, input().split()))) x_y.sort(key=lambda x: (x[0], x[1])) pq_cand = [] for i in range(N): for j in range(i + 1, N): pq_cand.append((x_y[j][0] - x_y[i][0], x_y[j][1] - x_y[i][1]))...
insert
3
3
3
8
0
p03006
Python
Runtime Error
from collections import Counter from itertools import permutations N = int(input()) x, y = zip(*(map(int, input().split()) for _ in range(N))) if N else ((), ()) # (p, q) = (x_i - x_j, y_i - y_j) を満たす組(i, j)の個数が最大となるように # p, qを定めればよい D = Counter((x[i] - x[j], y[i] - y[j]) for i, j in permutations(range(N), 2)) ans = ...
from collections import Counter from itertools import permutations N = int(input()) x, y = zip(*(map(int, input().split()) for _ in range(N))) if N else ((), ()) # (p, q) = (x_i - x_j, y_i - y_j) を満たす組(i, j)の個数が最大となるように # p, qを定めればよい ans = ( 1 if N == 1 else N - max( Counter( (x[i]...
replace
8
10
8
18
0
p03006
Python
Runtime Error
from collections import Counter N = int(input()) p = [] for _ in range(N): p.append(tuple(map(int, input().split()))) d = [] for i, p1 in enumerate(p): for j, p2 in enumerate(p): if i == j: continue x = p1[0] - p2[0] y = p1[1] - p2[1] d.append((x, y)) c = Counter(...
from collections import Counter N = int(input()) p = [] for _ in range(N): p.append(tuple(map(int, input().split()))) if N == 1: print(1) exit() d = [] for i, p1 in enumerate(p): for j, p2 in enumerate(p): if i == j: continue x = p1[0] - p2[0] y = p1[1] - p2[1] ...
insert
7
7
7
11
0
p03006
Python
Runtime Error
from collections import defaultdict n = int(input()) points = [tuple(map(int, input().split())) for _ in range(n)] cnt = defaultdict(int) for i in range(n): for j in range(n): if i == j: continue cnt[(points[i][0] - points[j][0], points[i][1] - points[j][1])] += 1 # print(cnt) ans = n...
from collections import defaultdict n = int(input()) points = [tuple(map(int, input().split())) for _ in range(n)] cnt = defaultdict(int) cnt[(0, 0)] = 0 for i in range(n): for j in range(n): if i == j: continue cnt[(points[i][0] - points[j][0], points[i][1] - points[j][1])] += 1 # pr...
insert
6
6
6
7
0
p03006
Python
Runtime Error
import collections N = int(input()) xy = [[int(i) for i in input().split()] for _ in range(N)] diff = [] for i in range(N): for j in range(N): if i == j: continue else: if xy[i][0] > xy[j][0]: diff.append((xy[i][0] - xy[j][0], xy[i][1] - xy[j][1])) ...
import collections N = int(input()) xy = [[int(i) for i in input().split()] for _ in range(N)] diff = [] for i in range(N): for j in range(N): if i == j: continue else: if xy[i][0] > xy[j][0]: diff.append((xy[i][0] - xy[j][0], xy[i][1] - xy[j][1])) ...
replace
20
22
20
26
0
p03006
Python
Runtime Error
from collections import defaultdict n = int(input()) z = [list(map(int, input().split())) for _ in range(n)] d = defaultdict(int) for i in range(n): xi, yi = z[i] for j in range(n): if i == j: continue xj, yj = z[j] d[(xi - xj, yi - yj)] += 1 print(n - max(d.values()))
from collections import defaultdict n = int(input()) z = [list(map(int, input().split())) for _ in range(n)] if n == 1: ans = 1 else: d = defaultdict(int) for i in range(n): xi, yi = z[i] for j in range(n): if i == j: continue xj, yj = z[j] ...
replace
4
13
4
17
0
p03006
Python
Runtime Error
import sys from collections import defaultdict sys.setrecursionlimit(10**6) INF = float("inf") MOD = 10**9 + 7 def input(): return sys.stdin.readline().strip() def main(): N = int(input()) X = [] Y = [] for _ in range(N): x, y = map(int, input().split()) X.append(x) Y.ap...
import sys from collections import defaultdict sys.setrecursionlimit(10**6) INF = float("inf") MOD = 10**9 + 7 def input(): return sys.stdin.readline().strip() def main(): N = int(input()) if N == 1: print(1) return X = [] Y = [] for _ in range(N): x, y = map(int, i...
insert
14
14
14
18
0
p03006
Python
Runtime Error
n = int(input()) xy = set(tuple(map(int, input().split())) for _ in range(n)) costs = [] for a in xy: besides_a = xy - {a} for b in besides_a: p = b[0] - a[0] q = b[1] - a[1] arrow_num = 0 for c in xy: if (c[0] + p, c[1] + q) in xy: arrow_num += 1 ...
n = int(input()) xy = set(tuple(map(int, input().split())) for _ in range(n)) costs = [] for a in xy: besides_a = xy - {a} for b in besides_a: p = b[0] - a[0] q = b[1] - a[1] arrow_num = 0 for c in xy: if (c[0] + p, c[1] + q) in xy: arrow_num += 1 ...
replace
16
17
16
20
0
p03006
Python
Runtime Error
import sys import math # noqa import bisect # noqa import queue # noqa def input(): return sys.stdin.readline().rstrip() def main(): N = int(input()) X = [0 for _ in range(N)] Y = [0 for _ in range(N)] for i in range(N): x, y = map(int, input().split()) X[i] = x Y[i] =...
import sys import math # noqa import bisect # noqa import queue # noqa def input(): return sys.stdin.readline().rstrip() def main(): N = int(input()) if N == 1: return print(1) X = [0 for _ in range(N)] Y = [0 for _ in range(N)] for i in range(N): x, y = map(int, input()...
insert
12
12
12
16
0
p03006
Python
Runtime Error
import collections def calc(balla, ballb): xa, ya = balla xb, yb = ballb return xa - xb, ya - yb n = int(input()) balls = [tuple(map(int, input().split())) for _ in range(n)] a = [] for i in range(0, n - 1): for j in range(i + 1, n): tmp = calc(balls[i], balls[j]) a += [tmp, tuple(-...
import collections def calc(balla, ballb): xa, ya = balla xb, yb = ballb return xa - xb, ya - yb n = int(input()) balls = [tuple(map(int, input().split())) for _ in range(n)] if n == 1: print(1) exit() a = [] for i in range(0, n - 1): for j in range(i + 1, n): tmp = calc(balls[i], ...
insert
12
12
12
16
0
p03006
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; typedef long long ll; typedef pair<int, int> iint; typedef pair<ll, ll> llll; #define ALL(x) (x).begin(), (x).end() const ll zero = 0; const ll INF = 3000000000000000000; // 10^18 const int inINF = 1000000000; // 10^9 const ll MOD = 1000000007; // 10^9+7 cons...
#include <bits/stdc++.h> using namespace std; typedef long long ll; typedef pair<int, int> iint; typedef pair<ll, ll> llll; #define ALL(x) (x).begin(), (x).end() const ll zero = 0; const ll INF = 3000000000000000000; // 10^18 const int inINF = 1000000000; // 10^9 const ll MOD = 1000000007; // 10^9+7 cons...
insert
15
15
15
20
0
p03006
Python
Runtime Error
N = int(input()) XY = [list(map(int, input().split())) for _ in range(N)] XY.sort(key=lambda x: x[0]) PQ = {} for i in range(N): x0, y0 = XY[i] for j in range(N): if i == j: continue x1, y1 = XY[j] p, q = x0 - x1, y0 - y1 key = str(p) + "," + str(q) if key ...
N = int(input()) XY = [list(map(int, input().split())) for _ in range(N)] if N == 1: print(1) exit() XY.sort(key=lambda x: x[0]) PQ = {} for i in range(N): x0, y0 = XY[i] for j in range(N): if i == j: continue x1, y1 = XY[j] p, q = x0 - x1, y0 - y1 key = st...
insert
2
2
2
5
0
p03006
Python
Runtime Error
#!/usr/bin/env python3 from collections import defaultdict (n,), *p = [[*map(int, i.split())] for i in open(0)] d = defaultdict(int) for i in range(n): for j in range(n): if i != j: d[(p[i][0] - p[j][0], p[i][1] - p[j][1])] += 1 print(n - max(d.values()))
#!/usr/bin/env python3 from collections import defaultdict (n,), *p = [[*map(int, i.split())] for i in open(0)] d = defaultdict(int) for i in range(n): for j in range(n): if i != j: d[(p[i][0] - p[j][0], p[i][1] - p[j][1])] += 1 print(n * (n < 2) or n - max(d.values()))
replace
9
10
9
10
0
p03006
Python
Runtime Error
from collections import defaultdict N = int(input()) X = [list(map(int, input().split())) for _ in range(N)] X.sort() ctr = defaultdict(int) for i in range(N - 1): for j in range(i + 1, N): p = X[i][0] - X[j][0] q = X[i][1] - X[j][1] ctr[(p, q)] += 1 ctr[(-p, -q)] += 1 print(N - m...
from collections import defaultdict N = int(input()) X = [list(map(int, input().split())) for _ in range(N)] X.sort() ctr = defaultdict(int) for i in range(N - 1): for j in range(i + 1, N): p = X[i][0] - X[j][0] q = X[i][1] - X[j][1] ctr[(p, q)] += 1 ctr[(-p, -q)] += 1 if N == 1: ...
replace
14
15
14
18
0
p03006
Python
Runtime Error
from collections import Counter n = int(input()) a = [tuple(map(int, input().split())) for _ in range(n)] c = Counter((y[0] - x[0], y[1] - x[1]) for x in a for y in a if x < y) print(n - max(c.values()))
from collections import Counter n = int(input()) a = [tuple(map(int, input().split())) for _ in range(n)] c = Counter((y[0] - x[0], y[1] - x[1]) for x in a for y in a if x < y) print(n - max(c.values(), default=0))
replace
5
6
5
6
0
p03006
Python
Runtime Error
from itertools import combinations N = int(input()) P = [] for _ in range(N): x, y = map(int, input().split()) P.append((x, y)) memo = dict() for a, b in combinations(P, 2): p, q = a[0] - b[0], a[1] - b[1] if p < 0: p, q = -p, -q elif p == 0 and q < 0: q = -q if (p, q) in memo:...
from itertools import combinations N = int(input()) P = [] for _ in range(N): x, y = map(int, input().split()) P.append((x, y)) memo = dict() for a, b in combinations(P, 2): p, q = a[0] - b[0], a[1] - b[1] if p < 0: p, q = -p, -q elif p == 0 and q < 0: q = -q if (p, q) in memo:...
replace
20
21
20
21
0
p03006
C++
Runtime Error
#include <bits/stdc++.h> #define maxn 55 using namespace std; int n, num, a[maxn], b[maxn]; map<int, map<int, int>> mp; int main() { scanf("%d", &n); for (int i = 1; i <= n; ++i) scanf("%d%d", a[i], b[i]); for (int i = 1; i <= n; ++i) for (int j = 1; j <= n; ++j) if (i != j) num = max(num, +...
#include <bits/stdc++.h> #define maxn 55 using namespace std; int n, num, a[maxn], b[maxn]; map<int, map<int, int>> mp; int main() { scanf("%d", &n); for (int i = 1; i <= n; ++i) scanf("%d%d", a + i, b + i); for (int i = 1; i <= n; ++i) for (int j = 1; j <= n; ++j) if (i != j) num = max(num,...
replace
8
9
8
9
-11
p03006
Python
Runtime Error
import sys from collections import defaultdict from itertools import combinations input = sys.stdin.readline def main(): N = int(input()) x = [0] * N y = [0] * N for i in range(N): x[i], y[i] = map(int, input().split()) vector = defaultdict(int) for a, b in combinations(range(N), 2):...
import sys from collections import defaultdict from itertools import combinations input = sys.stdin.readline def main(): N = int(input()) x = [0] * N y = [0] * N for i in range(N): x[i], y[i] = map(int, input().split()) if N == 1: print(1) sys.exit() vector = default...
insert
13
13
13
17
0
p03006
C++
Runtime Error
#include <algorithm> #include <bits/stdc++.h> #include <bitset> #include <cmath> #include <cstring> #include <deque> #include <iomanip> #include <iostream> #include <limits> #include <list> #include <map> #include <numeric> #include <queue> #include <random> #include <regex> #include <set> #include <stack> #include <st...
#include <algorithm> #include <bits/stdc++.h> #include <bitset> #include <cmath> #include <cstring> #include <deque> #include <iomanip> #include <iostream> #include <limits> #include <list> #include <map> #include <numeric> #include <queue> #include <random> #include <regex> #include <set> #include <stack> #include <st...
insert
76
76
76
80
0
p03006
C++
Runtime Error
// diverta22019_b.cpp // Sat Jun 15 20:50:04 2019 #include <algorithm> #include <iostream> #include <map> #include <math.h> #include <queue> #include <set> #include <string> #include <unordered_map> #include <vector> #define INTINF 2147483647 #define LLINF 9223372036854775807 using namespace std; using ll = long long;...
// diverta22019_b.cpp // Sat Jun 15 20:50:04 2019 #include <algorithm> #include <iostream> #include <map> #include <math.h> #include <queue> #include <set> #include <string> #include <unordered_map> #include <vector> #define INTINF 2147483647 #define LLINF 9223372036854775807 using namespace std; using ll = long long;...
replace
29
30
29
33
0
p03006
Python
Runtime Error
import collections N = int(input()) xy_array = [list(map(int, input().split())) for i in range(N)] # print(xy_array) distance_array = [] for i in range(N): x_i, y_i = xy_array[i] for j in range(N): if i == j: continue x_j, y_j = xy_array[j] distance_array.append((x_i - x_j, ...
import collections N = int(input()) xy_array = [list(map(int, input().split())) for i in range(N)] if N == 1: print(1) exit() # print(xy_array) distance_array = [] for i in range(N): x_i, y_i = xy_array[i] for j in range(N): if i == j: continue x_j, y_j = xy_array[j] ...
insert
4
4
4
7
0
p03006
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; using ll = long long; #define forx(i, a, b) for (int i = (a); i < (b); i++) #define rep(i, n) for (int i = 0; i < (n); i++) int main() { cin.tie(0); ios::sync_with_stdio(false); int n; cin >> n; vector<pair<ll, ll>> z(n), d; rep(i, n) cin >> z[i].first >> z[i]...
#include <bits/stdc++.h> using namespace std; using ll = long long; #define forx(i, a, b) for (int i = (a); i < (b); i++) #define rep(i, n) for (int i = 0; i < (n); i++) int main() { cin.tie(0); ios::sync_with_stdio(false); int n; cin >> n; if (n == 1) { cout << 1 << endl; return 0; } vector<pai...
insert
12
12
12
16
0
p03006
C++
Runtime Error
#include <bits/stdc++.h> #include <numeric> #include <vector> #define PI 3.14159265358979323846 #define MAXINF (1e18L) #define INF (1e9L) #define EPS (1e-9) #define MOD ((ll)(1e9 + 7)) #define REP(i, n) for (int i = 0; i < int(n); ++i) #define Rep(i, sta, n) for (int i = sta; i < n; i++) #define RREP(i, n) for (int i =...
#include <bits/stdc++.h> #include <numeric> #include <vector> #define PI 3.14159265358979323846 #define MAXINF (1e18L) #define INF (1e9L) #define EPS (1e-9) #define MOD ((ll)(1e9 + 7)) #define REP(i, n) for (int i = 0; i < int(n); ++i) #define Rep(i, sta, n) for (int i = sta; i < n; i++) #define RREP(i, n) for (int i =...
replace
59
61
59
63
0
p03006
Python
Runtime Error
import sys import collections sys.setrecursionlimit(10**8) input = sys.stdin.readline def main(): N = int(input()) XY = [[int(x) for x in input().split()] for _ in range(N)] c = collections.Counter() for i in range(N): for j in range(N): if i == j: continue ...
import sys import collections sys.setrecursionlimit(10**8) input = sys.stdin.readline def main(): N = int(input()) XY = [[int(x) for x in input().split()] for _ in range(N)] c = collections.Counter() if N == 1: print(1) return for i in range(N): for j in range(N): ...
insert
14
14
14
18
0
p03006
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; int main() { int N; cin >> N; vector<pair<int, int>> ball(N); int x, y; for (int i = 0; i < N; i++) { cin >> x >> y; ball[i] = make_pair(x, y); } sort(ball.begin(), ball.end()); map<pair<int, int>, int> count; for (int i = 0; i < N; i++) { f...
#include <bits/stdc++.h> using namespace std; int main() { int N; cin >> N; vector<pair<int, int>> ball(N); int x, y; for (int i = 0; i < N; i++) { cin >> x >> y; ball[i] = make_pair(x, y); } sort(ball.begin(), ball.end()); map<pair<int, int>, int> count; for (int i = 0; i < N; i++) { f...
replace
23
25
23
32
0
p03006
Python
Runtime Error
n = int(input()) a = sorted([list(map(int, input().split())) for _ in range(n)]) d = {} ret = float("inf") for i in range(n - 1): for j in range(i + 1, n): p, q = a[j][0] - a[i][0], a[j][1] - a[i][1] if p == 0 and q == 0: continue key = (p, q) d.setdefault(key, 0) ...
n = int(input()) a = sorted([list(map(int, input().split())) for _ in range(n)]) d = {} ret = float("inf") for i in range(n - 1): for j in range(i + 1, n): p, q = a[j][0] - a[i][0], a[j][1] - a[i][1] if p == 0 and q == 0: continue key = (p, q) d.setdefault(key, 0) ...
replace
12
13
12
13
0
p03007
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; int main() { int n; cin >> n; int a[n + 1]; vector<int> p, m; int np = 0, nm = 0; for (int i = 0; i < n; i++) { cin >> a[i]; if (a[i] >= 0) { p.push_back(a[i]); np++; } else if (a[i] < 0) { m.push_back(a[i]); nm++; } } ...
#include <bits/stdc++.h> using namespace std; int main() { int n; cin >> n; int a[n + 1]; vector<int> p, m; int np = 0, nm = 0; for (int i = 0; i < n; i++) { cin >> a[i]; if (a[i] >= 0) { p.push_back(a[i]); np++; } else if (a[i] < 0) { m.push_back(a[i]); nm++; } } ...
replace
48
49
48
49
0
p03007
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; const int N = 2e5 + 10; int a[N]; inline bool cmp(const int &x, const int &y) { return x > y; } int main() { int n; scanf("%d", &n); int s = 0; for (int i = 1; i <= n; i++) scanf("%d", &a[i]), s += a[i]; sort(a + 1, a + n + 1, cmp); if (a[n] > 0) { s...
#include <bits/stdc++.h> using namespace std; const int N = 2e5 + 10; int a[N]; inline bool cmp(const int &x, const int &y) { return x > y; } int main() { int n; scanf("%d", &n); int s = 0; for (int i = 1; i <= n; i++) scanf("%d", &a[i]), s += a[i]; sort(a + 1, a + n + 1, cmp); if (a[n] > 0) { s...
replace
35
36
35
36
0
p03007
C++
Runtime Error
#include <algorithm> #include <iostream> #include <math.h> #include <numeric> #include <set> #include <vector> #define M 1000000007 #define int long long using namespace std; int32_t main() { ios_base::sync_with_stdio(false); cin.tie(NULL); int n, i; cin >> n; multiset<int> a; for (i = 0; i < n; i++) { ...
#include <algorithm> #include <iostream> #include <math.h> #include <numeric> #include <set> #include <vector> #define M 1000000007 #define int long long using namespace std; int32_t main() { ios_base::sync_with_stdio(false); cin.tie(NULL); int n, i; cin >> n; multiset<int> a; for (i = 0; i < n; i++) { ...
replace
34
35
34
35
0
p03007
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; const int N = 1e5; int n, a[N]; vector<int> pos, neg; int z; vector<pair<int, int>> ans; int main() { ios_base::sync_with_stdio(0); cin.tie(0); cin >> n; for (int i = 0; i < n; i++) cin >> a[i]; for (int i = 0; i < n; i++) if (a[i] < 0) neg.pus...
#include <bits/stdc++.h> using namespace std; const int N = 1e5; int n, a[N]; vector<int> pos, neg; int z; vector<pair<int, int>> ans; int main() { ios_base::sync_with_stdio(0); cin.tie(0); cin >> n; for (int i = 0; i < n; i++) cin >> a[i]; for (int i = 0; i < n; i++) if (a[i] < 0) neg.pus...
insert
26
26
26
34
0
p03007
C++
Runtime Error
#include <algorithm> #include <array> #include <climits> #include <cmath> #include <deque> #include <iomanip> #include <iostream> #include <map> #include <set> #include <string> #include <utility> #include <vector> using namespace std; int main() { int n; cin >> n; deque<int> neg, pos; for (int i = 0; i < n; +...
#include <algorithm> #include <array> #include <climits> #include <cmath> #include <deque> #include <iomanip> #include <iostream> #include <map> #include <set> #include <string> #include <utility> #include <vector> using namespace std; int main() { int n; cin >> n; deque<int> neg, pos; for (int i = 0; i < n; +...
replace
33
34
33
34
0
p03007
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; using Int = int_fast64_t; Int n; vector<Int> a; using P = pair<Int, Int>; vector<P> v; int main() { cin.tie(0); ios::sync_with_stdio(false); cin >> n; a.resize(n); for (auto &i : a) cin >> i; Int mi = 1e9, ma = -1e9, imi = -1, ima = -1; for (size_t i = 0...
#include <bits/stdc++.h> using namespace std; using Int = int_fast64_t; Int n; vector<Int> a; using P = pair<Int, Int>; vector<P> v; int main() { cin.tie(0); ios::sync_with_stdio(false); cin >> n; a.resize(n); for (auto &i : a) cin >> i; Int mi = 1e9, ma = -1e9, imi = -1, ima = -1; for (size_t i = 0...
replace
24
25
24
25
0
p03007
C++
Runtime Error
/** * @brief : c++ code for AtCoder * @author : rk222 * @created: 2019.06.15 20:56:28 */ #include <algorithm> #include <cmath> #include <cstdio> #include <iostream> #include <map> #include <queue> #include <set> #include <stack> #include <string> #include <vector> using namespace std; typedef long long ll; typed...
/** * @brief : c++ code for AtCoder * @author : rk222 * @created: 2019.06.15 20:56:28 */ #include <algorithm> #include <cmath> #include <cstdio> #include <iostream> #include <map> #include <queue> #include <set> #include <stack> #include <string> #include <vector> using namespace std; typedef long long ll; typed...
replace
54
55
54
55
0
p03007
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; #define INCANT \ cin.tie(0), cout.tie(0), ios::sync_with_stdio(false), \ cout << fixed << setprecision(20); #define int long long #define gcd __gcd #define all(x) (x).begin(), (x)...
#include <bits/stdc++.h> using namespace std; #define INCANT \ cin.tie(0), cout.tie(0), ios::sync_with_stdio(false), \ cout << fixed << setprecision(20); #define int long long #define gcd __gcd #define all(x) (x).begin(), (x)...
replace
34
35
34
35
0
p03007
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; using ll = long long; const ll MOD = 1e9 + 7; const ll INF = 1LL << 60; #define rep(i, a, n) for (ll i = (a); i < (n); i++) #define debug(x) cerr << #x << ": " << x << endl; template <typename T1, typename T2> inline void chmin(T1 &a, T2 b) { if (a > b) a = b; } templ...
#include <bits/stdc++.h> using namespace std; using ll = long long; const ll MOD = 1e9 + 7; const ll INF = 1LL << 60; #define rep(i, a, n) for (ll i = (a); i < (n); i++) #define debug(x) cerr << #x << ": " << x << endl; template <typename T1, typename T2> inline void chmin(T1 &a, T2 b) { if (a > b) a = b; } templ...
replace
23
24
23
24
-6
e12f7e03-e7c5-4682-98ad-9dc076e4ba31.out: /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p03007/C++/s867890935.cpp:61: int main(): Assertion `p == ans' failed.
p03007
C++
Runtime Error
#include <algorithm> #include <climits> #include <cmath> #include <cstdio> #include <cstdlib> #include <iomanip> #include <iostream> #include <string> #include <vector> using namespace std; int main() { int n = 0; cin >> n; vector<int> num(n); for (int i = 0; i < n; i++) { cin >> num.at(i); } sort(num...
#include <algorithm> #include <climits> #include <cmath> #include <cstdio> #include <cstdlib> #include <iomanip> #include <iostream> #include <string> #include <vector> using namespace std; int main() { int n = 0; cin >> n; vector<int> num(n); for (int i = 0; i < n; i++) { cin >> num.at(i); } sort(num...
insert
24
24
24
26
0
p03007
C++
Time Limit Exceeded
#include <algorithm> #include <cmath> #include <iostream> #include <map> #include <queue> #include <utility> #include <vector> using namespace std; typedef pair<int, int> P; int main() { ios::sync_with_stdio(false); cin.tie(nullptr); int n; cin >> n; int ans = 0; vector<P> astr; priority_queue<int> mq;...
#include <algorithm> #include <cmath> #include <iostream> #include <map> #include <queue> #include <utility> #include <vector> using namespace std; typedef pair<int, int> P; int main() { ios::sync_with_stdio(false); cin.tie(nullptr); int n; cin >> n; int ans = 0; vector<P> astr; priority_queue<int> mq;...
insert
21
21
21
31
TLE
p03007
C++
Runtime Error
#include <algorithm> #include <stdio.h> #include <stdlib.h> #include <vector> #define MAX_N (100000) using namespace std; int main(int argc, char *argv[]) { // read inputs int N, as[MAX_N]; scanf("%d", &N); for (int i = 0; i < N; i++) { scanf("%d", &as[i]); } // divide into positive and negative v...
#include <algorithm> #include <stdio.h> #include <stdlib.h> #include <vector> #define MAX_N (100000) using namespace std; int main(int argc, char *argv[]) { // read inputs int N, as[MAX_N]; scanf("%d", &N); for (int i = 0; i < N; i++) { scanf("%d", &as[i]); } // divide into positive and negative v...
insert
68
68
68
75
0
p03007
C++
Runtime Error
// #include C/C++ { #include <bits/stdc++.h> // } using namespace std; // #typedef { typedef long long int64; typedef pair<int, int> PII; typedef pair<int64, int64> PLL; // } // #parameter{ #ifdef _DEBUG #define TYPE decltype #define RF(filename) \ { freopen...
// #include C/C++ { #include <bits/stdc++.h> // } using namespace std; // #typedef { typedef long long int64; typedef pair<int, int> PII; typedef pair<int64, int64> PLL; // } // #parameter{ #ifdef _DEBUG #define TYPE decltype #define RF(filename) \ { freopen...
insert
113
113
113
120
0
p03007
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; #define rep(i, n) for (int i = 0; i < (int)(n); i++) typedef pair<int, int> P; int main() { int n; cin >> n; vector<int> a(n); rep(i, n) cin >> a[i]; vector<int> plus, minus; rep(i, n) { if (a[i] >= 0) plus.emplace_back(a[i]); else minus.em...
#include <bits/stdc++.h> using namespace std; #define rep(i, n) for (int i = 0; i < (int)(n); i++) typedef pair<int, int> P; int main() { int n; cin >> n; vector<int> a(n); rep(i, n) cin >> a[i]; vector<int> plus, minus; rep(i, n) { if (a[i] >= 0) plus.emplace_back(a[i]); else minus.em...
replace
38
39
38
39
0
p03007
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; int main() { int N; cin >> N; int A[100010] = {}; int ans = 0; int pos = 0; int neg = 0; int zero = 0; vector<int> P; vector<int> M; for (int i = 0; i < N; i++) { cin >> A[i]; ans += abs(A[i]); if (A[i] > 0) { pos++; P.push_back(A...
#include <bits/stdc++.h> using namespace std; int main() { int N; cin >> N; int A[100010] = {}; int ans = 0; int pos = 0; int neg = 0; int zero = 0; vector<int> P; vector<int> M; for (int i = 0; i < N; i++) { cin >> A[i]; ans += abs(A[i]); if (A[i] > 0) { pos++; P.push_back(A...
replace
40
42
40
41
0
p03007
C++
Runtime Error
#include <algorithm> #include <iostream> #include <queue> #include <string> #include <utility> #include <vector> using namespace std; typedef long long ll; typedef pair<int, int> pii; typedef pair<ll, ll> pll; #define REP(i, n) for (int i = 0; i < (n); i++) #define RREP(i, n) for (int i = (n)-1; i >= 0; i--) #define F...
#include <algorithm> #include <iostream> #include <queue> #include <string> #include <utility> #include <vector> using namespace std; typedef long long ll; typedef pair<int, int> pii; typedef pair<ll, ll> pll; #define REP(i, n) for (int i = 0; i < (n); i++) #define RREP(i, n) for (int i = (n)-1; i >= 0; i--) #define F...
replace
40
41
40
41
0
p03007
C++
Runtime Error
#include <algorithm> #include <iostream> #include <set> #include <vector> using namespace std; int n; vector<int> lz, mz; vector<pair<int, int>> mv; int main() { cin >> n; for (int i = 0; i < n; i++) { int a; cin >> a; if (a < 0) lz.push_back(a); else mz.push_back(a); } if (lz.size...
#include <algorithm> #include <iostream> #include <set> #include <vector> using namespace std; int n; vector<int> lz, mz; vector<pair<int, int>> mv; int main() { cin >> n; for (int i = 0; i < n; i++) { int a; cin >> a; if (a < 0) lz.push_back(a); else mz.push_back(a); } if (lz.size...
replace
33
34
33
34
0
p03007
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; #define rep(i, n) for (long long i = 0; i < n; i++) #define Rep(i, m, n) for (long long i = m; i < n; i++) #define REP(i, m, n, p) for (long long i = m; i < n; i += p) #define all(v) v.begin(), v.end() #define pq priority_queue #define bcnt(n) __builtin_popcountll(n) using...
#include <bits/stdc++.h> using namespace std; #define rep(i, n) for (long long i = 0; i < n; i++) #define Rep(i, m, n) for (long long i = m; i < n; i++) #define REP(i, m, n, p) for (long long i = m; i < n; i += p) #define all(v) v.begin(), v.end() #define pq priority_queue #define bcnt(n) __builtin_popcountll(n) using...
replace
630
632
630
632
0
p03007
C++
Runtime Error
#ifdef __GNUC__ #pragma GCC optimize(2) #endif #include <algorithm> #include <cassert> #include <cmath> #include <complex> #include <cstring> #include <deque> #include <functional> #include <iomanip> #include <iostream> #include <map> #include <numeric> #include <queue> #include <random> #include <set> #include <stack...
#ifdef __GNUC__ #pragma GCC optimize(2) #endif #include <algorithm> #include <cassert> #include <cmath> #include <complex> #include <cstring> #include <deque> #include <functional> #include <iomanip> #include <iostream> #include <map> #include <numeric> #include <queue> #include <random> #include <set> #include <stack...
replace
120
121
120
121
0