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
p02803
C++
Time Limit Exceeded
#include <bits/stdc++.h> using namespace std; int main() { ios_base::sync_with_stdio(false); cin.tie(NULL); int n, m; cin >> n >> m; vector<vector<int>> ta(n + 2, vector<int>(m + 2, 1)); for (int i = 0; i < n; i++) { string str; cin >> str; for (int j = 0; j < m; j++) { if (str[j] == '....
#include <bits/stdc++.h> using namespace std; int main() { ios_base::sync_with_stdio(false); cin.tie(NULL); int n, m; cin >> n >> m; vector<vector<int>> ta(n + 2, vector<int>(m + 2, 1)); for (int i = 0; i < n; i++) { string str; cin >> str; for (int j = 0; j < m; j++) { if (str[j] == '....
replace
46
47
46
47
TLE
p02803
C++
Time Limit Exceeded
// “Make it work, make it right, make it fast.” – Kent Beck #include <bits/stdc++.h> using namespace std; typedef long long ll; typedef double dd; const int siz = 1e6 + 5; const int MOD = 1e9 + 7; #define endl '\n' #define deb(x) cout << #x << " = " << x << endl; const int N = 20; const int inf = 1e9 + 5; const int dx[...
// “Make it work, make it right, make it fast.” – Kent Beck #include <bits/stdc++.h> using namespace std; typedef long long ll; typedef double dd; const int siz = 1e6 + 5; const int MOD = 1e9 + 7; #define endl '\n' #define deb(x) cout << #x << " = " << x << endl; const int N = 20; const int inf = 1e9 + 5; const int dx[...
replace
30
31
30
31
TLE
p02803
C++
Time Limit Exceeded
#include <bits/stdc++.h> using namespace std; typedef long long ll; typedef vector<int> VI; typedef vector<ll> VL; typedef vector<VI> VVI; typedef vector<VL> VVL; typedef pair<int, int> P; typedef pair<ll, ll> PL; #define FOR(i, a, b) for (int i = (a); i < (b); ++i) #define rep(i, n) for (int i = 0; i < (n); ++i) #def...
#include <bits/stdc++.h> using namespace std; typedef long long ll; typedef vector<int> VI; typedef vector<ll> VL; typedef vector<VI> VVI; typedef vector<VL> VVL; typedef pair<int, int> P; typedef pair<ll, ll> PL; #define FOR(i, a, b) for (int i = (a); i < (b); ++i) #define rep(i, n) for (int i = 0; i < (n); ++i) #def...
replace
53
54
53
54
TLE
p02803
C++
Time Limit Exceeded
#include <bits/stdc++.h> using namespace std; typedef long long ll; typedef vector<ll> vl; typedef vector<string> vs; typedef pair<ll, ll> P; #define FOR(i, a, b) for (ll i = (a); i < (b); i++) #define REP(i, n) FOR(i, 0, n) /***** define constant start *******/ const ll MOD = 1000000007; const double PI = 3.14159265...
#include <bits/stdc++.h> using namespace std; typedef long long ll; typedef vector<ll> vl; typedef vector<string> vs; typedef pair<ll, ll> P; #define FOR(i, a, b) for (ll i = (a); i < (b); i++) #define REP(i, n) FOR(i, 0, n) /***** define constant start *******/ const ll MOD = 1000000007; const double PI = 3.14159265...
replace
56
57
56
57
TLE
p02803
C++
Time Limit Exceeded
#include <bits/stdc++.h> using namespace std; #define rep(i, n) for (int i = 0; i < (int)(n); i++) using ll = long long; using vi = vector<int>; using vvi = vector<vi>; using vl = vector<ll>; using vvl = vector<vl>; int main() { ios::sync_with_stdio(false); cin.tie(nullptr); int INF = 1000000000; int h, w; c...
#include <bits/stdc++.h> using namespace std; #define rep(i, n) for (int i = 0; i < (int)(n); i++) using ll = long long; using vi = vector<int>; using vvi = vector<vi>; using vl = vector<ll>; using vvl = vector<vl>; int main() { ios::sync_with_stdio(false); cin.tie(nullptr); int INF = 1000000000; int h, w; c...
replace
37
38
37
38
TLE
p02803
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; int main() { int h, w; cin >> h >> w; vector<string> g(w); for (string &s : g) cin >> s; vector<int> dx = {-1, 0, 0, 1}; vector<int> dy = {0, 1, -1, 0}; int ans = 0; for (int i = 0; i < h; i++) { for (int j = 0; j < w; j++) { if (g[i][j] == '...
#include <bits/stdc++.h> using namespace std; int main() { int h, w; cin >> h >> w; vector<string> g(h); for (string &s : g) cin >> s; vector<int> dx = {-1, 0, 0, 1}; vector<int> dy = {0, 1, -1, 0}; int ans = 0; for (int i = 0; i < h; i++) { for (int j = 0; j < w; j++) { if (g[i][j] == '...
replace
6
7
6
7
0
p02803
C++
Time Limit Exceeded
#include <bits/stdc++.h> using namespace std; typedef long long ll; const long long MOD = 1000000007; long long modpow(long long a, long long n, long long m) { long long ans = 1; while (n) { if (n & 1) { ans = (ans * a) % m; } a = (a * a) % m; n >>= 1; } return ans; } long long combi(lon...
#include <bits/stdc++.h> using namespace std; typedef long long ll; const long long MOD = 1000000007; long long modpow(long long a, long long n, long long m) { long long ans = 1; while (n) { if (n & 1) { ans = (ans * a) % m; } a = (a * a) % m; n >>= 1; } return ans; } long long combi(lon...
replace
75
76
75
76
TLE
p02803
C++
Runtime Error
#include <algorithm> #include <climits> #include <cmath> #include <complex> #include <deque> #include <functional> #include <iomanip> #include <iostream> #include <list> #include <map> #include <queue> #include <set> #include <stack> #include <string> #include <tuple> #include <unordered_map> #include <vector> #define ...
#include <algorithm> #include <climits> #include <cmath> #include <complex> #include <deque> #include <functional> #include <iomanip> #include <iostream> #include <list> #include <map> #include <queue> #include <set> #include <stack> #include <string> #include <tuple> #include <unordered_map> #include <vector> #define ...
replace
38
39
38
39
0
p02803
C++
Time Limit Exceeded
#include <algorithm> #include <cstdio> #include <cstring> #include <limits> #include <queue> #define repi(i, a, b) for (int i = (a); i < (b); ++i) #define rep(i, a) repi(i, 0, a) #define all(a) (a).begin(), (a).end() #define clr(a, v) memset((a), (v), sizeof(a)) using ll = long long; constexpr ll INF = std::numeric_li...
#include <algorithm> #include <cstdio> #include <cstring> #include <limits> #include <queue> #define repi(i, a, b) for (int i = (a); i < (b); ++i) #define rep(i, a) repi(i, 0, a) #define all(a) (a).begin(), (a).end() #define clr(a, v) memset((a), (v), sizeof(a)) using ll = long long; constexpr ll INF = std::numeric_li...
insert
36
36
36
39
TLE
p02803
C++
Runtime Error
/*Function Template*/ #include <bits/stdc++.h> using namespace std; typedef long long int ll; typedef pair<ll, ll> pint; const int MAX = 510000; const int MOD = 1000000007; #define rep(i, n) for (ll i = 0; i < (n); i++) #define Rep(i, n) for (ll i = 1; i < (n); i++) #define ALL(a) (a).begin(), (a).end() #define IOS ...
/*Function Template*/ #include <bits/stdc++.h> using namespace std; typedef long long int ll; typedef pair<ll, ll> pint; const int MAX = 510000; const int MOD = 1000000007; #define rep(i, n) for (ll i = 0; i < (n); i++) #define Rep(i, n) for (ll i = 1; i < (n); i++) #define ALL(a) (a).begin(), (a).end() #define IOS ...
replace
168
169
168
169
0
p02803
C++
Runtime Error
#include <bits/stdc++.h> #define N 50 // #define int long long #define INF 1e9 #define rep(i, l, r) for (register int i = l; i <= r; ++i) using namespace std; inline int read() { register char cc = getchar(); register int cn(0), flus(1); while (cc > '9' || cc < '0') { if (cc == '-') flus = -flus; cc...
#include <bits/stdc++.h> #define N 500 // #define int long long #define INF 1e9 #define rep(i, l, r) for (register int i = l; i <= r; ++i) using namespace std; inline int read() { register char cc = getchar(); register int cn(0), flus(1); while (cc > '9' || cc < '0') { if (cc == '-') flus = -flus; c...
replace
1
2
1
2
0
p02803
C++
Time Limit Exceeded
#include <queue> #include <stdio.h> using namespace std; int n, m; char map[22][22]; int d[22][22]; int bfs(int sx, int sy) { for (int i = 0; i < n; i++) for (int j = 0; j < m; j++) d[i][j] = -1; queue<pair<int, int>> q; q.push({sx, sy}); d[sx][sy] = 0; int r = 0; while (!q.empty()) { int x =...
#include <queue> #include <stdio.h> using namespace std; int n, m; char map[22][22]; int d[22][22]; int bfs(int sx, int sy) { for (int i = 0; i < n; i++) for (int j = 0; j < m; j++) d[i][j] = -1; queue<pair<int, int>> q; q.push({sx, sy}); d[sx][sy] = 0; int r = 0; while (!q.empty()) { int x =...
insert
18
18
18
19
TLE
p02803
C++
Time Limit Exceeded
#include <bits/stdc++.h> using namespace std; #define inf (int)(1e9) int main() { int H, W, i, j, ans = 0; scanf("%d%d", &H, &W); vector<string> S(H); for (i = 0; i < H; i++) { cin >> S[i]; } int dx[4] = {0, 1, 0, -1}; int dy[4] = {1, 0, -1, 0}; for (i = 0; i < H; i++) { for (j = 0; j < W; j++)...
#include <bits/stdc++.h> using namespace std; #define inf (int)(1e9) int main() { int H, W, i, j, ans = 0; scanf("%d%d", &H, &W); vector<string> S(H); for (i = 0; i < H; i++) { cin >> S[i]; } int dx[4] = {0, 1, 0, -1}; int dy[4] = {1, 0, -1, 0}; for (i = 0; i < H; i++) { for (j = 0; j < W; j++)...
replace
27
28
27
28
TLE
p02803
C++
Time Limit Exceeded
#include <bits/stdc++.h> #define REP(i, n) for (int(i) = 0; (i) < (n); ++(i)) #define REPV(iter, v) \ for (auto(iter) = (v).begin(); (iter) != (v).end(); ++(iter)) #define ALL(v) (v).begin(), (v).end() #define MOD 1000000007 using namespace std; typedef lon...
#include <bits/stdc++.h> #define REP(i, n) for (int(i) = 0; (i) < (n); ++(i)) #define REPV(iter, v) \ for (auto(iter) = (v).begin(); (iter) != (v).end(); ++(iter)) #define ALL(v) (v).begin(), (v).end() #define MOD 1000000007 using namespace std; typedef lon...
replace
46
74
46
65
TLE
p02803
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; typedef long long ll; #define INF 1LL << 62 #define inf 1000000007 int main() { ll h, w; cin >> h >> w; ll dx[4] = {1, 0, -1, 0}; ll dy[4] = {0, 1, 0, -1}; char ch[22][22]; for (ll i = 0; i < h; i++) { for (ll j = 0; j < w; j++) { cin >> ch[i][j]; ...
#include <bits/stdc++.h> using namespace std; typedef long long ll; #define INF 1LL << 62 #define inf 1000000007 int main() { ll h, w; cin >> h >> w; ll dx[4] = {1, 0, -1, 0}; ll dy[4] = {0, 1, 0, -1}; char ch[22][22]; for (ll i = 0; i < h; i++) { for (ll j = 0; j < w; j++) { cin >> ch[i][j]; ...
insert
39
39
39
42
0
p02803
C++
Runtime Error
#pragma GCC target("avx2") #pragma GCC optimize("O3") #pragma GCC optimize("unroll-loops") #include <bits/stdc++.h> #define rc(x) return cout << x << endl, 0 #define pb push_back #define mkp make_pair #define in insert #define er erase #define fd find #define fr first #define sc second typedef long long ll; typedef lon...
// #pragma GCC target("avx2") #pragma GCC optimize("O3") #pragma GCC optimize("unroll-loops") #include <bits/stdc++.h> #define rc(x) return cout << x << endl, 0 #define pb push_back #define mkp make_pair #define in insert #define er erase #define fd find #define fr first #define sc second typedef long long ll; typedef ...
replace
0
1
0
1
0
p02803
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; typedef vector<vector<char>> field_t; typedef pair<int, int> point_t; point_t operator+(const point_t &lhs, const point_t &rhs) { point_t p = {lhs.first + rhs.first, lhs.second + rhs.second}; return p; } bool operator==(const point_t &lhs, const point_t &rhs) { ret...
#include <bits/stdc++.h> using namespace std; typedef vector<vector<char>> field_t; typedef pair<int, int> point_t; point_t operator+(const point_t &lhs, const point_t &rhs) { point_t p = {lhs.first + rhs.first, lhs.second + rhs.second}; return p; } bool operator==(const point_t &lhs, const point_t &rhs) { ret...
replace
113
118
113
114
0
p02803
C++
Time Limit Exceeded
#include <algorithm> #include <bitset> #include <cassert> #include <cmath> #include <complex> #include <cstdio> #include <cstdlib> #include <cstring> #include <ctime> #include <deque> #include <iomanip> #include <iostream> #include <list> #include <map> #include <numeric> #include <queue> #include <random> #include <se...
#include <algorithm> #include <bitset> #include <cassert> #include <cmath> #include <complex> #include <cstdio> #include <cstdlib> #include <cstring> #include <ctime> #include <deque> #include <iomanip> #include <iostream> #include <list> #include <map> #include <numeric> #include <queue> #include <random> #include <se...
insert
63
63
63
64
TLE
p02803
C++
Time Limit Exceeded
#include <bits/stdc++.h> #define GET_REP(_1, _2, _3, NAME, ...) NAME #define rep(...) GET_REP(__VA_ARGS__, irep, _rep)(__VA_ARGS__) #define rep1(...) GET_REP(__VA_ARGS__, irep1, _rep1)(__VA_ARGS__) #define _rep(i, n) irep(i, 0, n) #define _rep1(i, n) irep1(i, 1, n) #define irep(i, a, n) for (int i = a; i < (int)(n); ++...
#include <bits/stdc++.h> #define GET_REP(_1, _2, _3, NAME, ...) NAME #define rep(...) GET_REP(__VA_ARGS__, irep, _rep)(__VA_ARGS__) #define rep1(...) GET_REP(__VA_ARGS__, irep1, _rep1)(__VA_ARGS__) #define _rep(i, n) irep(i, 0, n) #define _rep1(i, n) irep1(i, 1, n) #define irep(i, a, n) for (int i = a; i < (int)(n); ++...
insert
64
64
64
65
TLE
p02803
C++
Time Limit Exceeded
#include <bits/stdc++.h> #define Open(s) \ freopen(s ".in", "r", stdin); \ freopen(s ".out", "w", stdout); #define inl inline #define reg register #define i64 long long using namespace std; inl int read() {...
#include <bits/stdc++.h> #define Open(s) \ freopen(s ".in", "r", stdin); \ freopen(s ".out", "w", stdout); #define inl inline #define reg register #define i64 long long using namespace std; inl int read() {...
delete
69
72
69
69
TLE
p02803
C++
Runtime Error
#include <algorithm> #include <iostream> #include <queue> #include <vector> using namespace std; #define REP(i, n) for (int i = 0; i < (int)(n); ++i) #define FOR(i, m, n) for (int i = (int)(m); i < (int)(n); ++i) int main() { int H, W; cin >> H >> W; vector<string> S(H); REP(i, H) cin >> S[i]; int ans = 0;...
#include <algorithm> #include <iostream> #include <queue> #include <vector> using namespace std; #define REP(i, n) for (int i = 0; i < (int)(n); ++i) #define FOR(i, m, n) for (int i = (int)(m); i < (int)(n); ++i) int main() { int H, W; cin >> H >> W; vector<string> S(H); REP(i, H) cin >> S[i]; int ans = 0;...
replace
37
38
37
38
-11
p02803
C++
Time Limit Exceeded
#include <bits/stdc++.h> using namespace std; int h, w, vis[20][20]; string gr[20]; int main() { ios_base::sync_with_stdio(false); cin.tie(NULL); cin >> h >> w; for (int i = 0; i < h; i++) cin >> gr[i]; int mx = 0; for (int i = 0; i < h; i++) for (int j = 0; j < w; j++) { if (gr[i][j] == '#'...
#include <bits/stdc++.h> using namespace std; int h, w, vis[20][20]; string gr[20]; int main() { ios_base::sync_with_stdio(false); cin.tie(NULL); cin >> h >> w; for (int i = 0; i < h; i++) cin >> gr[i]; int mx = 0; for (int i = 0; i < h; i++) for (int j = 0; j < w; j++) { if (gr[i][j] == '#'...
insert
26
26
26
28
TLE
p02803
C++
Time Limit Exceeded
#include <bits/stdc++.h> using namespace std; #define rep(i, n) for (int i = 0; i < n; i++) typedef pair<int, int> P; typedef long long ll; const int INF = 1001001001; const ll INFL = 1e17; const int MOD = 1e9 + 7; int main() { int h, w; cin >> h >> w; vector<string> s; rep(i, h) { string t; cin >> t; ...
#include <bits/stdc++.h> using namespace std; #define rep(i, n) for (int i = 0; i < n; i++) typedef pair<int, int> P; typedef long long ll; const int INF = 1001001001; const ll INFL = 1e17; const int MOD = 1e9 + 7; int main() { int h, w; cin >> h >> w; vector<string> s; rep(i, h) { string t; cin >> t; ...
replace
43
44
43
44
TLE
p02803
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; bool g[22][22]; int main() { ios::sync_with_stdio(0); cout << setprecision(10) << fixed; int h, w; cin >> h >> w; for (int i = 0; i < h; ++i) { for (int j = 0; j < w; ++j) { char c; cin >> c; g[i][j] = (c == '.'); } } vector<int> dx ...
#include <bits/stdc++.h> using namespace std; bool g[22][22]; int main() { ios::sync_with_stdio(0); cout << setprecision(10) << fixed; int h, w; cin >> h >> w; for (int i = 0; i < h; ++i) { for (int j = 0; j < w; ++j) { char c; cin >> c; g[i][j] = (c == '.'); } } vector<int> dx ...
insert
31
31
31
33
0
p02803
C++
Time Limit Exceeded
#include <bits/stdc++.h> using namespace std; typedef long long ll; typedef pair<int, int> P; constexpr int di[] = {0, 1, 0, -1}, dj[] = {1, 0, -1, 0}; #define rep(i, n) for (int i = 0; i < n; i++) #define repr(i, n) for (int i = n; i >= 0; i--) #define SORT(v) sort((v).begin(), (v).end()) #define SORTR(v) sort((v).rbe...
#include <bits/stdc++.h> using namespace std; typedef long long ll; typedef pair<int, int> P; constexpr int di[] = {0, 1, 0, -1}, dj[] = {1, 0, -1, 0}; #define rep(i, n) for (int i = 0; i < n; i++) #define repr(i, n) for (int i = n; i >= 0; i--) #define SORT(v) sort((v).begin(), (v).end()) #define SORTR(v) sort((v).rbe...
replace
47
48
47
48
TLE
p02803
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; typedef long long ll; #define rep(i, n) for (int i = 0; i < n; ++i) int h, w; int id(int i, int j) { return i * w + j; } int main() { cin >> h >> w; vector<string> s(h); rep(i, h) cin >> s[i]; int d[h * w][h * w]; rep(i, h * w) rep(j, h * w) d[i][j] = 100000; ...
#include <bits/stdc++.h> using namespace std; typedef long long ll; #define rep(i, n) for (int i = 0; i < n; ++i) int h, w; int id(int i, int j) { return i * w + j; } int main() { cin >> h >> w; vector<string> s(h); rep(i, h) cin >> s[i]; int d[h * w][h * w]; rep(i, h * w) rep(j, h * w) d[i][j] = 100000; ...
replace
16
75
16
83
0
p02803
C++
Time Limit Exceeded
#include <bits/stdc++.h> int main() { using vi = std::vector<int>; using vvi = std::vector<vi>; int H, W; scanf("%d%d", &H, &W); using vb = std::vector<bool>; using vvb = std::vector<vb>; vvb room(H + 2, vb(W + 2)); for (int r{1}; r <= H; r++) for (int c{1}; c <= W; c++) { char S; scanf...
#include <bits/stdc++.h> int main() { using vi = std::vector<int>; using vvi = std::vector<vi>; int H, W; scanf("%d%d", &H, &W); using vb = std::vector<bool>; using vvb = std::vector<vb>; vvb room(H + 2, vb(W + 2)); for (int r{1}; r <= H; r++) for (int c{1}; c <= W; c++) { char S; scanf...
replace
36
37
36
37
TLE
p02803
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; typedef long long ll; #define rep(i, n) for (int i = 0; i < (int)(n); i++) #define rep2(i, s, n) for (int i = (s); i < (int)(n); i++) const int H_MAX = 20; const int W_MAX = 20; vector<vector<char>> S(H_MAX + 5, vector<char>(W_MAX + 5, '#')); vector<vector<int>> dist(H_MAX...
#include <bits/stdc++.h> using namespace std; typedef long long ll; #define rep(i, n) for (int i = 0; i < (int)(n); i++) #define rep2(i, s, n) for (int i = (s); i < (int)(n); i++) const int H_MAX = 25; const int W_MAX = 25; vector<vector<char>> S(H_MAX, vector<char>(W_MAX, '#')); vector<vector<int>> dist(H_MAX, vector...
replace
6
9
6
9
0
p02803
C++
Runtime Error
#include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < (n); ++i) using namespace std; using ll = long long; using P = pair<int, int>; const int dx[4] = {1, 0, -1, 0}; const int dy[4] = {0, 1, 0, -1}; int H, W; vector<string> Graph(21); int solve(int i, int j, int k, int l) { if (Graph[i][j] == '#' || Graph...
#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>; const int dx[4] = {1, 0, -1, 0}; const int dy[4] = {0, 1, 0, -1}; int H, W; vector<string> Graph(21); int solve(int i, int j, int k, int l) { if (Graph[i][j] == '#' || Graph...
insert
42
42
42
43
0
p02803
C++
Time Limit Exceeded
#include <bits/stdc++.h> typedef long long ll; #define rep(i, a, n) for (ll i = a; i < (ll)n; ++i) const ll MOD = 1000000007; using namespace std; const int dy[4] = {0, 1, 0, -1}; const int dx[4] = {1, 0, -1, 0}; int main(void) { int h, w; cin >> h >> w; vector<string> v(h); rep(i, 0, h) cin >> v[i]; int ans...
#include <bits/stdc++.h> typedef long long ll; #define rep(i, a, n) for (ll i = a; i < (ll)n; ++i) const ll MOD = 1000000007; using namespace std; const int dy[4] = {0, 1, 0, -1}; const int dx[4] = {1, 0, -1, 0}; int main(void) { int h, w; cin >> h >> w; vector<string> v(h); rep(i, 0, h) cin >> v[i]; int ans...
replace
33
34
33
34
TLE
p02803
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; typedef long long tint; const tint INF = 2e14 + 1; const long double PI = 3.141592; const int MOD = 998244353; #define forsn(i, s, n) for (int i = s; i < int(n); i++) #define forn(i, n) forsn(i, 0, n) #define all(v) v.begin(), v.end() #define rall(v) v.rbegin(), v.rend(...
#include <bits/stdc++.h> using namespace std; typedef long long tint; const tint INF = 2e14 + 1; const long double PI = 3.141592; const int MOD = 998244353; #define forsn(i, s, n) for (int i = s; i < int(n); i++) #define forn(i, n) forsn(i, 0, n) #define all(v) v.begin(), v.end() #define rall(v) v.rbegin(), v.rend(...
replace
34
35
34
35
0
p02804
C++
Time Limit Exceeded
#include <bits/stdc++.h> using namespace std; // int/long: -2,147,483,648 - 2,147,483,648 (-2^31 <= int < 2^31) // long/long long: -9,223,372,036,854,775,808 - 9,223,372,036,854,775,807 // (-2^63 <= long < 2^63) #define INF (1 << 29) // 536,870,912 // lower_bound(A.begin(), A.end(), N) // upper_bound(... // A.eras...
#include <bits/stdc++.h> using namespace std; // int/long: -2,147,483,648 - 2,147,483,648 (-2^31 <= int < 2^31) // long/long long: -9,223,372,036,854,775,808 - 9,223,372,036,854,775,807 // (-2^63 <= long < 2^63) #define INF (1 << 29) // 536,870,912 // lower_bound(A.begin(), A.end(), N) // upper_bound(... // A.eras...
replace
80
89
80
83
TLE
p02804
C++
Runtime Error
#include <algorithm> #include <cstdio> #include <iostream> #define N 100005 using namespace std; typedef long long ll; ll M = 1e9 + 7; ll n, k, s, a[N]; ll fac[N]{1, 1}, inv[N]{1, 1}, fiv[N]{1, 1}; ll com(ll p, ll q) { return fac[p] * fiv[p - q] % M * fiv[q] % M; } int main() { ll i; cin >> n >> k; for (i = 2;...
#include <algorithm> #include <cstdio> #include <iostream> #define N 100005 using namespace std; typedef long long ll; ll M = 1e9 + 7; ll n, k, s, a[N]; ll fac[N]{1, 1}, inv[N]{1, 1}, fiv[N]{1, 1}; ll com(ll p, ll q) { if (p < q) return 0; return fac[p] * fiv[p - q] % M * fiv[q] % M; } int main() { ll i; ...
replace
11
12
11
16
0
p02804
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; const int MAX = 50000; const int MOD = 1000000007; int64_t fac[MAX], finv[MAX], inv[MAX]; void COMinit() { fac[0] = fac[1] = 1; finv[0] = finv[1] = 1; inv[1] = 1; for (int i = 2; i < MAX; i++) { fac[i] = fac[i - 1] * i % MOD; inv[i] = MOD - inv[MOD % i] *...
#include <bits/stdc++.h> using namespace std; const int MAX = 500000; const int MOD = 1000000007; int64_t fac[MAX], finv[MAX], inv[MAX]; void COMinit() { fac[0] = fac[1] = 1; finv[0] = finv[1] = 1; inv[1] = 1; for (int i = 2; i < MAX; i++) { fac[i] = fac[i - 1] * i % MOD; inv[i] = MOD - inv[MOD % i] ...
replace
3
4
3
4
0
p02804
C++
Time Limit Exceeded
#include <algorithm> #include <bits/stdc++.h> using namespace std; #define sqr(x) ((x) * (x)) #define all(v) (v).begin(), (v).end() #define rall(v) (v).rbegin(), (v).rend() typedef vector<int> vi; typedef vector<long long> vll; typedef vector<char> vc; typedef pair<int, int> pii; typedef long long ll; const int MOD...
#include <algorithm> #include <bits/stdc++.h> using namespace std; #define sqr(x) ((x) * (x)) #define all(v) (v).begin(), (v).end() #define rall(v) (v).rbegin(), (v).rend() typedef vector<int> vi; typedef vector<long long> vll; typedef vector<char> vc; typedef pair<int, int> pii; typedef long long ll; const int MOD...
replace
37
38
37
38
TLE
p02804
C++
Time Limit Exceeded
#include <cmath> #include <cstdio> #include <cstdlib> #include <cstring> #include <algorithm> #include <complex> #include <iostream> #include <map> #include <numeric> #include <queue> #include <set> #include <stack> #include <string> #include <unordered_map> #include <unordered_set> #include <vector> #include <casser...
#include <cmath> #include <cstdio> #include <cstdlib> #include <cstring> #include <algorithm> #include <complex> #include <iostream> #include <map> #include <numeric> #include <queue> #include <set> #include <stack> #include <string> #include <unordered_map> #include <unordered_set> #include <vector> #include <casser...
insert
138
138
138
140
TLE
p02804
C++
Runtime Error
// // Created by Mahmoud Rashad on 11/27/19. // #include <bits/stdc++.h> using namespace std; typedef vector<int> vi; typedef pair<int, int> ii; typedef vector<pair<ii, ii>> vii; const int N = 1e5 + 5, MOD = 1e9 + 7; long long fact[N], fact_inv[N]; long long mul(long long a, long long b) { return (a + MOD) * b % M...
// // Created by Mahmoud Rashad on 11/27/19. // #include <bits/stdc++.h> using namespace std; typedef vector<int> vi; typedef pair<int, int> ii; typedef vector<pair<ii, ii>> vii; const int N = 1e5 + 5, MOD = 1e9 + 7; long long fact[N], fact_inv[N]; long long mul(long long a, long long b) { return (a + MOD) * b % M...
replace
47
48
47
48
-6
terminate called after throwing an instance of 'std::length_error' what(): cannot create std::vector larger than max_size()
p02804
C++
Runtime Error
#include <bits/stdc++.h> #define ff first #define ss second #define pb push_back #define pf push_front #define eb emplace_back #define emp emplace #define ins insert #define mp make_pair #define mt make_tuple #define sz(s) (int)s.size() #define forp(i, a, b) for (int i = a; i <= b; i++) #define rep(i, n) for (int i = 0...
#include <bits/stdc++.h> #define ff first #define ss second #define pb push_back #define pf push_front #define eb emplace_back #define emp emplace #define ins insert #define mp make_pair #define mt make_tuple #define sz(s) (int)s.size() #define forp(i, a, b) for (int i = a; i <= b; i++) #define rep(i, n) for (int i = 0...
replace
140
146
140
141
0
p02804
C++
Runtime Error
#include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < (n); ++i) #define repr(i, a, b) for (int i = a; i < (b); ++i) #define reprev(i, n) for (int i = n - 1; i >= 0; --i) #define reprrev(i, a, b) for (int i = b - 1; i >= (a); --i) using namespace std; typedef long long ll; typedef pair<int, int> P; const int M...
#include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < (n); ++i) #define repr(i, a, b) for (int i = a; i < (b); ++i) #define reprev(i, n) for (int i = n - 1; i >= 0; --i) #define reprrev(i, a, b) for (int i = b - 1; i >= (a); --i) using namespace std; typedef long long ll; typedef pair<int, int> P; const int M...
replace
9
10
9
10
0
p02804
C++
Runtime Error
#include <algorithm> #include <cmath> #include <cstdio> #include <cstdlib> #include <cstring> #include <functional> #include <iomanip> #include <iostream> #include <list> #include <map> #include <numeric> #include <queue> #include <set> #include <stack> #include <string> #include <vector> using namespace std; #define...
#include <algorithm> #include <cmath> #include <cstdio> #include <cstdlib> #include <cstring> #include <functional> #include <iomanip> #include <iostream> #include <list> #include <map> #include <numeric> #include <queue> #include <set> #include <stack> #include <string> #include <vector> using namespace std; #define...
insert
50
50
50
52
0
p02804
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; template <typename T> istream &operator>>(istream &istr, vector<T> &vec) { for (T &x : vec) istr >> x; return istr; } template <typename T> ostream &operator<<(ostream &ostr, vector<T> &vec) { if (!vec.empty()) { ostr << vec.front(); for (auto itr = ++ve...
#include <bits/stdc++.h> using namespace std; template <typename T> istream &operator>>(istream &istr, vector<T> &vec) { for (T &x : vec) istr >> x; return istr; } template <typename T> ostream &operator<<(ostream &ostr, vector<T> &vec) { if (!vec.empty()) { ostr << vec.front(); for (auto itr = ++ve...
replace
93
94
93
94
0
p02804
C++
Runtime Error
#include "bits/stdc++.h" #define rep(i, n) for (int i = 0; i < (n); ++i) using namespace std; typedef long long int ll; typedef pair<ll, ll> P; template <class T> inline bool chmax(T &a, T b) { if (a < b) { a = b; return 1; } return 0; } template <class T> inline bool chmin(T &a, T b) { if (a > b) { ...
#include "bits/stdc++.h" #define rep(i, n) for (int i = 0; i < (n); ++i) using namespace std; typedef long long int ll; typedef pair<ll, ll> P; template <class T> inline bool chmax(T &a, T b) { if (a < b) { a = b; return 1; } return 0; } template <class T> inline bool chmin(T &a, T b) { if (a > b) { ...
replace
33
34
33
34
0
p02804
C++
Time Limit Exceeded
#include <bits/stdc++.h> typedef long long ll; using namespace std; const int MOD = 1e9 + 7; const int MAX = 100010; ll fac[MAX], finv[MAX], inv[MAX]; // テーブルを作る前処理 void COMinit() { fac[0] = fac[1] = 1; finv[0] = finv[1] = 1; inv[1] = 1; for (int i = 2; i < MAX; i++) { fac[i] = fac[i - 1] * i % MOD; ...
#include <bits/stdc++.h> typedef long long ll; using namespace std; const int MOD = 1e9 + 7; const int MAX = 100010; ll fac[MAX], finv[MAX], inv[MAX]; // テーブルを作る前処理 void COMinit() { fac[0] = fac[1] = 1; finv[0] = finv[1] = 1; inv[1] = 1; for (int i = 2; i < MAX; i++) { fac[i] = fac[i - 1] * i % MOD; ...
replace
45
46
45
46
TLE
p02804
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; #define int long long // #define double long double #define FOR(i, a, b) for (int i = (a); i < (b); ++i) #define FORR(i, a, b) for (int i = (a); i > (b); --i) #define REP(i, n) for (int i = 0; i < (n); ++i) #define REPR(i, n) for (int i = n; i >= 0; i--) #define FOREACH(x...
#include <bits/stdc++.h> using namespace std; #define int long long // #define double long double #define FOR(i, a, b) for (int i = (a); i < (b); ++i) #define FORR(i, a, b) for (int i = (a); i > (b); --i) #define REP(i, n) for (int i = 0; i < (n); ++i) #define REPR(i, n) for (int i = n; i >= 0; i--) #define FOREACH(x...
replace
139
140
139
140
-8
p02804
C++
Time Limit Exceeded
#include <bits/stdc++.h> typedef long long ll; typedef long double ld; using namespace std; struct combination { combination(ll Nmax, ll mod) { (this->MOD) = mod; (this->Nmax) = Nmax; factorial.resize(Nmax + 1, 1); inverse_factorial.resize(Nmax + 1, 1); init_factorial(); } ll calc(ll n, ll r...
#include <bits/stdc++.h> typedef long long ll; typedef long double ld; using namespace std; struct combination { combination(ll Nmax, ll mod) { (this->MOD) = mod; (this->Nmax) = Nmax; factorial.resize(Nmax + 1, 1); inverse_factorial.resize(Nmax + 1, 1); init_factorial(); } ll calc(ll n, ll r...
replace
60
61
60
61
TLE
p02804
C++
Runtime Error
#define _USE_MATH_DEFINES #include <algorithm> #include <array> #include <bitset> #include <cassert> #include <cmath> #include <complex> #include <cstdio> #include <cstring> #include <ctime> #include <functional> #include <iostream> #include <list> #include <map> #include <numeric> #include <queue> #include <random> #i...
#define _USE_MATH_DEFINES #include <algorithm> #include <array> #include <bitset> #include <cassert> #include <cmath> #include <complex> #include <cstdio> #include <cstring> #include <ctime> #include <functional> #include <iostream> #include <list> #include <map> #include <numeric> #include <queue> #include <random> #i...
replace
57
58
57
62
0
p02804
C++
Runtime Error
/*input 10 6 1000000000 1000000000 1000000000 1000000000 1000000000 0 0 0 0 0 */ #include <bits/stdc++.h> using namespace std; #include <ext/pb_ds/assoc_container.hpp> #include <ext/pb_ds/tree_policy.hpp> using namespace __gnu_pbds; typedef tree<long long, null_type, less_equal<long long>, rb_tree_tag, tre...
/*input 10 6 1000000000 1000000000 1000000000 1000000000 1000000000 0 0 0 0 0 */ #include <bits/stdc++.h> using namespace std; #include <ext/pb_ds/assoc_container.hpp> #include <ext/pb_ds/tree_policy.hpp> using namespace __gnu_pbds; typedef tree<long long, null_type, less_equal<long long>, rb_tree_tag, tre...
replace
29
30
29
30
0
p02804
C++
Runtime Error
/** * author : 𝒌𝒚𝒐𝒎𝒖𝒌𝒚𝒐𝒎𝒖𝒑𝒖𝒓𝒊𝒏 * created : 2020-01-12 20:04:06 **/ #include <algorithm> #include <bitset> #include <cassert> #include <cctype> #include <chrono> #include <cmath> #include <complex> #include <deque> #include <iomanip> #include <iostream> #include <map> #include <numeric> #includ...
/** * author : 𝒌𝒚𝒐𝒎𝒖𝒌𝒚𝒐𝒎𝒖𝒑𝒖𝒓𝒊𝒏 * created : 2020-01-12 20:04:06 **/ #include <algorithm> #include <bitset> #include <cassert> #include <cctype> #include <chrono> #include <cmath> #include <complex> #include <deque> #include <iomanip> #include <iostream> #include <map> #include <numeric> #includ...
replace
63
64
63
64
0
p02804
C++
Time Limit Exceeded
#include <bits/stdc++.h> using namespace std; typedef long long ll; const int MAX = 510000; const int MOD = 1000000007; long long fac[MAX], finv[MAX], inv[MAX]; // テーブルを作る前処理 void COMinit() { fac[0] = fac[1] = 1; finv[0] = finv[1] = 1; inv[1] = 1; for (int i = 2; i < MAX; i++) { fac[i] = fac[i - 1] * i % ...
#include <bits/stdc++.h> using namespace std; typedef long long ll; const int MAX = 510000; const int MOD = 1000000007; long long fac[MAX], finv[MAX], inv[MAX]; // テーブルを作る前処理 void COMinit() { fac[0] = fac[1] = 1; finv[0] = finv[1] = 1; inv[1] = 1; for (int i = 2; i < MAX; i++) { fac[i] = fac[i - 1] * i % ...
replace
62
70
62
68
TLE
p02804
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; typedef long long ll; #ifdef ZERO_IQ ios_base::sync_with_stdio(false), cin.tie(0), cout.tie(0); #endif long long const mod = 1e9 + 7; vector<ll> fact(1e5 + 1), inv(1e5 + 1); ll fp(ll base, ll exp) { if (exp == 0) return 1; ll ans = fp(base, exp / 2); ans = (a...
#include <bits/stdc++.h> using namespace std; typedef long long ll; #ifdef ZERO_IQ ios_base::sync_with_stdio(false), cin.tie(0), cout.tie(0); #endif long long const mod = 1e9 + 7; vector<ll> fact(1e5 + 1), inv(1e5 + 1); ll fp(ll base, ll exp) { if (exp == 0) return 1; ll ans = fp(base, exp / 2); ans = (a...
replace
50
51
50
51
0
p02804
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; #define rep(i, j, k) for (int i = (int)j; i <= (int)k; i++) #define debug(x) cerr << #x << ":" << x << endl const int maxn = (int)1e6 + 5; int a[maxn]; typedef long long ll; ll mod = 1e9 + 7; // 1e9+9 ll add(ll x, ll y) { return (x + y) % mod; } ll mul(ll x, ll y) { return...
#include <bits/stdc++.h> using namespace std; #define rep(i, j, k) for (int i = (int)j; i <= (int)k; i++) #define debug(x) cerr << #x << ":" << x << endl const int maxn = (int)1e6 + 5; int a[maxn]; typedef long long ll; ll mod = 1e9 + 7; // 1e9+9 ll add(ll x, ll y) { return (x + y) % mod; } ll mul(ll x, ll y) { return...
replace
31
32
31
36
0
nCr(1,2):0
p02804
C++
Time Limit Exceeded
#include <bits/stdc++.h> using namespace std; using ll = long long; const ll MOD = 1e9 + 7; ll mod(ll &a) { return ((a %= MOD) > 0 ? a : a + MOD); } const int MAXN = 1e5 + 10; ll fact_[MAXN] = {0}; ll fact(ll n) { if (n == 1) return fact_[n] = 1; if (fact_[n] != 0) return fact_[n]; return fact_[n] = (n...
#include <bits/stdc++.h> using namespace std; using ll = long long; const ll MOD = 1e9 + 7; ll mod(ll &a) { return ((a %= MOD) > 0 ? a : a + MOD); } const int MAXN = 1e5 + 10; ll fact_[MAXN] = {0}; ll fact(ll n) { if (n == 1) return fact_[n] = 1; if (fact_[n] != 0) return fact_[n]; return fact_[n] = (n...
replace
51
54
51
55
TLE
p02804
C++
Time Limit Exceeded
#pragma region #define _USE_MATH_DEFINES #include <algorithm> #include <cmath> #include <cstdint> #include <cstdlib> #include <iomanip> #include <iostream> #include <list> #include <map> #include <queue> #include <set> #include <stack> #include <string> #include <vector> using namespace std; typedef long long ll; // #...
#pragma region #define _USE_MATH_DEFINES #include <algorithm> #include <cmath> #include <cstdint> #include <cstdlib> #include <iomanip> #include <iostream> #include <list> #include <map> #include <queue> #include <set> #include <stack> #include <string> #include <vector> using namespace std; typedef long long ll; // #...
replace
66
68
66
69
TLE
p02804
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; #define int long long int A[100005]; const int mod = 1e9 + 7; int inv(int x) { int ans = 1; int n = mod - 2; while (n) { if (n & 1) { ans = (ans * x) % mod; } x = (x * x) % mod; n >>= 1; } return ans; } int f[100005]; void init(int n) { f[0...
#include <bits/stdc++.h> using namespace std; #define int long long int A[100005]; const int mod = 1e9 + 7; int inv(int x) { int ans = 1; int n = mod - 2; while (n) { if (n & 1) { ans = (ans * x) % mod; } x = (x * x) % mod; n >>= 1; } return ans; } int f[100005]; void init(int n) { f[0...
replace
47
49
47
51
0
p02804
C++
Runtime Error
#include <algorithm> #include <cmath> #include <iomanip> #include <iostream> #include <map> #include <queue> #include <set> #include <stack> #include <string> #include <vector> #define endl '\n' #define Bedoazim \ ios_base::sync_with_stdio(0); ...
#include <algorithm> #include <cmath> #include <iomanip> #include <iostream> #include <map> #include <queue> #include <set> #include <stack> #include <string> #include <vector> #define endl '\n' #define Bedoazim \ ios_base::sync_with_stdio(0); ...
replace
18
19
18
19
0
p02804
C++
Time Limit Exceeded
#include <algorithm> #include <cmath> #include <iostream> #include <map> #include <queue> #include <string> #include <vector> using ll = long long; using graph = std::vector<std::vector<ll>>; using namespace std; vector<ll> Factorial(ll M, ll MOD) { vector<ll> result = vector<ll>(M + 1); for (int i = 0; i <= M; i...
#include <algorithm> #include <cmath> #include <iostream> #include <map> #include <queue> #include <string> #include <vector> using ll = long long; using graph = std::vector<std::vector<ll>>; using namespace std; vector<ll> Factorial(ll M, ll MOD) { vector<ll> result = vector<ll>(M + 1); for (int i = 0; i <= M; i...
replace
37
38
37
38
TLE
p02804
C++
Runtime Error
#include <algorithm> #include <cassert> #include <cmath> #include <iostream> #include <map> #include <numeric> #include <queue> #include <set> #include <stack> #include <unordered_map> #include <unordered_set> #include <vector> // #include <ext/pb_ds/assoc_container.hpp> // #include <ext/pb_ds/tree_policy.hpp> // usin...
#include <algorithm> #include <cassert> #include <cmath> #include <iostream> #include <map> #include <numeric> #include <queue> #include <set> #include <stack> #include <unordered_map> #include <unordered_set> #include <vector> // #include <ext/pb_ds/assoc_container.hpp> // #include <ext/pb_ds/tree_policy.hpp> // usin...
insert
64
64
64
69
0
p02804
C++
Runtime Error
#include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < n; i++) using namespace std; typedef long long ll; const int INF = 1 << 30; const ll LLINF = 1LL << 60; int mod = 1000000007; const int MAX = 510000; const int MOD = 1000000007; long long fac[MAX], finv[MAX], inv[MAX]; // テーブルを作る前処理 void COMinit() { ...
#include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < n; i++) using namespace std; typedef long long ll; const int INF = 1 << 30; const ll LLINF = 1LL << 60; int mod = 1000000007; const int MAX = 510000; const int MOD = 1000000007; long long fac[MAX], finv[MAX], inv[MAX]; // テーブルを作る前処理 void COMinit() { ...
delete
60
61
60
60
0
p02804
C++
Runtime Error
#include <algorithm> #include <bitset> #include <cmath> #include <ctime> #include <deque> #include <functional> #include <iostream> #include <map> #include <queue> #include <random> #include <set> #include <stack> #include <stdio.h> #include <string> #include <unordered_map> #include <unordered_set> #include <vector> #...
#include <algorithm> #include <bitset> #include <cmath> #include <ctime> #include <deque> #include <functional> #include <iostream> #include <map> #include <queue> #include <random> #include <set> #include <stack> #include <stdio.h> #include <string> #include <unordered_map> #include <unordered_set> #include <vector> #...
insert
48
48
48
50
0
p02804
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 SORT(v, n) sort(v, v + n); #define VSORT(v) sort(v.begin(), v.end()); #define VRSORT(v) sort(...
#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 SORT(v, n) sort(v, v + n); #define VSORT(v) sort(v.begin(), v.end()); #define VRSORT(v) sort(...
replace
218
222
218
221
TLE
p02804
C++
Runtime Error
#include <algorithm> #include <iostream> #include <vector> using namespace std; const long long int MOD = 1e9 + 7; long long int modinv(long long int a, long long int m) { long long int b = m, u = 1, v = 0; while (b) { long long int t = a / b; a -= t * b; swap(a, b); u -= t * v; swap(u, v); ...
#include <algorithm> #include <iostream> #include <vector> using namespace std; const long long int MOD = 1e9 + 7; long long int modinv(long long int a, long long int m) { long long int b = m, u = 1, v = 0; while (b) { long long int t = a / b; a -= t * b; swap(a, b); u -= t * v; swap(u, v); ...
replace
44
45
44
45
0
p02804
C++
Time Limit Exceeded
#include <bits/stdc++.h> using namespace std; #define REP(i, n) for (long long i = 0; i < (n); i++) #define REP1(i, n) for (long long i = 1; i <= (n); i++) #define REP2D(i, j, h, w) \ for (long long i = 0; i < (h); i++) \ ...
#include <bits/stdc++.h> using namespace std; #define REP(i, n) for (long long i = 0; i < (n); i++) #define REP1(i, n) for (long long i = 1; i <= (n); i++) #define REP2D(i, j, h, w) \ for (long long i = 0; i < (h); i++) \ ...
replace
195
200
195
201
TLE
p02804
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; using ll = long long; using ld = long double; using pii = pair<int, int>; using pll = pair<ll, ll>; #define REP(i, n) for (int i = 0, i##_len = (n); i < i##_len; ++i) #define all(x) (x).begin(), (x).end() #define m0(x) memset(x, 0, sizeof(x)) int dx4[4] = {1, 0, -1, 0}, ...
#include <bits/stdc++.h> using namespace std; using ll = long long; using ld = long double; using pii = pair<int, int>; using pll = pair<ll, ll>; #define REP(i, n) for (int i = 0, i##_len = (n); i < i##_len; ++i) #define all(x) (x).begin(), (x).end() #define m0(x) memset(x, 0, sizeof(x)) int dx4[4] = {1, 0, -1, 0}, ...
replace
162
163
162
163
0
p02804
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; #define LL long long const int N = 1e5 + 11; const int mod = 1e9 + 7; int n, K; LL sum[N], a[N]; int fac[N], inv[N]; LL C(int n, int m) { return 1LL * fac[n] * inv[m] % mod * inv[n - m] % mod; } int main() { cin >> n >> K; fac[0] = fac[1] = inv[0] = inv[1] = 1; for (i...
#include <bits/stdc++.h> using namespace std; #define LL long long const int N = 1e5 + 11; const int mod = 1e9 + 7; int n, K; LL sum[N], a[N]; LL fac[N], inv[N]; LL C(int n, int m) { if (m > n) return 0; return 1LL * fac[n] * inv[m] % mod * inv[n - m] % mod; } int main() { cin >> n >> K; fac[0] = fac[1] = i...
replace
7
9
7
13
0
p02804
C++
Time Limit Exceeded
// #define NDEBUG #include <algorithm> #include <cstddef> #include <cstdint> #include <iostream> #include <utility> #include <vector> namespace n91 { using i8 = std::int_fast8_t; using i32 = std::int_fast32_t; using i64 = std::int_fast64_t; using u8 = std::uint_fast8_t; using u32 = std::uint_fast32_t; using u64 = std...
// #define NDEBUG #include <algorithm> #include <cstddef> #include <cstdint> #include <iostream> #include <utility> #include <vector> namespace n91 { using i8 = std::int_fast8_t; using i32 = std::int_fast32_t; using i64 = std::int_fast64_t; using u8 = std::uint_fast8_t; using u32 = std::uint_fast32_t; using u64 = std...
insert
135
135
135
136
TLE
p02804
C++
Time Limit Exceeded
#define _GLIBCXX_DEBUG #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 #define double long double using namespace st...
#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 #define double long double using namespace std; typedef long long li...
delete
0
1
0
0
TLE
p02804
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 y1 asdgh...
#include <bits/stdc++.h> using namespace std; #define fio \ ios_base::sync_with_stdio(false); \ cin.tie(0); \ cout.tie(0) #define y1 asdgh...
replace
57
70
57
60
0
p02804
C++
Memory Limit Exceeded
#include <bits/stdc++.h> using namespace std; #define lli long long int #define uli unsigned long long int #define INF 999999999999999999 #define rep(i, m, n) for (lli i = m; i < n; i++) #define rrep(i, m, n) for (lli i = m - 1; i >= n; i--) #define pb(n) push_back(n) #define UE(N) N.erase(unique(N.begin(), N.end()), N...
#include <bits/stdc++.h> using namespace std; #define lli long long int #define uli unsigned long long int #define INF 999999999999999999 #define rep(i, m, n) for (lli i = m; i < n; i++) #define rrep(i, m, n) for (lli i = m - 1; i >= n; i--) #define pb(n) push_back(n) #define UE(N) N.erase(unique(N.begin(), N.end()), N...
replace
21
22
21
22
MLE
p02804
C++
Runtime Error
#include <algorithm> #include <math.h> #include <queue> #include <stdio.h> #include <string> #include <vector> const long long mod = 1000000007; // const long long mod = 998244353; class Combination { int MAX; int mod; long long *kai; long long modpow(long long a, long long n) { long long res = 1; while...
#include <algorithm> #include <math.h> #include <queue> #include <stdio.h> #include <string> #include <vector> const long long mod = 1000000007; // const long long mod = 998244353; class Combination { int MAX; int mod; long long *kai; long long modpow(long long a, long long n) { long long res = 1; while...
replace
37
38
37
38
0
p02804
C++
Runtime Error
// #define _GLIBCXX_DEBUG #include <bits/stdc++.h> #define PI 3.14159265359 using namespace std; #define rep(i, n) for (ll i = 0; i < (ll)(n); i++) const long long INF = 1e+18 + 1; typedef long long ll; typedef vector<ll> vl; typedef vector<vector<ll>> vvl; typedef pair<ll, ll> P; typedef tuple<ll, ll, ll> T; const ll ...
// #define _GLIBCXX_DEBUG #include <bits/stdc++.h> #define PI 3.14159265359 using namespace std; #define rep(i, n) for (ll i = 0; i < (ll)(n); i++) const long long INF = 1e+18 + 1; typedef long long ll; typedef vector<ll> vl; typedef vector<vector<ll>> vvl; typedef pair<ll, ll> P; typedef tuple<ll, ll, ll> T; const ll ...
replace
16
17
16
17
0
p02804
C++
Runtime Error
#include <bits/stdc++.h> template <typename T> constexpr T modpow(T a, T n, T mod = 1000000007) { //(a^n)%MOD T ret = 1; while (n > 0) { if ((n & 1) != 0) { // n%2==1 ret = ret * a % mod; } a = a * a % mod; n = n / 2; } return ret; } std::vector<long long> fac; std::vector<long long> ifa...
#include <bits/stdc++.h> template <typename T> constexpr T modpow(T a, T n, T mod = 1000000007) { //(a^n)%MOD T ret = 1; while (n > 0) { if ((n & 1) != 0) { // n%2==1 ret = ret * a % mod; } a = a * a % mod; n = n / 2; } return ret; } std::vector<long long> fac; std::vector<long long> ifa...
replace
29
31
29
31
0
p02804
C++
Time Limit Exceeded
/* #region Head */ #pragma GCC optimize("Ofast") #pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native") #include <bits/stdc++.h> using namespace std; using ll = long long; using ull = unsigned long long; using ld = long double; using pll = pair<ll, ll>; using vll = vector<ll>; using vvll = vec...
/* #region Head */ #pragma GCC optimize("Ofast") #pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native") #include <bits/stdc++.h> using namespace std; using ll = long long; using ull = unsigned long long; using ld = long double; using pll = pair<ll, ll>; using vll = vector<ll>; using vvll = vec...
replace
295
300
295
306
TLE
p02804
C++
Time Limit Exceeded
#include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < (n); i++) #define ll long long #define MOD 1000000007 using namespace std; ll facs[(ll)1e5 + 10]; // x^n in mod ll modpow(ll x, ll n, ll mod) { if (n == 0) return 1; if (n % 2 == 0) { return modpow(x * x % mod, n / 2, mod) % mod; } else ...
#include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < (n); i++) #define ll long long #define MOD 1000000007 using namespace std; ll facs[(ll)1e5 + 10]; // x^n in mod ll modpow(ll x, ll n, ll mod) { if (n == 0) return 1; if (n % 2 == 0) { return modpow(x * x % mod, n / 2, mod) % mod; } else ...
replace
61
63
61
63
TLE
p02804
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; using i64 = int_fast64_t; #define rep(i, N) for (int(i) = 0; (i) < (N); (i)++) #define all(v) (v).begin(), (v).end() #define eb emplace_back struct mint { using i64 = int_fast64_t; i64 x; const i64 MOD = 1000000007; mint(i64 y = (i64)0) noexcept : x(y % MOD) { ...
#include <bits/stdc++.h> using namespace std; using i64 = int_fast64_t; #define rep(i, N) for (int(i) = 0; (i) < (N); (i)++) #define all(v) (v).begin(), (v).end() #define eb emplace_back struct mint { using i64 = int_fast64_t; i64 x; const i64 MOD = 1000000007; mint(const i64 y = (i64)0) noexcept : x(y) { ...
replace
12
13
12
15
-8
p02804
C++
Time Limit Exceeded
#include <bits/stdc++.h> using namespace std; #define ll long long #define lvector vector<ll> #define lque queue<ll> #define lpque priority_queue<ll> #define dlpque priority_queue<ll, lvector, greater<ll>> #define P pair<ll, ll> #define ALL(a) (a).begin(), (a).end() #define rep(i, n) for (ll(i) = 0; (i) < (n); ++(i)) #...
#include <bits/stdc++.h> using namespace std; #define ll long long #define lvector vector<ll> #define lque queue<ll> #define lpque priority_queue<ll> #define dlpque priority_queue<ll, lvector, greater<ll>> #define P pair<ll, ll> #define ALL(a) (a).begin(), (a).end() #define rep(i, n) for (ll(i) = 0; (i) < (n); ++(i)) #...
replace
36
45
36
44
TLE
p02804
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; const int N = 1e5 + 3, MOD = 1e9 + 7; long long f[N], cumNCK[N]; long long power(int b, int e) { long long ret = 1; while (e) { while (e % 2 == 0) { e /= 2; b = (1LL * b * b) % MOD; } --e; ret = (ret * b) % MOD; } return ret; } long long...
#include <bits/stdc++.h> using namespace std; const int N = 2e5 + 3, MOD = 1e9 + 7; long long f[N], cumNCK[N]; long long power(int b, int e) { long long ret = 1; while (e) { while (e % 2 == 0) { e /= 2; b = (1LL * b * b) % MOD; } --e; ret = (ret * b) % MOD; } return ret; } long long...
replace
3
4
3
4
0
p02804
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; typedef unsigned long long ull; typedef long long ll; typedef pair<int, int> pii; typedef pair<ll, ll> pll; typedef pair<double, double> pdd; const ull mod = 1e9 + 7; #define REP(i, n) for (int i = 0; i < (int)n; ++i) // debug #define dump(x) cerr << #x << " = " << (x) <<...
#include <bits/stdc++.h> using namespace std; typedef unsigned long long ull; typedef long long ll; typedef pair<int, int> pii; typedef pair<ll, ll> pll; typedef pair<double, double> pdd; const ull mod = 1e9 + 7; #define REP(i, n) for (int i = 0; i < (int)n; ++i) // debug #define dump(x) cerr << #x << " = " << (x) <<...
replace
73
74
73
74
0
p02804
C++
Time Limit Exceeded
#include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < (n); ++i) #define all(v) v.begin(), v.end() using namespace std; typedef long long ll; const int mod = 1000000007; struct mint { ll x; // typedef long long ll; mint(ll x = 0) : x((x % mod + mod) % mod) {} mint &operator+=(const mint a) { if ((x +...
#include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < (n); ++i) #define all(v) v.begin(), v.end() using namespace std; typedef long long ll; const int mod = 1000000007; struct mint { ll x; // typedef long long ll; mint(ll x = 0) : x((x % mod + mod) % mod) {} mint &operator+=(const mint a) { if ((x +...
delete
93
94
93
93
TLE
p02804
C++
Time Limit Exceeded
#include <bits/stdc++.h> #define ull long long using namespace std; long long fac[100005]; long long infact[100005]; ull mul(ull a, ull b, ull c) { ull dev = 0, tmp = a % c; while (b) { if (b & 1) if ((dev += tmp) >= c) dev -= c; if ((tmp <<= 1) >= c) tmp -= c; b >>= 1; } retur...
#include <bits/stdc++.h> #define ull long long using namespace std; long long fac[100005]; long long infact[100005]; ull mul(ull a, ull b, ull c) { return ((a % c) * (b % c)) % c; } ull exp(ull a, ull b, ull c) { if (b == 0) return 1; ull dev = exp(a, b >> 1, c); dev = mul(dev, dev, c); if (b & 1) dev...
replace
7
19
7
8
TLE
p02804
C++
Runtime Error
// Problem : E - Max-Min Sums // Contest : AtCoder Beginner Contest 151 // URL : https://atcoder.jp/contests/abc151/tasks/abc151_e // Memory Limit : 1024.000000 MB // Time Limit : 2000.000000 milisec // Powered by CP Editor (https://github.com/coder3101/cp-editor) #include <bits/stdc++.h> using namespace std; int N...
// Problem : E - Max-Min Sums // Contest : AtCoder Beginner Contest 151 // URL : https://atcoder.jp/contests/abc151/tasks/abc151_e // Memory Limit : 1024.000000 MB // Time Limit : 2000.000000 milisec // Powered by CP Editor (https://github.com/coder3101/cp-editor) #include <bits/stdc++.h> using namespace std; int N...
insert
44
44
44
47
0
p02804
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; using llong = long long int; #define rep(i, n) for (int i = 0; i < (n); ++i) #define stl_rep(itr, x) for (auto itr = x.begin(); itr != x.end(); ++itr) #define all(x) x.begin(), x.end() #define allr(x) x.rbegin(), x.rend() const int MOD = 1000000007; const int INF = 10000...
#include <bits/stdc++.h> using namespace std; using llong = long long int; #define rep(i, n) for (int i = 0; i < (n); ++i) #define stl_rep(itr, x) for (auto itr = x.begin(); itr != x.end(); ++itr) #define all(x) x.begin(), x.end() #define allr(x) x.rbegin(), x.rend() const int MOD = 1000000007; const int INF = 10000...
replace
44
46
44
46
0
p02804
Python
Runtime Error
N, K = map(int, input().split()) A = list(map(int, input().split())) MOD = 10**9 + 7 inv_t = [0, 1] + [0] * (N - 2) for i in range(2, N): inv_t[i] = inv_t[MOD % i] * (MOD - MOD // i) % MOD A.sort() ans = 0 C = 1 for i in range(K, N + 1): ans += (A[i - 1] - A[N - i]) * C ans %= MOD C = C * i * inv_t[i ...
N, K = map(int, input().split()) A = list(map(int, input().split())) MOD = 10**9 + 7 inv_t = [0, 1] + [0] * (N - 1) for i in range(2, N + 1): inv_t[i] = inv_t[MOD % i] * (MOD - MOD // i) % MOD A.sort() ans = 0 C = 1 for i in range(K, N + 1): ans += (A[i - 1] - A[N - i]) * C ans %= MOD C = C * i * inv_...
replace
4
6
4
6
0
p02804
Python
Time Limit Exceeded
MOD = 10**9 + 7 def prepare(n): global MOD modFacts = [0] * (n + 1) modFacts[0] = 1 for i in range(n): modFacts[i + 1] = (modFacts[i] * (i + 1)) % MOD invs = [1] * (n + 1) invs[n] = pow(modFacts[n], MOD - 2, MOD) for i in range(n, 1, -1): invs[i - 1] = (invs[i] * i) % MOD ...
MOD = 10**9 + 7 def prepare(n): global MOD modFacts = [0] * (n + 1) modFacts[0] = 1 for i in range(n): modFacts[i + 1] = (modFacts[i] * (i + 1)) % MOD invs = [1] * (n + 1) invs[n] = pow(modFacts[n], MOD - 2, MOD) for i in range(n, 1, -1): invs[i - 1] = (invs[i] * i) % MOD ...
replace
31
37
31
46
TLE
p02804
Python
Time Limit Exceeded
N, K = map(int, input().split()) A = list(map(int, input().split())) MOD = 10**9 + 7 A.sort() factorial = [1] for i in range(1, N + 1): factorial.append(factorial[-1] * i) inv_factorial = [-1] * (N + 1) inv_factorial[-1] = pow(factorial[-1], MOD - 2, MOD) for i in reversed(range(N)): inv_factorial[i] = inv_fa...
N, K = map(int, input().split()) A = list(map(int, input().split())) MOD = 10**9 + 7 A.sort() factorial = [1] for i in range(1, N + 1): factorial.append(factorial[-1] * i % MOD) inv_factorial = [-1] * (N + 1) inv_factorial[-1] = pow(factorial[-1], MOD - 2, MOD) for i in reversed(range(N)): inv_factorial[i] = ...
replace
8
9
8
9
TLE
p02804
C++
Time Limit Exceeded
#include <stdio.h> #define _USE_MATH_DEFINES #include <algorithm> #include <math.h> #include <vector> using namespace std; const long nPrime = 1000000007; long Factorial(const long &n) { // nPrime = 1000000007; long nReturn = 1; for (long i = 2; i <= n; i++) { nReturn *= i; nReturn %= nPrime; } retur...
#include <stdio.h> #define _USE_MATH_DEFINES #include <algorithm> #include <math.h> #include <vector> using namespace std; const long nPrime = 1000000007; long Factorial(const long &n) { // nPrime = 1000000007; long nReturn = 1; for (long i = 2; i <= n; i++) { nReturn *= i; nReturn %= nPrime; } retur...
replace
64
65
64
65
TLE
p02805
C++
Time Limit Exceeded
#include <cmath> #include <cstdio> #include <iostream> #include <vector> using namespace std; typedef long long ll; typedef long double ld; const ll M = 2000000; const ld X = 0.6; const ld Y = 0.9999; ll n; ll x[55], y[55]; ld cx, cy; ld now = X; void f(ld p) { ld mx = 0; ll mi = 0; for (ll i = 0; i < n; i++)...
#include <cmath> #include <cstdio> #include <iostream> #include <vector> using namespace std; typedef long long ll; typedef long double ld; const ll M = 900000; const ld X = 0.6; const ld Y = 0.9999; ll n; ll x[55], y[55]; ld cx, cy; ld now = X; void f(ld p) { ld mx = 0; ll mi = 0; for (ll i = 0; i < n; i++) ...
replace
10
11
10
11
TLE
p02805
C++
Time Limit Exceeded
#include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < (int)(n); i++) using namespace std; using ll = long long; using P = pair<int, int>; using pll = pair<long long, long long>; constexpr int INF = 1e9; constexpr long long LINF = 1e17; constexpr int MOD = 1000000007; constexpr double PI = 3.1415926535897932384...
#include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < (int)(n); i++) using namespace std; using ll = long long; using P = pair<int, int>; using pll = pair<long long, long long>; constexpr int INF = 1e9; constexpr long long LINF = 1e17; constexpr int MOD = 1000000007; constexpr double PI = 3.1415926535897932384...
replace
167
169
167
169
TLE
p02805
C++
Time Limit Exceeded
#include <bits/stdc++.h> #define lli long long int #define ulli unsigned long long int #pragma GCC target("sse4.2") using namespace std; #define fast \ ios_base::sync_with_stdio(0); \ cin.tie(NULL); ...
#include <bits/stdc++.h> #define lli long long int #define ulli unsigned long long int #pragma GCC target("sse4.2") using namespace std; #define fast \ ios_base::sync_with_stdio(0); \ cin.tie(NULL); ...
replace
41
42
41
42
TLE
p02805
C++
Runtime Error
#include <algorithm> #include <bits/stdc++.h> #include <cstdio> #include <iostream> #include <map> #include <string> #include <vector> using namespace std; #define rep(i, x) for (ll i = 0; i < (ll)(x); i++) #define pb push_back #define eb emplace_back #define debug(x) cerr << #x << ": " << (x) << "\n"; #define all(x) (...
#include <algorithm> #include <bits/stdc++.h> #include <cstdio> #include <iostream> #include <map> #include <string> #include <vector> using namespace std; #define rep(i, x) for (ll i = 0; i < (ll)(x); i++) #define pb push_back #define eb emplace_back #define debug(x) cerr << #x << ": " << (x) << "\n"; #define all(x) (...
replace
115
116
115
130
0
p02805
C++
Time Limit Exceeded
#include <bits/stdc++.h> using namespace std; int x[55], y[55]; double distance(int I, int J) { return sqrt((x[I] - x[J]) * (x[I] - x[J]) + (y[I] - y[J]) * (y[I] - y[J])); } int main() { int n; cin >> n; double ans = 1e9; double tmp; double a, b, c; double A, B, C; queue<pair<double, double>> q; for...
#include <bits/stdc++.h> using namespace std; int x[55], y[55]; double distance(int I, int J) { return sqrt((x[I] - x[J]) * (x[I] - x[J]) + (y[I] - y[J]) * (y[I] - y[J])); } int main() { int n; cin >> n; double ans = 1e9; double tmp; double a, b, c; double A, B, C; queue<pair<double, double>> q; for...
insert
49
49
49
50
TLE
p02805
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; typedef long double ld; typedef long long ll; typedef complex<ld> P; #define EPS (1e-10) #define rep(i, n) for (int i = 0; i < n; i++) ld dist(P c1, P c2) { return sqrt((c1.real() - c2.real()) * (c1.real() - c2.real()) + (c1.imag() - c2.imag()) * (c1.ima...
#include <bits/stdc++.h> using namespace std; typedef long double ld; typedef long long ll; typedef complex<ld> P; #define EPS (1e-10) #define rep(i, n) for (int i = 0; i < n; i++) ld dist(P c1, P c2) { return sqrt((c1.real() - c2.real()) * (c1.real() - c2.real()) + (c1.imag() - c2.imag()) * (c1.ima...
replace
91
93
91
92
0
p02805
C++
Time Limit Exceeded
#include <bits/stdc++.h> using namespace std; vector<int> xs, ys; double dist(double x, double y) { double ans = 0; for (int i = 0; i < xs.size(); i++) { double dx = x - xs.at(i), dy = y - ys.at(i); ans = max(ans, sqrt(dx * dx + dy * dy)); } return ans; } int main() { int n; cin >> n; for (int ...
#include <bits/stdc++.h> using namespace std; vector<int> xs, ys; double dist(double x, double y) { double ans = 0; for (int i = 0; i < xs.size(); i++) { double dx = x - xs.at(i), dy = y - ys.at(i); ans = max(ans, sqrt(dx * dx + dy * dy)); } return ans; } int main() { int n; cin >> n; for (int ...
replace
25
26
25
26
TLE
p02805
C++
Time Limit Exceeded
#include "algorithm" #include "iostream" #include "math.h" #include "queue" #include "stack" #include "stdio.h" #include "stdlib.h" #include "string.h" #include "vector" #define M 522 #define inf 100000000 #define eps 1e-8 #define PI acos(-1.0) using namespace std; double X, Y; struct Point { double x, y; } p[M]; str...
#include "algorithm" #include "iostream" #include "math.h" #include "queue" #include "stack" #include "stdio.h" #include "stdlib.h" #include "string.h" #include "vector" #define M 522 #define inf 100000000 #define eps 1e-8 #define PI acos(-1.0) using namespace std; double X, Y; struct Point { double x, y; } p[M]; str...
replace
85
90
85
89
TLE
p02805
C++
Time Limit Exceeded
#include <algorithm> #include <math.h> #include <queue> #include <stdio.h> #include <string> #include <vector> const long long mod = 1000000007; // const long long mod = 998244353; double dist(double x1, double y1, double x2, double y2) { return sqrt(((x1) - (x2)) * ((x1) - (x2)) + ((y1) - (y2)) * ((y1) - (y2))); } ...
#include <algorithm> #include <math.h> #include <queue> #include <stdio.h> #include <string> #include <vector> const long long mod = 1000000007; // const long long mod = 998244353; double dist(double x1, double y1, double x2, double y2) { return sqrt(((x1) - (x2)) * ((x1) - (x2)) + ((y1) - (y2)) * ((y1) - (y2))); } ...
delete
78
80
78
78
TLE
p02805
C++
Time Limit Exceeded
#include <bits/stdc++.h> #include <ext/pb_ds/assoc_container.hpp> #include <ext/pb_ds/tree_policy.hpp> #pragma GCC optimize("unroll-loops,no-stack-protector") #pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native") using namespace __gnu_pbds; using namespace std; template <typename T> using orde...
#include <bits/stdc++.h> #include <ext/pb_ds/assoc_container.hpp> #include <ext/pb_ds/tree_policy.hpp> #pragma GCC optimize("unroll-loops,no-stack-protector") #pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native") using namespace __gnu_pbds; using namespace std; template <typename T> using orde...
replace
44
45
44
45
TLE
p02805
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; // #define int long long #define rep(i, n) for (long long i = (long long)(0); i < (long long)(n); ++i) #define reps(i, n) for (long long i = (long long)(1); i <= (long long)(n); ++i) #define rrep(i, n) for (long long i = ((long long)(n)-1); i >= 0; i--) #define rreps(i, n)...
#include <bits/stdc++.h> using namespace std; // #define int long long #define rep(i, n) for (long long i = (long long)(0); i < (long long)(n); ++i) #define reps(i, n) for (long long i = (long long)(1); i <= (long long)(n); ++i) #define rrep(i, n) for (long long i = ((long long)(n)-1); i >= 0; i--) #define rreps(i, n)...
replace
165
166
165
166
0
p02805
C++
Time Limit Exceeded
/* FFFFFFFFFFFFFFFFFFFFFF F::::::::::::::::::::F F::::::::::::::::::::F FF::::::FFFFFFFFF::::F F:::::F FFFFFF F:::::F F::::::FFFFFFFFFF F:::::::::::::::F F:::::::::::::::F F::::::FFFFFFFFFF F:::::F F:::...
/* FFFFFFFFFFFFFFFFFFFFFF F::::::::::::::::::::F F::::::::::::::::::::F FF::::::FFFFFFFFF::::F F:::::F FFFFFF F:::::F F::::::FFFFFFFFFF F:::::::::::::::F F:::::::::::::::F F::::::FFFFFFFFFF F:::::F F:::...
replace
167
168
167
168
TLE
p02805
C++
Time Limit Exceeded
#include <algorithm> #include <cmath> #include <iomanip> #include <iostream> #include <vector> using namespace std; using point = pair<double, double>; double l2_dist(point p1, point p2) { double dx = p1.first - p2.first, dy = p1.second - p2.second; return sqrt(dx * dx + dy * dy); } int main() { int N; cin >>...
#include <algorithm> #include <cmath> #include <iomanip> #include <iostream> #include <vector> using namespace std; using point = pair<double, double>; double l2_dist(point p1, point p2) { double dx = p1.first - p2.first, dy = p1.second - p2.second; return sqrt(dx * dx + dy * dy); } int main() { int N; cin >>...
replace
36
37
36
37
TLE
p02806
C++
Time Limit Exceeded
#include <bits/stdc++.h> using namespace std; #define rep(i, n) for (int i = 0; i < n; i++) #define rep1(i, n) for (int i = 1; i <= n; i++) typedef long long ll; int main() { int n, t[55]; int ans = 0; string x, s[55]; cin >> n; rep(i, n) { cin >> s[i] >> t[i]; } cin >> x; rep(i, n) { for (i = n - 1...
#include <bits/stdc++.h> using namespace std; #define rep(i, n) for (int i = 0; i < n; i++) #define rep1(i, n) for (int i = 1; i <= n; i++) typedef long long ll; int main() { int n, t[55]; int ans = 0; string x, s[55]; cin >> n; rep(i, n) { cin >> s[i] >> t[i]; } cin >> x; for (int i = n - 1; i >= 0; i-...
replace
14
20
14
18
TLE
p02806
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; int main() { int n, m = 0; cin >> n; vector<pair<string, int>> a(n); for (int i = 0; i < n; i++) cin >> a.at(n).first >> a.at(n).second; string s; cin >> s; for (int i = 0; i < n; i++) { if (i < n - 1 && a.at(i).first == s) { for (int j = i + 1; ...
#include <bits/stdc++.h> using namespace std; int main() { int n, m = 0; cin >> n; vector<pair<string, int>> a(n); for (int i = 0; i < n; i++) cin >> a.at(i).first >> a.at(i).second; string s; cin >> s; for (int i = 0; i < n; i++) { if (i < n - 1 && a.at(i).first == s) { for (int j = i + 1; ...
replace
7
8
7
8
-6
terminate called after throwing an instance of 'std::out_of_range' what(): vector::_M_range_check: __n (which is 3) >= this->size() (which is 3)