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
p03162
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; // #pragma GCC optimize("O3") // #pragma GCC optimize("unroll-loops") // #pragma GCC target("avx,avx2,fma") typedef long long ll; typedef unsigned long long ull; typedef vector<int> vi; typedef vector<ll> vll; typedef pair<int, int> pii; typedef pair<ll, int> pli; typedef...
#include <bits/stdc++.h> using namespace std; // #pragma GCC optimize("O3") // #pragma GCC optimize("unroll-loops") // #pragma GCC target("avx,avx2,fma") typedef long long ll; typedef unsigned long long ull; typedef vector<int> vi; typedef vector<ll> vll; typedef pair<int, int> pii; typedef pair<ll, int> pli; typedef...
replace
62
63
62
63
0
p03162
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; #define int long long #define endl "\n" const int N = 1e5 + 5; int a[5][N]; int dp[5][N]; int n; int solve(int idx, int prev) { if (idx == n + 1) { return 0; } int &ans = dp[prev][idx]; if (ans != -1) { return ans; } ans = 0; for (int i = 1; i <...
#include <bits/stdc++.h> using namespace std; #define int long long #define endl "\n" const int N = 1e5 + 5; int a[5][N]; int dp[5][N]; int n; int solve(int idx, int prev) { if (idx == n + 1) { return 0; } int &ans = dp[prev][idx]; if (ans != -1) { return ans; } ans = 0; for (int i = 1; i <...
replace
41
42
41
42
0
p03162
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; #define int long long int const int maxn = 1e5 + 5; const int inf = 1e10; vector<vector<int>> dp(maxn, vector<int>(3, inf)); vector<int> a(maxn), b(maxn), c(maxn); int n; int32_t main() { #ifndef ONLINE_JUDGE freopen("input.txt", "r", stdin); freopen("output.txt", "w...
#include <bits/stdc++.h> using namespace std; #define int long long int const int maxn = 1e5 + 5; const int inf = 1e10; vector<vector<int>> dp(maxn, vector<int>(3, inf)); vector<int> a(maxn), b(maxn), c(maxn); int n; int32_t main() { // #ifndef ONLINE_JUDGE // freopen("input.txt", "r", stdin); // freopen("outp...
replace
12
16
12
16
-11
p03162
C++
Runtime Error
/** * @author: Kshitiz Srivastava (Pirate_ksh) @ MNNIT Allahabad */ #include <bits/stdc++.h> using namespace std; // General #define ll long long #define io \ ios_base::sync_with_stdio(false); \ cin.t...
/** * @author: Kshitiz Srivastava (Pirate_ksh) @ MNNIT Allahabad */ #include <bits/stdc++.h> using namespace std; // General #define ll long long #define io \ ios_base::sync_with_stdio(false); \ cin.t...
delete
272
279
272
272
-11
p03162
C++
Runtime Error
#include <algorithm> #include <assert.h> #include <bitset> #include <cassert> #include <cctype> #include <climits> #include <cmath> #include <complex> #include <cstdio> #include <cstdlib> #include <cstring> #include <ctime> #include <deque> #include <fstream> #include <functional> #include <iomanip> #include <iosfwd> #...
#include <algorithm> #include <assert.h> #include <bitset> #include <cassert> #include <cctype> #include <climits> #include <cmath> #include <complex> #include <cstdio> #include <cstdlib> #include <cstring> #include <ctime> #include <deque> #include <fstream> #include <functional> #include <iomanip> #include <iosfwd> #...
replace
44
45
44
45
0
p03162
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; int main() { int n; int h[10005][3]; int dp[10005][3]; cin >> n; for (int i = 0; i < n; i++) { cin >> h[i][0] >> h[i][1] >> h[i][2]; } memset(dp, INT_MIN, sizeof(dp)); dp[0][0] = h[0][0]; dp[0][1] = h[0][1]; dp[0][2] = h[0][2]; for (int day = ...
#include <bits/stdc++.h> using namespace std; int main() { int n; int h[100100][3]; int dp[100100][3]; cin >> n; for (int i = 0; i < n; i++) { cin >> h[i][0] >> h[i][1] >> h[i][2]; } memset(dp, INT_MIN, sizeof(dp)); dp[0][0] = h[0][0]; dp[0][1] = h[0][1]; dp[0][2] = h[0][2]; for (int day ...
replace
6
8
6
8
0
p03162
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; #define IOS \ ios::sync_with_stdio(0); \ cin.tie(0); \ cout.tie(0); #define endl "\...
#include <bits/stdc++.h> using namespace std; #define IOS \ ios::sync_with_stdio(0); \ cin.tie(0); \ cout.tie(0); #define endl "\...
replace
45
47
45
48
0
p03162
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; #define ll long long int int n, a[100001], b[100001], c[100001]; ll dp[3][100001]; ll call(int i, int key) { if (dp[key][i]) return dp[key][i]; if (i == n - 1) { if (key == 0) return dp[key][i] = max(b[i], c[i]); else if (key == 1) return dp[k...
#include <bits/stdc++.h> using namespace std; #define ll long long int int n, a[100001], b[100001], c[100001]; ll dp[3][100001]; ll call(int i, int key) { if (dp[key][i]) return dp[key][i]; if (i > n - 1) return 0; if (i == n - 1) { if (key == 0) return dp[key][i] = max(b[i], c[i]); else ...
insert
11
11
11
13
0
p03162
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; const int mod = 1e9 + 7; long long add(long long a, long long b) { long long res = a + b; if (res >= mod) res -= mod; return res; } long long sub(long long a, long long b) { long long res = a - b + mod; if (res >= mod) res -= mod; return res; } long...
#include <bits/stdc++.h> using namespace std; const int mod = 1e9 + 7; long long add(long long a, long long b) { long long res = a + b; if (res >= mod) res -= mod; return res; } long long sub(long long a, long long b) { long long res = a - b + mod; if (res >= mod) res -= mod; return res; } long...
replace
84
85
84
85
0
p03162
C++
Runtime Error
#include <algorithm> #include <iostream> using namespace std; long long dp[10010][3]; long long a[10010][3]; int main() { int N; cin >> N; for (int i = 0; i < N; i++) { for (int j = 0; j < 3; j++) { cin >> a[i][j]; } } for (int i = 0; i < N; i++) { for (int j = 0; j < 3; j++) { for...
#include <algorithm> #include <iostream> using namespace std; long long dp[100100][3]; long long a[100100][3]; int main() { int N; cin >> N; for (int i = 0; i < N; i++) { for (int j = 0; j < 3; j++) { cin >> a[i][j]; } } for (int i = 0; i < N; i++) { for (int j = 0; j < 3; j++) { f...
replace
6
8
6
8
0
p03162
C++
Runtime Error
#include <iostream> #include <vector> using namespace std; const int MAXN = 1e5; const int INF = 1e9 - 7; typedef long long ll; ll dp[MAXN][4]; int n; vector<ll> a, b, c; ll happy(ll N, ll K) { if (N == 0) return 0; if (dp[N][K] != -1) return dp[N][K]; if (K == 3) return dp[N][K] = max(happy(N - 1, ...
#include <iostream> #include <vector> using namespace std; const int MAXN = 1e5; const int INF = 1e9 - 7; typedef long long ll; ll dp[MAXN + 2][4]; int n; vector<ll> a, b, c; ll happy(ll N, ll K) { if (N == 0) return 0; if (dp[N][K] != -1) return dp[N][K]; if (K == 3) return dp[N][K] = max(happy(N -...
replace
7
8
7
8
0
p03162
C++
Time Limit Exceeded
// #include <bits/stdc++.h> #include "bits/stdc++.h" #define rep(i, n) for (int i = 0; i < (n); ++i) using namespace std; typedef long long ll; typedef pair<int, int> P; typedef vector<int> VI; typedef vector<VI> VVI; // 例: VVI dp(10, vector<int>(10, INF); typedef priority_queue<int, vector<int>, less<int>> QUE_int; co...
// #include <bits/stdc++.h> #include "bits/stdc++.h" #define rep(i, n) for (int i = 0; i < (n); ++i) using namespace std; typedef long long ll; typedef pair<int, int> P; typedef vector<int> VI; typedef vector<VI> VVI; // 例: VVI dp(10, vector<int>(10, INF); typedef priority_queue<int, vector<int>, less<int>> QUE_int; co...
replace
35
36
35
36
TLE
p03162
C++
Runtime Error
// // main.cpp // C - Vacation // // Created by Hashizo on 2019/06/12. // #include <algorithm> #include <iostream> #include <regex> #include <string> #include <vector> using namespace std; #undef INT_MAX #undef INT_MIN #define INT_MAX 2147483647 #define INT_MIN (-INT_MAX - 1) #define FOR(i, a, b) for (int i = (...
// // main.cpp // C - Vacation // // Created by Hashizo on 2019/06/12. // #include <algorithm> #include <iostream> #include <regex> #include <string> #include <vector> using namespace std; #undef INT_MAX #undef INT_MIN #define INT_MAX 2147483647 #define INT_MIN (-INT_MAX - 1) #define FOR(i, a, b) for (int i = (...
replace
30
32
30
32
0
p03162
C++
Time Limit Exceeded
#define nl "\n" #define ll long long #define ull unsigned long long #define pb push_back #define SIZE(a) (int)a.size() #define SORT(v) sort(v.begin(), v.end()) #define RSORT(v) sort(v.rbegin(), v.rend()) #define REV(v) reverse(v.begin(), v.end()) #define ff first #define ss second #define sq(a) ((a) * (a)) #define For(...
#define nl "\n" #define ll long long #define ull unsigned long long #define pb push_back #define SIZE(a) (int)a.size() #define SORT(v) sort(v.begin(), v.end()) #define RSORT(v) sort(v.rbegin(), v.rend()) #define REV(v) reverse(v.begin(), v.end()) #define ff first #define ss second #define sq(a) ((a) * (a)) #define For(...
replace
25
26
25
26
TLE
p03162
C++
Runtime Error
#include <algorithm> #include <iostream> #include <vector> using namespace std; int main() { ios::sync_with_stdio(false); cin.tie(0); int n; cin >> n; vector<vector<int>> dp(n, vector<int>(3)); for (int &i : dp.at(0)) { cin >> i; } for (int i = 1; i < n; ++i) { for (int &i : dp.at(i)) { c...
#include <algorithm> #include <iostream> #include <vector> using namespace std; int main() { ios::sync_with_stdio(false); cin.tie(0); int n; cin >> n; vector<vector<int>> dp(n, vector<int>(3)); for (int &i : dp.at(0)) { cin >> i; } for (int i = 1; i < n; ++i) { for (int &j : dp.at(i)) { c...
replace
15
17
15
17
0
p03162
C++
Time Limit Exceeded
#include <bits/stdc++.h> using namespace std; #define ll long long #define F first #define S second int dx[] = {0, 0, 1, -1, -1, -1, 1, 1}; int dy[] = {1, -1, 0, 0, 1, -1, 1, -1}; const double EPS = 1e-8; const double PI = acos(-1.0); #define inf INT_MAX ll gcd(ll a, ll b) { return !b ? a : gcd(b, a % b); } ll lcm(ll...
#include <bits/stdc++.h> using namespace std; #define ll long long #define F first #define S second int dx[] = {0, 0, 1, -1, -1, -1, 1, 1}; int dy[] = {1, -1, 0, 0, 1, -1, 1, -1}; const double EPS = 1e-8; const double PI = acos(-1.0); #define inf INT_MAX ll gcd(ll a, ll b) { return !b ? a : gcd(b, a % b); } ll lcm(ll...
insert
29
29
29
31
TLE
p03162
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; #define FASTIO ios_base::sync_with_stdio(false), cin.tie(0), cout.tie(0); #define ll long long #define pb push_back #define F first #define S second #define ld long double #define vi vector<ll> const int INF = 1e9; const int N = 100005; vi dp(3); void solve() { ll n; c...
#include <bits/stdc++.h> using namespace std; #define FASTIO ios_base::sync_with_stdio(false), cin.tie(0), cout.tie(0); #define ll long long #define pb push_back #define F first #define S second #define ld long double #define vi vector<ll> const int INF = 1e9; const int N = 100005; vi dp(3); void solve() { ll n; c...
replace
37
45
37
45
0
p03162
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; typedef vector<int> vi; typedef pair<int, int> pi; typedef long long ll; #define F first #define S second #define PB push_back #define MP make_pair #define REP(i, a, b) for (int i = a; i <= b; i++) vector<vector<ll>> dp; int main() { ll n, a, b, c; cin >> n; dp....
#include <bits/stdc++.h> using namespace std; typedef vector<int> vi; typedef pair<int, int> pi; typedef long long ll; #define F first #define S second #define PB push_back #define MP make_pair #define REP(i, a, b) for (int i = a; i <= b; i++) vector<vector<ll>> dp; int main() { ll n, a, b, c; cin >> n; dp....
replace
20
27
20
21
0
p03162
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; typedef unsigned long long ull; typedef long long ll; #define fastio() \ ios_base::sync_with_stdio(0); \ cin.tie(0); ...
#include <bits/stdc++.h> using namespace std; typedef unsigned long long ull; typedef long long ll; #define fastio() \ ios_base::sync_with_stdio(0); \ cin.tie(0); ...
replace
29
34
29
34
-11
p03162
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; typedef long long ll; int dp[1000][3]; int main() { int n; cin >> n; for (int i = 1; i <= n; i++) { vector<int> v(3); for (int j = 0; j < 3; j++) cin >> v[j]; dp[i][0] = v[0] + max(dp[i - 1][1], dp[i - 1][2]); dp[i][1] = v[1] + max(dp[i - 1][0...
#include <bits/stdc++.h> using namespace std; typedef long long ll; int dp[100007][3]; int main() { int n; cin >> n; for (int i = 1; i <= n; i++) { vector<int> v(3); for (int j = 0; j < 3; j++) cin >> v[j]; dp[i][0] = v[0] + max(dp[i - 1][1], dp[i - 1][2]); dp[i][1] = v[1] + max(dp[i - 1]...
replace
4
5
4
5
0
p03162
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; #define vi vector<int> #define all(x) (x).begin(), (x).end() #define F first #define S second #define pb push_back #define pp pair<int, int> #define rep(i, l, r) for (int i = l; i < r; i++) int main() { #ifndef ONLINE_JUDGE freopen("input.txt.txt", "r", stdin); freopen(...
#include <bits/stdc++.h> using namespace std; #define vi vector<int> #define all(x) (x).begin(), (x).end() #define F first #define S second #define pb push_back #define pp pair<int, int> #define rep(i, l, r) for (int i = l; i < r; i++) int main() { // #ifndef ONLINE_JUDGE // freopen("input.txt.txt","r",stdin); //...
replace
10
14
10
14
0
p03162
C++
Runtime Error
// // main.cpp // test130 // // Created by on 2019/06/16. // Copyright © 2 All rights reserved. // // // main.cpp // new // // Created on 2019/06/09. // Copyright All rights reserved. // // C++ includes used for precompiling -*- C++ -*- // Copyright (C) 2003-2013 Free Software Foundation, Inc. // // This fi...
// // main.cpp // test130 // // Created by on 2019/06/16. // Copyright © 2 All rights reserved. // // // main.cpp // new // // Created on 2019/06/09. // Copyright All rights reserved. // // C++ includes used for precompiling -*- C++ -*- // Copyright (C) 2003-2013 Free Software Foundation, Inc. // // This fi...
replace
137
138
137
138
0
p03162
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; typedef long long ll; typedef vector<int> vi; typedef pair<int, int> pi; typedef vector<vector<int>> vvi; #define ff first #define ss second #define pb push_back #define mp make_pair #define rep(i, a, b) for (int i = a; i <= b; i++) const int INF = INT_MAX; int fact[9]; ...
#include <bits/stdc++.h> using namespace std; typedef long long ll; typedef vector<int> vi; typedef pair<int, int> pi; typedef vector<vector<int>> vvi; #define ff first #define ss second #define pb push_back #define mp make_pair #define rep(i, a, b) for (int i = a; i <= b; i++) const int INF = INT_MAX; int fact[9]; ...
delete
20
25
20
20
0
p03162
C++
Runtime Error
#include "bits/stdc++.h" using namespace std; #define FOR(i, a, b) for (int i = (a); i < (b); ++i) #define REP0(i, n) for (int i = 0, i##_len = (n); i < i##_len; ++i) #define REP1(i, n) for (int i = 1, i##_len = (n); i <= i##_len; ++i) typedef long long LL; typedef pair<int, int> pii; const int INTINF = 1e9; const L...
#include "bits/stdc++.h" using namespace std; #define FOR(i, a, b) for (int i = (a); i < (b); ++i) #define REP0(i, n) for (int i = 0, i##_len = (n); i < i##_len; ++i) #define REP1(i, n) for (int i = 1, i##_len = (n); i <= i##_len; ++i) typedef long long LL; typedef pair<int, int> pii; const int INTINF = 1e9; const L...
replace
15
17
15
17
0
p03162
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; #define INF 1e9 #define MAX 1005 #define xx first #define yy second #define pb push_back #define mp make_pair #define ull long long #define FOR(i, a, b) for (int i = a; i <= b; i++) #define nl '\n' #define zai << ' ' << #define all(a) a.begin(), a.end() typedef vector<int>...
#include <bits/stdc++.h> using namespace std; #define INF 1e9 #define MAX 100005 #define xx first #define yy second #define pb push_back #define mp make_pair #define ull long long #define FOR(i, a, b) for (int i = a; i <= b; i++) #define nl '\n' #define zai << ' ' << #define all(a) a.begin(), a.end() typedef vector<in...
replace
4
5
4
5
0
p03162
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 = 1001001001; int main() { int n; cin >> n; vector<vector<int>> h(n, vector<int>(3)); rep(i, n) { rep(j, 3) { cin >> h.at(i).at(j); } } vector<vector<int>> dp(n, vector<int...
#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 = 1001001001; int main() { int n; cin >> n; vector<vector<int>> h(n, vector<int>(3)); rep(i, n) { rep(j, 3) { cin >> h.at(i).at(j); } } vector<vector<int>> dp(n, vector<int...
replace
19
20
19
20
0
p03162
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; #define For(i, m, n) for (int i = m; i < n; i++) #define FOR(i, n) for (int i = 0; i < n; i++) #define ll long long #define ull unsigned long long #define lli long long int #define pb push_back ll mob = 1000000007; using namespace std; ll dp[11000][3]; int main() { int n...
#include <bits/stdc++.h> using namespace std; #define For(i, m, n) for (int i = m; i < n; i++) #define FOR(i, n) for (int i = 0; i < n; i++) #define ll long long #define ull unsigned long long #define lli long long int #define pb push_back ll mob = 1000000007; using namespace std; ll dp[1000000][3]; int main() { int...
replace
10
11
10
11
0
p03162
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; using ll = long long; using ld = long double; using Pair = pair<int, int>; using Graph = vector<vector<int>>; #define MOD 1000000007 #define INF 1000000007 #define SEP " " int main() { int n; cin >> n; vector<int> a(n), b(n), c(n); for (int i = 0; i < n; i++) { ...
#include <bits/stdc++.h> using namespace std; using ll = long long; using ld = long double; using Pair = pair<int, int>; using Graph = vector<vector<int>>; #define MOD 1000000007 #define INF 1000000007 #define SEP " " int main() { int n; cin >> n; vector<int> a(n), b(n), c(n); for (int i = 0; i < n; i++) { ...
replace
17
18
17
18
0
p03162
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; #define ll long long #define ull unsigned long long #define ld long double #define fi first #define se second #define pb push_back #define mp make_pair ll mod = 1e9 + 7; ll a[200005]; ll b[200005]; ll idx[100005][2]; // ll cnt[200005]; ll pre[200005]; // ll end[200005]; m...
#include <bits/stdc++.h> using namespace std; #define ll long long #define ull unsigned long long #define ld long double #define fi first #define se second #define pb push_back #define mp make_pair ll mod = 1e9 + 7; ll a[200005]; ll b[200005]; ll idx[100005][2]; // ll cnt[200005]; ll pre[200005]; // ll end[200005]; m...
delete
80
83
80
80
0
p03162
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; typedef long long int lli; int main() { cin.tie(0); ios::sync_with_stdio(false); int n; vector<int> a(10000), b(100000), c(100000); vector<vector<int>> dp(3, vector<int>(100000, 0)); cin >> n; for (int i = 0; i < n; i++) cin >> a[i] >> b[i] >> c[i]; ...
#include <bits/stdc++.h> using namespace std; typedef long long int lli; int main() { cin.tie(0); ios::sync_with_stdio(false); int n; vector<int> a(100000), b(100000), c(100000); vector<vector<int>> dp(3, vector<int>(100000, 0)); cin >> n; for (int i = 0; i < n; i++) cin >> a[i] >> b[i] >> c[i]; ...
replace
11
12
11
12
0
p03162
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; template <class T> inline bool chmax(T &a, const T b) { if (a < b) { a = b; return true; } return false; } const long INF = -(1L << 60); int a[10010][3]; long dp[100010][3]; int main() { int n; scanf("%d", &n); for (int i = 0; i < n; i++) { for (...
#include <bits/stdc++.h> using namespace std; template <class T> inline bool chmax(T &a, const T b) { if (a < b) { a = b; return true; } return false; } const long INF = -(1L << 60); int a[100010][3]; long dp[100010][3]; int main() { int n; scanf("%d", &n); for (int i = 0; i < n; i++) { for ...
replace
13
14
13
14
0
p03162
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; int main() { int n; cin >> n; vector<vector<long long>> v(n + 1, vector<long long>(n + 1)), dp(n + 1, vector<long long>(n + 1)); for (int i = 0; i < n; i++) { for (int j = 0; j < 3; j++) { cin >> v[i][j]; } } long long ans = INT_MIN; fo...
#include <bits/stdc++.h> using namespace std; int main() { int n; cin >> n; vector<vector<long long>> v(n + 1, vector<long long>(4)), dp(n + 1, vector<long long>(4)); for (int i = 0; i < n; i++) { for (int j = 0; j < 3; j++) { cin >> v[i][j]; } } long long ans = INT_MIN; for (int i...
replace
8
10
8
10
0
p03162
C++
Time Limit Exceeded
#include <bits/stdc++.h> using namespace std; #define rep(i, n) for (int i = 0; i < n; i++) #define repr(i, n) for (int i = n - 1; i >= 0; i--) #define ALL(x) x.begin(), x.end() using ll = long long; using pii = pair<int, int>; using vi = vector<int>; const int mod = 1e9 + 7; const ll INF = 1e9; const int MAX = 1e5;...
#include <bits/stdc++.h> using namespace std; #define rep(i, n) for (int i = 0; i < n; i++) #define repr(i, n) for (int i = n - 1; i >= 0; i--) #define ALL(x) x.begin(), x.end() using ll = long long; using pii = pair<int, int>; using vi = vector<int>; const int mod = 1e9 + 7; const ll INF = 1e9; const int MAX = 1e5;...
replace
38
39
38
39
TLE
p03162
C++
Time Limit Exceeded
#include <bits/stdc++.h> #define endl '\n' using namespace std; int a[100001][3], dp[100001][3]; int n; int ans = 0; int solve(int i, int j) { if (i == n) return 0; if (j == 0) { return dp[i][j] = max(solve(i + 1, 1) + a[i][1], solve(i + 1, 2) + a[i][2]); } else if (j == 1) { return dp[i][j] = max(so...
#include <bits/stdc++.h> #define endl '\n' using namespace std; int a[100001][3], dp[100001][3]; int n; int ans = 0; int solve(int i, int j) { if (i == n) return 0; if (dp[i][j] != -1) return dp[i][j]; if (j == 0) { return dp[i][j] = max(solve(i + 1, 1) + a[i][1], solve(i + 1, 2) + a[i][2]); } else...
insert
10
10
10
12
TLE
p03162
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; int dp[2][100000]; int main() { int n; cin >> n; for (int i = 1; i <= n; i++) { for (int j = 0; j < 3; j++) { cin >> dp[j][i]; } } for (int i = 2; i <= n; i++) { for (int j = 0; j < 3; j++) { dp[j][i] += max(dp[(j + 1) % 3][i - 1], dp[(...
#include <bits/stdc++.h> using namespace std; const int N = 1e5 + 10; int dp[3][N]; int main() { int n; cin >> n; for (int i = 1; i <= n; i++) { for (int j = 0; j < 3; j++) { cin >> dp[j][i]; } } for (int i = 2; i <= n; i++) { for (int j = 0; j < 3; j++) { dp[j][i] += max(dp[(j + ...
replace
3
4
3
6
0
p03162
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; int N; int a[100000], b[10000], c[100000]; int dp[10000][3]; signed main() { cin >> N; for (int i = 0; i < N; i++) cin >> a[i] >> b[i] >> c[i]; dp[0][0] = a[0]; dp[0][1] = b[0]; dp[0][2] = c[0]; for (int i = 1; i < N; i++) { dp[i][0] = a[i] + max(dp[...
#include <bits/stdc++.h> using namespace std; int N; int a[100000], b[100000], c[1000000]; int dp[100000][3]; signed main() { cin >> N; for (int i = 0; i < N; i++) cin >> a[i] >> b[i] >> c[i]; dp[0][0] = a[0]; dp[0][1] = b[0]; dp[0][2] = c[0]; for (int i = 1; i < N; i++) { dp[i][0] = a[i] + max(...
replace
4
6
4
6
0
p03162
C++
Runtime Error
#define _CRT_SECURE_NO_WARNINGS #include <algorithm> #include <ccomplex> #include <cmath> #include <cstdio> #include <cstdlib> #include <cstring> #include <functional> #include <iomanip> #include <iostream> #include <numeric> #include <set> #include <sstream> #include <tuple> #include <unordered_map> #include <vector> ...
#define _CRT_SECURE_NO_WARNINGS #include <algorithm> #include <ccomplex> #include <cmath> #include <cstdio> #include <cstdlib> #include <cstring> #include <functional> #include <iomanip> #include <iostream> #include <numeric> #include <set> #include <sstream> #include <tuple> #include <unordered_map> #include <vector> ...
replace
57
58
57
58
-6
*** stack smashing detected ***: terminated
p03162
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; int main() { int n; cin >> n; int arr[n][3]; int x = n; while (n--) cin >> arr[n - x - 1][0] >> arr[n - x - 1][1] >> arr[n - x - 1][2]; int dp[n][3]; dp[0][0] = arr[0][0]; dp[0][1] = arr[0][1]; dp[0][2] = arr[0][2]; for (int i = 1; i < n; i++) { ...
#include <bits/stdc++.h> using namespace std; int main() { int n; cin >> n; int arr[n][3]; int x = n; while (x--) cin >> arr[n - x - 1][0] >> arr[n - x - 1][1] >> arr[n - x - 1][2]; int dp[n][3]; dp[0][0] = arr[0][0]; dp[0][1] = arr[0][1]; dp[0][2] = arr[0][2]; for (int i = 1; i < n; i++) { ...
replace
8
9
8
9
-11
p03162
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; using ll = long long; using P = pair<ll, ll>; const ll INF = 1LL << 60; #define rep1(i, n) for (ll i = 0; i < (n); i++) #define rep2(i, k, n) for (ll i = k; i < (n); i++) using namespace std; template <class T> inline bool chmax(T &a, T b) { if (a < b) { a = b; re...
#include <bits/stdc++.h> using namespace std; using ll = long long; using P = pair<ll, ll>; const ll INF = 1LL << 60; #define rep1(i, n) for (ll i = 0; i < (n); i++) #define rep2(i, k, n) for (ll i = k; i < (n); i++) using namespace std; template <class T> inline bool chmax(T &a, T b) { if (a < b) { a = b; re...
replace
25
26
25
26
0
p03162
C++
Time Limit Exceeded
#include <bits/stdc++.h> using namespace std; vector<vector<int>> dp(100001, vector<int>(4, -1)); int dfs(vector<int> swim, vector<int> bugs, vector<int> homework, int index, int prev) { if (index == swim.size()) { return 0; } if (dp[index][prev] != -1) return dp[index][prev]; int happiness = 0...
#include <bits/stdc++.h> using namespace std; vector<vector<int>> dp(100001, vector<int>(4, -1)); int dfs(vector<int> &swim, vector<int> &bugs, vector<int> &homework, int index, int prev) { if (index == swim.size()) { return 0; } if (dp[index][prev] != -1) return dp[index][prev]; int happiness ...
replace
3
4
3
4
TLE
p03162
C++
Runtime Error
#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 + 1; i++) #define sort(A) sort(A.begin(), A.end()) #define reverse(A) reverse(A.begin(), A.end()); typedef long long ll; const ll MOD = 1000000007; int main() { int n; cin >> n; v...
#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 + 1; i++) #define sort(A) sort(A.begin(), A.end()) #define reverse(A) reverse(A.begin(), A.end()); typedef long long ll; const ll MOD = 1000000007; int main() { int n; cin >> n; v...
replace
15
16
15
16
-6
*** stack smashing detected ***: terminated
p03162
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; #define int long long int #define endl "\n" const int MOD = 1e9 + 7; #ifndef HOME #define cerr \ if (0) \ cerr #endif const int MaxN =...
#include <bits/stdc++.h> using namespace std; #define int long long int #define endl "\n" const int MOD = 1e9 + 7; #ifndef HOME #define cerr \ if (0) \ cerr #endif const int MaxN =...
replace
31
32
31
32
0
p03162
C++
Runtime Error
#include <bits/stdc++.h> #include <iostream> using namespace std; const int maxn = 1e4; int a[maxn][maxn]; int dp[maxn][maxn]; int main() { int n; cin >> n; dp[0][0] = 0; dp[0][1] = 0; dp[0][2] = 0; for (int i = 1; i <= n; i++) { for (int j = 0; j < 3; j++) { cin >> a[i - 1][j]; } dp[i][...
#include <bits/stdc++.h> #include <iostream> using namespace std; const int maxn = 1e5; int a[maxn][3]; int dp[maxn][3]; int main() { int n; cin >> n; dp[0][0] = 0; dp[0][1] = 0; dp[0][2] = 0; for (int i = 1; i <= n; i++) { for (int j = 0; j < 3; j++) { cin >> a[i - 1][j]; } dp[i][0] = a...
replace
3
6
3
6
-11
p03162
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; #define endl "\n" #define pb(s) push_back(s) #define mp(a, b) make_pair(a, b) #define f first #define se second #define ALL(v) v.begin(), v.end() #define ALLA(arr, sz) arr, arr + sz #define SORT(v) sort(ALL(v)) #define REVERSE(v) reverse(ALL(v)) #define SORTA(arr, sz) sor...
#include <bits/stdc++.h> using namespace std; #define endl "\n" #define pb(s) push_back(s) #define mp(a, b) make_pair(a, b) #define f first #define se second #define ALL(v) v.begin(), v.end() #define ALLA(arr, sz) arr, arr + sz #define SORT(v) sort(ALL(v)) #define REVERSE(v) reverse(ALL(v)) #define SORTA(arr, sz) sor...
replace
27
28
27
28
0
p03162
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; long long t, n; long long dp[100000][3]; long long c[4]; const int INF = 1e9 + 5; int main() { cin >> n; for (int i = 1; i <= n; i++) { for (int j = 1; j <= 3; j++) { long long x; cin >> x; for (int u = 1; u <= 3; u++) { if (u != j) { ...
#include <bits/stdc++.h> using namespace std; long long t, n; long long dp[200000][3]; long long c[4]; const int INF = 1e9 + 5; int main() { cin >> n; for (int i = 1; i <= n; i++) { for (int j = 1; j <= 3; j++) { long long x; cin >> x; for (int u = 1; u <= 3; u++) { if (u != j) { ...
replace
4
5
4
5
0
p03162
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; int main() { #ifndef ONLINE_JUDGE freopen("input.txt", "r", stdin); freopen("output.txt", "w", stdout); #endif int n; cin >> n; vector<vector<long long>> dp(n, vector<long long>(3, 0)); for (int i = 0; i < n; i++) cin >> dp[i][0] >> dp[i][1] >> dp[i][2]; ...
#include <bits/stdc++.h> using namespace std; int main() { int n; cin >> n; vector<vector<long long>> dp(n, vector<long long>(3, 0)); for (int i = 0; i < n; i++) cin >> dp[i][0] >> dp[i][1] >> dp[i][2]; long long mx = INT_MIN; for (int i = 1; i < n; i++) { for (int j = 0; j < 3; j++) { mx...
delete
4
8
4
4
0
p03162
C++
Runtime Error
#include <iostream> #include <vector> using namespace std; using Graph = vector<vector<int>>; #define rep(i, n) for (int i = 0; i < (int)(n); ++i) long long mmax(long long x, long long y) { if (x > y) return x; else return y; } int main() { int n; cin >> n; Graph abc(n); rep(i, n) { int a, b, ...
#include <iostream> #include <vector> using namespace std; using Graph = vector<vector<int>>; #define rep(i, n) for (int i = 0; i < (int)(n); ++i) long long mmax(long long x, long long y) { if (x > y) return x; else return y; } int main() { int n; cin >> n; Graph abc(n); rep(i, n) { int a, b, ...
replace
25
27
25
27
0
p03162
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; using ll = long long; using P = pair<int, int>; const int INF = 1e9; const int MOD = 1e9 + 7; ll dp[10010][3]; int main() { int N; cin >> N; ll a[N][3]; for (int i = 0; i < N; i++) for (int j = 0; j < 3; j++) cin >> a[i][j]; for (int i = 0; i < 3; i...
#include <bits/stdc++.h> using namespace std; using ll = long long; using P = pair<int, int>; const int INF = 1e9; const int MOD = 1e9 + 7; ll dp[100010][3]; int main() { int N; cin >> N; ll a[N][3]; for (int i = 0; i < N; i++) for (int j = 0; j < 3; j++) cin >> a[i][j]; for (int i = 0; i < 3; ...
replace
9
10
9
10
0
p03162
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; #define ll long long #define P pair<int, int> #define F first #define S second const ll mod = 1000000007LL; ll n, a[100005], b[100005], c[100005], dp[100005][3]; void solve() { cin >> n; for (int i = 0; i < n; i++) { cin >> a[i] >> b[i] >> c[i]; } dp[0][0] ...
#include <bits/stdc++.h> using namespace std; #define ll long long #define P pair<int, int> #define F first #define S second const ll mod = 1000000007LL; ll n, a[100005], b[100005], c[100005], dp[100005][3]; void solve() { cin >> n; for (int i = 0; i < n; i++) { cin >> a[i] >> b[i] >> c[i]; } dp[0][0] ...
replace
29
33
29
33
0
p03162
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; #define IOS \ ios::sync_with_stdio(0); \ cin.tie(0); \ cout.tie(0); #define int lon...
#include <bits/stdc++.h> using namespace std; #define IOS \ ios::sync_with_stdio(0); \ cin.tie(0); \ cout.tie(0); #define int lon...
replace
12
16
12
13
0
p03162
C++
Runtime Error
// define debug for debugging #define DEBUG #include <bits/stdc++.h> using namespace std; #define F first #define S second #define pb push_back #define mp make_pair #define MOD 1000000007 #define MAX 100000 + 100 #define max3(a, b, c) max(a, max(b, c)) typedef long long int ll; typedef pair<int, int> pii; typedef pair<...
// define debug for debugging // #define DEBUG #include <bits/stdc++.h> using namespace std; #define F first #define S second #define pb push_back #define mp make_pair #define MOD 1000000007 #define MAX 100000 + 100 #define max3(a, b, c) max(a, max(b, c)) typedef long long int ll; typedef pair<int, int> pii; typedef pa...
replace
1
2
1
2
0
p03162
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; int n, dp[300005][5], arr[300005][5]; int main() { cin >> n; for (int i = 0; i < n; i++) for (int j = 0; j < 3; j++) scanf("%d", arr[i][j]); for (int i = 0; i < n; i++) { for (int j = 0; j < 3; j++) { for (int k = 0; k < 3; k++) { if (j ...
#include <bits/stdc++.h> using namespace std; int n, dp[300005][5], arr[300005][5]; int main() { cin >> n; for (int i = 0; i < n; i++) for (int j = 0; j < 3; j++) scanf("%d", &arr[i][j]); for (int i = 0; i < n; i++) { for (int j = 0; j < 3; j++) { for (int k = 0; k < 3; k++) { if (j...
replace
9
10
9
10
-11
p03162
C++
Time Limit Exceeded
#include <bits/stdc++.h> using namespace std; using ll = long long int; vector<vector<ll>> v; ll n; ll DP[100000][3]; ll backtrack(ll pos, char choice) { if (pos == n) return 0LL; vector<ll> b; for (ll i = 0; i < 3; i++) { char ch = (char)(i + 'a'); if (choice != ch && DP[pos][i] != -1) { ...
#include <bits/stdc++.h> using namespace std; using ll = long long int; vector<vector<ll>> v; ll n; ll DP[100000][3]; ll backtrack(ll pos, char choice) { if (pos == n) return 0LL; vector<ll> b; for (ll i = 0; i < 3; i++) { char ch = (char)(i + 'a'); if (choice != ch && DP[pos][i] != -1) { ...
replace
34
35
34
36
TLE
p03162
C++
Runtime Error
#include <algorithm> #include <bits/stdc++.h> using namespace std; #define mod 1000000007 #define pb push_back #define csl \ ios_base::sync_with_stdio(false); \ cin.tie(NULL) #define reps(i, a, b) for (int ...
#include <algorithm> #include <bits/stdc++.h> using namespace std; #define mod 1000000007 #define pb push_back #define csl \ ios_base::sync_with_stdio(false); \ cin.tie(NULL) #define reps(i, a, b) for (int ...
replace
29
31
29
31
0
p03162
C++
Runtime Error
#include <algorithm> #include <iostream> #include <math.h> #include <string> using namespace std; long long dp[100001][3]; int main() { int N; long long a[10001][3]; cin >> N; for (int i = 1; i < N + 1; i++) { for (int j = 0; j < 3; j++) { cin >> a[i][j]; } } for (int i = 0; i < N + 1; i++) {...
#include <algorithm> #include <iostream> #include <math.h> #include <string> using namespace std; long long dp[100001][3]; int main() { int N; long long a[100001][3]; cin >> N; for (int i = 1; i < N + 1; i++) { for (int j = 0; j < 3; j++) { cin >> a[i][j]; } } for (int i = 0; i < N + 1; i++) ...
replace
9
10
9
10
0
p03162
C++
Time Limit Exceeded
#include <bits/stdc++.h> using namespace std; int const N = 1e5 + 5, M = 1e9 + 7, OO = 0x3f3f3f3f; int n; int arr[3][N]; int mem[N][4]; int solve(int i, int last) { if (i == n) return 0; if (mem[i][last] = !-1) return mem[i][last]; int op1 = (last != 1) ? solve(i + 1, 1) + arr[0][i] : 0; int op2 = (l...
#include <bits/stdc++.h> using namespace std; int const N = 1e5 + 5, M = 1e9 + 7, OO = 0x3f3f3f3f; int n; int arr[3][N]; int mem[N][4]; int solve(int i, int last) { if (i == n) return 0; if (mem[i][last] != -1) return mem[i][last]; int op1 = (last != 1) ? solve(i + 1, 1) + arr[0][i] : 0; int op2 = (l...
replace
12
13
12
13
TLE
p03162
C++
Runtime Error
#include "bits/stdc++.h" using namespace std; int main() { int n; cin >> n; vector<int> dp(3); // dp[0] = max({dp[0],dp[1],dp[2]}); for (int day = 0; day < n; day++) { vector<int> new_dp(3); vector<int> c(3); for (int i = 0; i < 3; ++i) { scanf("%d", &c[i]); } for (int i = 0; i < 3;...
#include "bits/stdc++.h" using namespace std; int main() { int n; cin >> n; vector<int> dp(3); // dp[0] = max({dp[0],dp[1],dp[2]}); for (int day = 0; day < n; day++) { vector<int> new_dp(3); vector<int> c(3); for (int i = 0; i < 3; ++i) { scanf("%d", &c[i]); } for (int i = 0; i < 3;...
replace
24
25
24
25
0
p03162
C++
Runtime Error
#include <bits/stdc++.h> #include <iostream> #define scan(n) scanf("%I64d", &n); #define scan2(a, b) scanf("%I64d%I64d", &a, &b); #define scan3(a, b, c) scanf("%I64d%I64d%I64d", &a, &b, &c); #define sc(n) scanf("%c", &n); #define sf(n) scanf("%lf", &n); #define ss(n) scanf("%s", n); #define forall(i, a, b) for (long lo...
#include <bits/stdc++.h> #include <iostream> #define scan(n) scanf("%I64d", &n); #define scan2(a, b) scanf("%I64d%I64d", &a, &b); #define scan3(a, b, c) scanf("%I64d%I64d%I64d", &a, &b, &c); #define sc(n) scanf("%c", &n); #define sf(n) scanf("%lf", &n); #define ss(n) scanf("%s", n); #define forall(i, a, b) for (long lo...
replace
75
76
75
76
0
p03162
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; int main() { int N; cin >> N; vector<int> a(N); vector<int> b(N); vector<int> c(N); for (int i = 0; i < N; i++) { int A, B, C; cin >> A >> B >> C; a.at(i) = A; b.at(i) = B; c.at(i) = C; } vector<vector<int>> dp(N + 1, vector<int>(3, 0)); ...
#include <bits/stdc++.h> using namespace std; int main() { int N; cin >> N; vector<int> a(N); vector<int> b(N); vector<int> c(N); for (int i = 0; i < N; i++) { int A, B, C; cin >> A >> B >> C; a.at(i) = A; b.at(i) = B; c.at(i) = C; } vector<vector<int>> dp(N + 1, vector<int>(3, 0)); ...
replace
16
17
16
17
-6
terminate called after throwing an instance of 'std::out_of_range' what(): vector::_M_range_check: __n (which is 18446744073709551615) >= this->size() (which is 3)
p03162
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; #define fastio \ ios_base::sync_with_stdio(false); \ cin.tie(NULL); \ cout.tie(NULL); #define pb pu...
#include <bits/stdc++.h> using namespace std; #define fastio \ ios_base::sync_with_stdio(false); \ cin.tie(NULL); \ cout.tie(NULL); #define pb pu...
replace
20
21
20
21
0
p03162
C++
Runtime Error
#include <bits/stdc++.h> #define sanyes \ ios_base::sync_with_stdio(0), cout.tie(0); \ cin.tie(0); #define llong long long #define pb push_back #define bpc __builtin_popcount const llong mxn = 1e5 + 7; const llong mod...
#include <bits/stdc++.h> #define sanyes \ ios_base::sync_with_stdio(0), cout.tie(0); \ cin.tie(0); #define llong long long #define pb push_back #define bpc __builtin_popcount const llong mxn = 1e5 + 7; const llong mod...
replace
14
15
14
15
0
p03162
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; int main() { int N; cin >> N; int dp[10010][3]; for (int i = 0; i < N; i++) { int a, b, c; cin >> a >> b >> c; if (i == 0) { dp[i][0] = a; dp[i][1] = b; dp[i][2] = c; } else { dp[i][0] = a + max({dp[i - 1][1], dp[i - 1][2]}...
#include <bits/stdc++.h> using namespace std; int main() { int N; cin >> N; int dp[100010][3]; for (int i = 0; i < N; i++) { int a, b, c; cin >> a >> b >> c; if (i == 0) { dp[i][0] = a; dp[i][1] = b; dp[i][2] = c; } else { dp[i][0] = a + max({dp[i - 1][1], dp[i - 1][2]...
replace
7
8
7
8
0
p03162
C++
Time Limit Exceeded
#include <algorithm> #include <iostream> #include <string.h> #include <vector> using namespace std; #define mod (long)(998244353) #define all(x) (x).begin(), (x).end() #define bitcount(n) __builtin_popcountl(long(n)) #define fcout cout << fixed << setprecision(15) #define highest(x) (63 - __builtin_clzl(x)) #define lon...
#include <algorithm> #include <iostream> #include <string.h> #include <vector> using namespace std; #define mod (long)(998244353) #define all(x) (x).begin(), (x).end() #define bitcount(n) __builtin_popcountl(long(n)) #define fcout cout << fixed << setprecision(15) #define highest(x) (63 - __builtin_clzl(x)) #define lon...
insert
120
120
120
123
TLE
p03162
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; int dp[10005][3] = {0}; int ans(int *a, int *b, int *c, int n) { dp[1][0] = a[1]; dp[1][1] = b[1]; dp[1][2] = c[1]; for (int i = 2; i <= n; i++) { dp[i][0] = a[i] + max(dp[i - 1][1], dp[i - 1][2]); dp[i][1] = b[i] + max(dp[i - 1][0], dp[i - 1][2]); dp[...
#include <bits/stdc++.h> using namespace std; int dp[100005][3] = {0}; int ans(int *a, int *b, int *c, int n) { dp[1][0] = a[1]; dp[1][1] = b[1]; dp[1][2] = c[1]; for (int i = 2; i <= n; i++) { dp[i][0] = a[i] + max(dp[i - 1][1], dp[i - 1][2]); dp[i][1] = b[i] + max(dp[i - 1][0], dp[i - 1][2]); dp...
replace
3
4
3
4
0
p03162
C++
Runtime Error
#include "bits/stdc++.h" using namespace std; typedef long long ll; #define _USE_MATH_DEFINES #include <math.h> #define rep(i, n) for (int i = 0; i < n; i++) #define NIL = -1; ll gcd(long long a, long long b) { if (a < b) swap(a, b); if (b == 0) return a; return gcd(b, a % b); } ll lcm(ll a, ll b) { a ...
#include "bits/stdc++.h" using namespace std; typedef long long ll; #define _USE_MATH_DEFINES #include <math.h> #define rep(i, n) for (int i = 0; i < n; i++) #define NIL = -1; ll gcd(long long a, long long b) { if (a < b) swap(a, b); if (b == 0) return a; return gcd(b, a % b); } ll lcm(ll a, ll b) { a ...
replace
34
35
34
35
0
p03162
C++
Time Limit Exceeded
#include <bits/stdc++.h> using namespace std; #define ll long long #define FASTIO ios::sync_with_stdio(0), cin.tie(0), cout.tie(0) #define pb push_back #define mp make_pair #define f first #define s second #define ii pair<ll, ll> #define all(x) std::begin(x), std::end(x) ll const MAX = 100005; ll const INF = 1e9; ll ...
#include <bits/stdc++.h> using namespace std; #define ll long long #define FASTIO ios::sync_with_stdio(0), cin.tie(0), cout.tie(0) #define pb push_back #define mp make_pair #define f first #define s second #define ii pair<ll, ll> #define all(x) std::begin(x), std::end(x) ll const MAX = 100005; ll const INF = 1e9; ll ...
replace
29
31
29
31
TLE
p03162
C++
Runtime Error
#include <bits/stdc++.h> #include <ext/pb_ds/detail/standard_policies.hpp> using namespace __gnu_pbds; using namespace std; typedef long long ll; typedef unsigned long long ull; typedef long double ld; #define endl "\n" const int MAX = 100005; const long long mod = 1.0e9 + 7; int main() { ios_base::sync_with_stdio(fa...
#include <bits/stdc++.h> #include <ext/pb_ds/detail/standard_policies.hpp> using namespace __gnu_pbds; using namespace std; typedef long long ll; typedef unsigned long long ull; typedef long double ld; #define endl "\n" const int MAX = 100005; const long long mod = 1.0e9 + 7; int main() { ios_base::sync_with_stdio(fa...
replace
14
18
14
15
-11
p03162
C++
Runtime Error
#include <bits/stdc++.h> const int INF = 1e9; const int MOD = 1e9 + 7; const long long LINF = 1e18; #define dump(x) cout << 'x' << ' = ' << (x) << ` `; #define FOR(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> const int INF = 1e9; const int MOD = 1e9 + 7; const long long LINF = 1e18; #define dump(x) cout << 'x' << ' = ' << (x) << ` `; #define FOR(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
21
23
21
23
0
p03162
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; int mat[3][10001]; int main() { #ifdef EVAL freopen("input.txt", "r", stdin); freopen("output.txt", "w", stdout); #endif int N; cin >> N; int a[N]; int b[N]; int c[N]; for (int i = 0; i < N; i++) { cin >> a[i] >> b[i] >> c[i]; } mat[0][0] = a[0]; m...
#include <bits/stdc++.h> using namespace std; int mat[3][100001]; int main() { #ifdef EVAL freopen("input.txt", "r", stdin); freopen("output.txt", "w", stdout); #endif int N; cin >> N; int a[N]; int b[N]; int c[N]; for (int i = 0; i < N; i++) { cin >> a[i] >> b[i] >> c[i]; } mat[0][0] = a[0]; ...
replace
2
3
2
3
0
p03162
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; #ifndef ONLINE_JUDGE const bool DEBUG = true; #else const bool DEBUG = false; #endif using ll = long long; using ull = unsigned long long; #define F first #define S second #define all(x) begin(x), end(x) template <class T> void read_vector(vector<T> &arr) { const int ...
#include <bits/stdc++.h> using namespace std; #ifndef ONLINE_JUDGE const bool DEBUG = true; #else const bool DEBUG = false; #endif using ll = long long; using ull = unsigned long long; #define F first #define S second #define all(x) begin(x), end(x) template <class T> void read_vector(vector<T> &arr) { const int ...
replace
50
52
50
51
0
p03162
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; int dp[11000][3]; int main() { int n; cin >> n; int a[n], b[n], c[n]; for (int i = 0; i < n; i++) cin >> a[i] >> b[i] >> c[i]; for (int i = 0; i < n; i++) { for (int j = 0; j < 3; j++) { if (i == 0) { if (j == 0) dp[i][j] = a[i]; ...
#include <bits/stdc++.h> using namespace std; int dp[110000][3]; int main() { int n; cin >> n; int a[n], b[n], c[n]; for (int i = 0; i < n; i++) cin >> a[i] >> b[i] >> c[i]; for (int i = 0; i < n; i++) { for (int j = 0; j < 3; j++) { if (i == 0) { if (j == 0) dp[i][j] = a[i]; ...
replace
2
3
2
3
0
p03162
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; int dp[2][3]; int main() { int n; cin >> n; int a[n], b[n], c[n]; for (int i = 0; i < n; i++) cin >> a[i] >> b[i] >> c[i]; for (int i = 0; i < n; i++) { for (int j = 0; j < 3; j++) { if (i == 0) { if (j == 0) dp[i % 2][j] = a[i]; ...
#include <bits/stdc++.h> using namespace std; int dp[2][3]; int main() { int n; cin >> n; int a[n], b[n], c[n]; for (int i = 0; i < n; i++) cin >> a[i] >> b[i] >> c[i]; for (int i = 0; i < n; i++) { for (int j = 0; j < 3; j++) { if (i == 0) { if (j == 0) dp[i % 2][j] = a[i]; ...
replace
35
36
35
36
0
p03162
C++
Runtime Error
#include <iostream> #include <math.h> #include <vector> using namespace std; int main() { int dp[3][10001]; int act[3][10001]; int N; cin >> N; for (int i = 1; i <= N; i++) { cin >> act[0][i] >> act[1][i] >> act[2][i]; } dp[0][1] = act[0][1]; dp[1][1] = act[1][1]; dp[2][1] = act[2][1]; for...
#include <iostream> #include <math.h> #include <vector> using namespace std; int main() { int dp[3][100001]; int act[3][100001]; int N; cin >> N; for (int i = 1; i <= N; i++) { cin >> act[0][i] >> act[1][i] >> act[2][i]; } dp[0][1] = act[0][1]; dp[1][1] = act[1][1]; dp[2][1] = act[2][1]; f...
replace
8
10
8
10
0
p03162
C++
Runtime Error
#include <bits/stdc++.h> #define ll long long #define speed_up \ ios_base::sync_with_stdio(false); \ cin.tie(0); \ cout.tie(0); #define rep(i, a...
#include <bits/stdc++.h> #define ll long long #define speed_up \ ios_base::sync_with_stdio(false); \ cin.tie(0); \ cout.tie(0); #define rep(i, a...
replace
53
57
53
57
0
p03162
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; typedef long long ll; typedef pair<ll, ll> Pll; #define F first #define S second #define MP make_pair #define PB push_back #define rad(X) cout << (X) << endl #define ASH(X) cout << (X) << " " #define debug(x) cout << #x << " " << x << endl; #define debug2(x, y) cout << #x <...
#include <bits/stdc++.h> using namespace std; typedef long long ll; typedef pair<ll, ll> Pll; #define F first #define S second #define MP make_pair #define PB push_back #define rad(X) cout << (X) << endl #define ASH(X) cout << (X) << " " #define debug(x) cout << #x << " " << x << endl; #define debug2(x, y) cout << #x <...
replace
65
68
65
68
0
p03162
C++
Time Limit Exceeded
#include <bits/stdc++.h> using namespace std; typedef long long ll; typedef long long int lli; typedef long double ld; const int oo = 1e9; // const int mod = 1e9+9; /*ll gcd(ll x, ll y){return (y ? gcd(y, x%y) : x); } *ll lcm(ll x, ll y){return x*(y/gcd(x,y));} *void exEuclid(int a, int b){ if(b==0){x = 1; y=0;...
#include <bits/stdc++.h> using namespace std; typedef long long ll; typedef long long int lli; typedef long double ld; const int oo = 1e9; // const int mod = 1e9+9; /*ll gcd(ll x, ll y){return (y ? gcd(y, x%y) : x); } *ll lcm(ll x, ll y){return x*(y/gcd(x,y));} *void exEuclid(int a, int b){ if(b==0){x = 1; y=0;...
insert
26
26
26
28
TLE
p03162
C++
Runtime Error
#include <bits/stdc++.h> #define MAX 1e9 using namespace std; typedef long long ll; template <class T> inline bool chmax(T &a, T b) { if (a < b) { a = b; return true; } return false; } int main(void) { int n; cin >> n; ll happy_arr[10][3]; ll dp_arr[10][3]; for (int i = 0; i < n; ++i) { f...
#include <bits/stdc++.h> #define MAX 1e9 using namespace std; typedef long long ll; template <class T> inline bool chmax(T &a, T b) { if (a < b) { a = b; return true; } return false; } int main(void) { int n; cin >> n; ll happy_arr[100010][3]; ll dp_arr[100010][3]; for (int i = 0; i < n; ++i)...
replace
17
19
17
19
0
p03162
C++
Runtime Error
#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; int main() { int a[10][3]; int dp[10][3]; int N; cin >> N; rep(i, N) rep(j, 3) cin >> a[i][j]; rep(i, N + 1) rep(j, 3) dp[i][j] = 0; for (int i = 0; i < N...
#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; int main() { int a[100010][3]; int dp[100010][3]; int N; cin >> N; rep(i, N) rep(j, 3) cin >> a[i][j]; rep(i, N + 1) rep(j, 3) dp[i][j] = 0; for (int i = ...
replace
7
9
7
9
0
p03162
C++
Runtime Error
#include <bits/stdc++.h> #define rep(i, a, b) for (int i = a; i < (b); i++) #define rrep(i, a, b) for (int i = a; i >= b; i--) #define all(x) (x).begin(), (x).end() using namespace std; using ll = long long; using P = pair<int, int>; const int inf = 1 << 20; const int mod = 1e9 + 7; template <class T> inline bool chmi...
#include <bits/stdc++.h> #define rep(i, a, b) for (int i = a; i < (b); i++) #define rrep(i, a, b) for (int i = a; i >= b; i--) #define all(x) (x).begin(), (x).end() using namespace std; using ll = long long; using P = pair<int, int>; const int inf = 1 << 20; const int mod = 1e9 + 7; template <class T> inline bool chmi...
replace
25
26
25
26
0
p03162
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; #define fastio() \ ios_base::sync_with_stdio(0); \ cin.tie(0); \ cout.tie(0) #define pb push_b...
#include <bits/stdc++.h> using namespace std; #define fastio() \ ios_base::sync_with_stdio(0); \ cin.tie(0); \ cout.tie(0) #define pb push_b...
replace
53
54
53
54
0
p03162
C++
Runtime Error
#include <bits/stdc++.h> #include <ext/pb_ds/assoc_container.hpp> using namespace __gnu_pbds; using namespace std; #define ff first #define ss second #define int long long #define pb push_back #define mp make_pair #define pii pair<int, int> #define vi vector<int> #define mii map<int, int> #define pqb priority_queue<in...
#include <bits/stdc++.h> #include <ext/pb_ds/assoc_container.hpp> using namespace __gnu_pbds; using namespace std; #define ff first #define ss second #define int long long #define pb push_back #define mp make_pair #define pii pair<int, int> #define vi vector<int> #define mii map<int, int> #define pqb priority_queue<in...
replace
42
43
42
43
TLE
p03162
C++
Time Limit Exceeded
#include <bits/stdc++.h> using namespace std; #define fst(t) std::get<0>(t) #define snd(t) std::get<1>(t) #define thd(t) std::get<2>(t) #define unless(p) if (!(p)) #define until(p) while (!(p)) using ll = long long; using P = std::tuple<int, int>; const int dx[8] = {-1, 1, 0, 0, -1, -1, 1, 1}, dy[8] = {0,...
#include <bits/stdc++.h> using namespace std; #define fst(t) std::get<0>(t) #define snd(t) std::get<1>(t) #define thd(t) std::get<2>(t) #define unless(p) if (!(p)) #define until(p) while (!(p)) using ll = long long; using P = std::tuple<int, int>; const int dx[8] = {-1, 1, 0, 0, -1, -1, 1, 1}, dy[8] = {0,...
insert
23
23
23
27
TLE
p03162
C++
Runtime Error
#include <bits/stdc++.h> #define rep(i, f, n) for (ll i = (f); (i) < (n); i++) #define repe(i, f, n) for (ll i = (f); (i) <= (n); i++) using namespace std; using ll = long long; ll INF = 1e+18; int iINF = 1e9; int MAXI = 1e8 + 1; using vec = vector<int>; int main() { int N; cin >> N; vector<vector<int>> arr(N);...
#include <bits/stdc++.h> #define rep(i, f, n) for (ll i = (f); (i) < (n); i++) #define repe(i, f, n) for (ll i = (f); (i) <= (n); i++) using namespace std; using ll = long long; ll INF = 1e+18; int iINF = 1e9; int MAXI = 1e8 + 1; using vec = vector<int>; int main() { int N; cin >> N; vector<vector<int>> arr(N);...
replace
32
33
32
33
-11
p03162
C++
Runtime Error
#include "bits/stdc++.h" using namespace std; bool **v; int **dp; int *a, *b, *c; int solve(int n, const int &max, char last) { if (n == max) return 0; if (v[n][last]) return dp[n][last]; int score_a = last == 'a' ? 0 : solve(n + 1, max, 'a') + a[n]; int score_b = last == 'b' ? 0 : solve(n + 1, max,...
#include "bits/stdc++.h" using namespace std; bool **v; int **dp; int *a, *b, *c; int solve(int n, const int &max, char last) { if (n == max) return 0; if (v[n][last]) return dp[n][last]; int score_a = last == 'a' ? 0 : solve(n + 1, max, 'a') + a[n]; int score_b = last == 'b' ? 0 : solve(n + 1, max,...
replace
41
43
41
43
0
p03162
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; #define ll long long #define endl "\n" #define IOS \ ios::sync_with_stdio(0); \ cin.tie(0); ...
#include <bits/stdc++.h> using namespace std; #define ll long long #define endl "\n" #define IOS \ ios::sync_with_stdio(0); \ cin.tie(0); ...
replace
9
10
9
10
0
p03162
C++
Runtime Error
#include <iostream> using namespace std; long n, a[10000][10000], f[10000][10000]; int main() { cin >> n; for (long i = 1; i <= n; i++) { for (long j = 1; j <= 3; j++) cin >> a[i][j]; } f[0][1] = 0; f[0][2] = 0; f[0][3] = 0; for (long i = 1; i <= n; i++) { for (long j = 1; j <= 3; j++) { ...
#include <iostream> using namespace std; long n, a[100005][4], f[100005][4]; int main() { cin >> n; for (long i = 1; i <= n; i++) { for (long j = 1; j <= 3; j++) cin >> a[i][j]; } f[0][1] = 0; f[0][2] = 0; f[0][3] = 0; for (long i = 1; i <= n; i++) { for (long j = 1; j <= 3; j++) { if...
replace
3
4
3
4
-11
p03162
C++
Runtime Error
#include <cmath> #include <iostream> using namespace std; int other[3][2] = {{1, 2}, {0, 2}, {1, 0}}; int getDp(int data[][3], int i, int choice, int dp[][3]) { if (dp[i][choice] != -1) { return dp[i][choice]; } for (int j = 0; j < 2; j++) { dp[i][choice] = max(data[i][choice] + getDp(data, i ...
#include <cmath> #include <iostream> using namespace std; int other[3][2] = {{1, 2}, {0, 2}, {1, 0}}; int getDp(int data[][3], int i, int choice, int dp[][3]) { if (dp[i][choice] != -1) { return dp[i][choice]; } for (int j = 0; j < 2; j++) { dp[i][choice] = max(data[i][choice] + getDp(data, i ...
replace
43
44
43
44
2
p03162
C++
Runtime Error
#include <bits/stdc++.h> #include <ext/pb_ds/assoc_container.hpp> #include <ext/pb_ds/tree_policy.hpp> using namespace __gnu_pbds; using namespace std; template <typename T> using ordered_set = tree<T, null_type, less<T>, rb_tree_tag, tree_order_statistics_node_update>; #define int long long typedef long double ld;...
#include <bits/stdc++.h> #include <ext/pb_ds/assoc_container.hpp> #include <ext/pb_ds/tree_policy.hpp> using namespace __gnu_pbds; using namespace std; template <typename T> using ordered_set = tree<T, null_type, less<T>, rb_tree_tag, tree_order_statistics_node_update>; #define int long long typedef long double ld;...
replace
23
29
23
29
-11
p03162
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>; ll dp[10005][3]; int main() { int n; cin >> n; vector<ll> a(n), b(n), c(n); rep(i, n) cin >> a[i] >> b[i] >> c[i]; for (int i = 1; i <= n; ++i) { dp[i][0] = ma...
#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>; ll dp[100005][3]; int main() { int n; cin >> n; vector<ll> a(n), b(n), c(n); rep(i, n) cin >> a[i] >> b[i] >> c[i]; for (int i = 1; i <= n; ++i) { dp[i][0] = m...
replace
6
7
6
7
0
p03162
C++
Time Limit Exceeded
#include <bits/stdc++.h> using namespace std; #define ff first #define ss second #define int long long #define pb push_back #define setbits(x) __builtin_popcountll(x) #define endl "\n" #define ll long long int decimalsum(int x) { int sum = 0; while (x) { sum += x % 10; x = x / 10; } return sum; } int r...
#include <bits/stdc++.h> using namespace std; #define ff first #define ss second #define int long long #define pb push_back #define setbits(x) __builtin_popcountll(x) #define endl "\n" #define ll long long int decimalsum(int x) { int sum = 0; while (x) { sum += x % 10; x = x / 10; } return sum; } int r...
replace
53
55
53
62
TLE
p03162
C++
Runtime Error
#include <bits/stdc++.h> #define mo 1000000007 using namespace std; int gcd(int a, int b) { if (b == 0) return a; return gcd(b, a % b); } int add(int a, int b) { a %= mo; b %= mo; return (a + b) % mo; } int mul(int a, int b) { a %= mo; b %= mo; return (a * b) % mo; } int32_t main() { #ifndef O...
#include <bits/stdc++.h> #define mo 1000000007 using namespace std; int gcd(int a, int b) { if (b == 0) return a; return gcd(b, a % b); } int add(int a, int b) { a %= mo; b %= mo; return (a + b) % mo; } int mul(int a, int b) { a %= mo; b %= mo; return (a * b) % mo; } int32_t main() { /* #ifn...
replace
26
30
26
30
TLE
p03162
C++
Runtime Error
#include <bits/stdc++.h> #include <unordered_map> using namespace std; #define endl '\n' #define ll long long #define int long long const int32_t INFint = 1e9; const ll INFll = 1e18; #define MOD 1000000007ll #define fast \ ios_base::sync_with_stdio(0...
#include <bits/stdc++.h> #include <unordered_map> using namespace std; #define endl '\n' #define ll long long #define int long long const int32_t INFint = 1e9; const ll INFll = 1e18; #define MOD 1000000007ll #define fast \ ios_base::sync_with_stdio(0...
replace
75
76
75
76
0
p03162
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; typedef long long ll; typedef vector<int> vec; typedef unsigned long long ull; typedef unsigned int ui; typedef pair<int, int> par; typedef vector<par> vpar; #define forn(i, n) for (ll i = 0; i < n; i++) #define wez(n) ...
#include <bits/stdc++.h> using namespace std; typedef long long ll; typedef vector<int> vec; typedef unsigned long long ull; typedef unsigned int ui; typedef pair<int, int> par; typedef vector<par> vpar; #define forn(i, n) for (ll i = 0; i < n; i++) #define wez(n) ...
replace
37
38
37
38
0
p03162
C++
Time Limit Exceeded
#include <bits/stdc++.h> using namespace std; const int MAXN = 1e5 + 10; int vis[MAXN][3], dp[MAXN][3], N, A[3][MAXN]; int solve(int pos, int last) { if (pos == N + 1) return 0; if (vis[pos][last]) return dp[pos][last]; int best = 0; for (int i = 0; i < 3; i++) { if (i != last) best = m...
#include <bits/stdc++.h> using namespace std; const int MAXN = 1e5 + 10; int vis[MAXN][3], dp[MAXN][3], N, A[3][MAXN]; int solve(int pos, int last) { if (pos == N + 1) return 0; if (vis[pos][last]) return dp[pos][last]; vis[pos][last] = 1; int best = 0; for (int i = 0; i < 3; i++) { if (i !...
insert
14
14
14
15
TLE
p03162
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; const int mx = 1e5 + 123; int dp[mx][4], n; int a[mx][4]; int solve(int i, int f1) { if (i > n) return 0; if (dp[i][f1] != -1) return dp[i][f1]; int ret = 0; for (int j = 1; j <= n; j++) { if (j != f1) { ret = max(ret, a[i][j] + solve(i + 1, j))...
#include <bits/stdc++.h> using namespace std; const int mx = 1e5 + 123; int dp[mx][4], n; int a[mx][4]; int solve(int i, int f1) { if (i > n) return 0; if (dp[i][f1] != -1) return dp[i][f1]; int ret = 0; for (int j = 1; j <= 3; j++) { if (j != f1) { ret = max(ret, a[i][j] + solve(i + 1, j))...
replace
14
15
14
15
0
p03162
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; #define ll long long int int main() { ios_base::sync_with_stdio(false); cin.tie(NULL); ll t, y = 1; // cin>>t; t = 1; while (t > 0) { t--; ll n, i, j, k, flag = 1, x = 0; cin >> n; ll a = 0, b = 0, c = 0; ll dp[(ll)1e5][3]; for (i = 1; i...
#include <bits/stdc++.h> using namespace std; #define ll long long int int main() { ios_base::sync_with_stdio(false); cin.tie(NULL); ll t, y = 1; // cin>>t; t = 1; while (t > 0) { t--; ll n, i, j, k, flag = 1, x = 0; cin >> n; ll a = 0, b = 0, c = 0; ll dp[(ll)1e5 + 1][3]; for (i = ...
replace
15
16
15
16
0
p03162
C++
Runtime Error
#include <algorithm> #include <cmath> #include <functional> #include <iomanip> #include <iostream> #include <map> #include <queue> #include <set> #include <stdio.h> #include <string> #include <vector> #define rep(i, n) for (int i = 0; i < (int)n; i++) // n回繰り返す #define rrep(i, n) for (int i = n - 1; i >= 0; i--) using ...
#include <algorithm> #include <cmath> #include <functional> #include <iomanip> #include <iostream> #include <map> #include <queue> #include <set> #include <stdio.h> #include <string> #include <vector> #define rep(i, n) for (int i = 0; i < (int)n; i++) // n回繰り返す #define rrep(i, n) for (int i = n - 1; i >= 0; i--) using ...
replace
34
36
34
36
0
p03162
C++
Time Limit Exceeded
#include <bits/stdc++.h> #include <fstream> using namespace std; #define rep(i, a, b) for (ll i = (a); i < (b); i++) #define rep2(r, aa, bb) for (ll r = (aa)-1; r >= (bb); r--) #define be(x) (x.begin(), x.end()) #define pb(t) push_back(t) #define ll long long int n; int dp[100005][4]; vector<vector<int>> A; int minicos...
#include <bits/stdc++.h> #include <fstream> using namespace std; #define rep(i, a, b) for (ll i = (a); i < (b); i++) #define rep2(r, aa, bb) for (ll r = (aa)-1; r >= (bb); r--) #define be(x) (x.begin(), x.end()) #define pb(t) push_back(t) #define ll long long int n; int dp[100005][4]; vector<vector<int>> A; int minicos...
replace
26
27
26
27
TLE
p03162
C++
Runtime Error
#include <bits/stdc++.h> #define int long long using namespace std; int arr[10010][10010]; int dp[10010][10010]; signed main() { int n; cin >> n; for (int i = 0; i < n; i++) { cin >> arr[i][0] >> arr[i][1] >> arr[i][2]; } for (int i = 0; i < 3; i++) { dp[0][i] = arr[0][i]; } for (int i = 1; i < n;...
#include <bits/stdc++.h> #define int long long using namespace std; int arr[100100][4]; int dp[100100][4]; signed main() { int n; cin >> n; for (int i = 0; i < n; i++) { cin >> arr[i][0] >> arr[i][1] >> arr[i][2]; } for (int i = 0; i < 3; i++) { dp[0][i] = arr[0][i]; } for (int i = 1; i < n; i++) ...
replace
3
5
3
5
-11
p03162
C++
Runtime Error
#include <algorithm> #include <climits> #include <cmath> #include <cstdio> #include <cstdlib> #include <cstring> #include <deque> #include <iomanip> #include <iostream> #include <map> #include <queue> #include <set> #include <stack> #include <stdio.h> #include <string> #include <utility> #include <vector> using namespa...
#include <algorithm> #include <climits> #include <cmath> #include <cstdio> #include <cstdlib> #include <cstring> #include <deque> #include <iomanip> #include <iostream> #include <map> #include <queue> #include <set> #include <stack> #include <stdio.h> #include <string> #include <utility> #include <vector> using namespa...
replace
55
57
55
57
0