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
p03174
C++
Time Limit Exceeded
#include <bits/stdc++.h> using namespace std; using ll = long long; const int mod = 1e9 + 7; int n; vector<vector<ll>> a, dp; int main() { cin >> n; a.resize(n + 1, vector<ll>(n + 1)); for (int i = 1; i <= n; i++) { for (int j = 1; j <= n; j++) { cin >> a[i][j]; } } dp.resize(n + 1, vector<l...
#include <bits/stdc++.h> using namespace std; using ll = long long; const int mod = 1e9 + 7; int n; vector<vector<ll>> a, dp; int main() { cin >> n; a.resize(n + 1, vector<ll>(n + 1)); for (int i = 1; i <= n; i++) { for (int j = 1; j <= n; j++) { cin >> a[i][j]; } } dp.resize(n + 1, vector<l...
insert
22
22
22
24
TLE
p03174
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; using ll = long long; const ll MOD = 1000000007; ll modpow(ll x, ll n, ll mod = MOD) { ll res = 1; while (n > 0) { if (n & 1) res = res * x % mod; x = x * x % mod; n >>= 1; } return res; } ll dp[21][1 << 21]; int main() { cin.tie(0); ios:...
#include <bits/stdc++.h> using namespace std; using ll = long long; const ll MOD = 1000000007; ll modpow(ll x, ll n, ll mod = MOD) { ll res = 1; while (n > 0) { if (n & 1) res = res * x % mod; x = x * x % mod; n >>= 1; } return res; } ll dp[22][1 << 21]; int main() { cin.tie(0); ios:...
replace
19
20
19
20
-11
p03174
C++
Time Limit Exceeded
#include <bits/stdc++.h> #define FOR(v, a, b) for (int v = (a); v < (b); ++v) #define FORE(v, a, b) for (int v = (a); v <= (b); ++v) #define REP(v, n) FOR(v, 0, n) #define REPE(v, n) FORE(v, 0, n) #define REV(v, a, b) for (int v = (a); v >= (b); --v) #define ALL(x) (x).begin(), (x).end() #define ITR(it, c) for (auto it...
#include <bits/stdc++.h> #define FOR(v, a, b) for (int v = (a); v < (b); ++v) #define FORE(v, a, b) for (int v = (a); v <= (b); ++v) #define REP(v, n) FOR(v, 0, n) #define REPE(v, n) FORE(v, 0, n) #define REV(v, a, b) for (int v = (a); v >= (b); --v) #define ALL(x) (x).begin(), (x).end() #define ITR(it, c) for (auto it...
insert
80
80
80
82
TLE
p03174
C++
Runtime Error
#include <bits/stdc++.h> #define fi first #define se second #define mp make_pair #define pb push_back using namespace std; typedef pair<int, int> pii; typedef long long ll; const int inf = 1e9 + 1; const double eps = 1e-9; const int MOD = 1e9 + 7; const int MAXN = 21; int n; int a[MAXN][MAXN]; int dp[MAXN][(int)1 <<...
#include <bits/stdc++.h> #define fi first #define se second #define mp make_pair #define pb push_back using namespace std; typedef pair<int, int> pii; typedef long long ll; const int inf = 1e9 + 1; const double eps = 1e-9; const int MOD = 1e9 + 7; const int MAXN = 22; int n; int a[MAXN][MAXN]; int dp[MAXN][(int)1 <<...
replace
13
14
13
14
-11
p03174
C++
Time Limit Exceeded
#include <bits/stdc++.h> using namespace std; int mp[25][25]; int mod = 1e9 + 7; int main() { int n; cin >> n; for (int i = 0; i < n; ++i) { for (int j = 0; j < n; ++j) { cin >> mp[i][j]; } } vector<int> dp(1 << n); dp[0] = 1; for (int man = 0; man < n; ++man) { vector<int> currDp(1 << n...
#include <bits/stdc++.h> using namespace std; int mp[25][25]; int mod = 1e9 + 7; int main() { int n; cin >> n; for (int i = 0; i < n; ++i) { for (int j = 0; j < n; ++j) { cin >> mp[i][j]; } } vector<int> dp(1 << n); dp[0] = 1; for (int man = 0; man < n; ++man) { vector<int> currDp(1 << n...
insert
17
17
17
20
TLE
p03174
C++
Time Limit Exceeded
#include <bits/stdc++.h> using namespace std; #define endl "\n" typedef long long int ll; inline void fastio() { ios::sync_with_stdio(false); cin.tie(0); } inline void setPrecision(int n) { cout.precision(n); } // DEBUG #define dbg(x) cerr << (#x) << ": " << x << endl #define dbgV(x) ...
#include <bits/stdc++.h> using namespace std; #define endl "\n" typedef long long int ll; inline void fastio() { ios::sync_with_stdio(false); cin.tie(0); } inline void setPrecision(int n) { cout.precision(n); } // DEBUG #define dbg(x) cerr << (#x) << ": " << x << endl #define dbgV(x) ...
replace
61
62
61
62
TLE
p03174
C++
Time Limit Exceeded
#include <algorithm> #include <cstring> #include <iostream> #include <limits.h> #include <map> #include <queue> #include <set> #include <stdio.h> #include <utility> #include <vector> #define MAX_DOUBLE 40000000000.0 #include <math.h> #include <unistd.h> using namespace std; long long mod = 1e9 + 7; bool graph[21][21...
#include <algorithm> #include <cstring> #include <iostream> #include <limits.h> #include <map> #include <queue> #include <set> #include <stdio.h> #include <utility> #include <vector> #define MAX_DOUBLE 40000000000.0 #include <math.h> #include <unistd.h> using namespace std; long long mod = 1e9 + 7; bool graph[21][21...
insert
37
37
37
45
TLE
p03174
C++
Time Limit Exceeded
#include "bits/stdc++.h" using namespace std; int MOD = 1000 * 1000 * 1000 + 7; const int MXN = 21; int n; int match[MXN][MXN]; int dp[MXN][(1 << MXN)]; int ways(int x, int bts) { if (x == n) { return (bts == ((1 << n) - 1)); } if (dp[x][bts] != -1) return dp[x][bts]; int res = 0; for (int i = 0;...
#include "bits/stdc++.h" using namespace std; int MOD = 1000 * 1000 * 1000 + 7; const int MXN = 21; int n; int match[MXN][MXN]; int dp[MXN][(1 << MXN)]; int ways(int x, int bts) { if (x == n) { return (bts == ((1 << n) - 1)); } if (dp[x][bts] != -1) return dp[x][bts]; int res = 0; for (int i = 0;...
insert
20
20
20
22
TLE
p03174
C++
Time Limit Exceeded
#include <bits/stdc++.h> #include <ext/pb_ds/assoc_container.hpp> #include <ext/pb_ds/tree_policy.hpp> using namespace std; using namespace __gnu_pbds; #define ll long long #define ull unsigned long long #define ld long double #define vi vector<int> #define vl vector<ll> #define vul vector<ull> #define pii pair<int, i...
#include <bits/stdc++.h> #include <ext/pb_ds/assoc_container.hpp> #include <ext/pb_ds/tree_policy.hpp> using namespace std; using namespace __gnu_pbds; #define ll long long #define ull unsigned long long #define ld long double #define vi vector<int> #define vl vector<ll> #define vul vector<ull> #define pii pair<int, i...
replace
108
109
108
109
TLE
p03174
C++
Time Limit Exceeded
#include <bits/stdc++.h> #define rep(i, n) for (ll i = 0; i < (ll)(n); i++) template <class T> bool chmax(T &a, const T &b) { if (a < b) { a = b; return 1; } return 0; } template <class T> bool chmin(T &a, const T &b) { if (b < a) { a = b; return 1; } return 0; } #define all(x) (x).begin(), ...
#include <bits/stdc++.h> #define rep(i, n) for (ll i = 0; i < (ll)(n); i++) template <class T> bool chmax(T &a, const T &b) { if (a < b) { a = b; return 1; } return 0; } template <class T> bool chmin(T &a, const T &b) { if (b < a) { a = b; return 1; } return 0; } #define all(x) (x).begin(), ...
replace
135
136
135
138
TLE
p03174
C++
Time Limit Exceeded
#include <iostream> #include <string> #include <vector> #define rep(i, n) for (int i = 0; i < (n); i++) using namespace std; typedef long long ll; const int mod = 1000000000 + 7; int count_bit(int n) { int ret = 0; rep(i, 30) { if (n & (1 << i)) ret++; } return ret; } int main() { int n; cin >>...
#include <iostream> #include <string> #include <vector> #define rep(i, n) for (int i = 0; i < (n); i++) using namespace std; typedef long long ll; const int mod = 1000000000 + 7; int count_bit(int n) { int ret = 0; rep(i, 30) { if (n & (1 << i)) ret++; } return ret; } int main() { int n; cin >>...
replace
26
27
26
27
TLE
p03174
C++
Memory Limit Exceeded
#include <bits/stdc++.h> using namespace std; #define int long long #define rep(i, n) for (int(i) = 0; (i) < (n); (i)++) #define rrep(i, n) for (int(i) = ((n)-1); (i) >= 0; (i)--) #define itn int #define all(x) (x).begin(), (x).end() #define F first #define S second const long long INF = 1LL << 60; const int MOD = 1000...
#include <bits/stdc++.h> using namespace std; #define int long long #define rep(i, n) for (int(i) = 0; (i) < (n); (i)++) #define rrep(i, n) for (int(i) = ((n)-1); (i) >= 0; (i)--) #define itn int #define all(x) (x).begin(), (x).end() #define F first #define S second const long long INF = 1LL << 60; const int MOD = 1000...
replace
101
103
101
103
MLE
p03174
C++
Runtime Error
#include <algorithm> #include <bitset> #include <cctype> #include <cmath> #include <complex> #include <cstdint> #include <cstdio> #include <cstdlib> #include <cstring> #include <ctime> #include <deque> #include <fstream> #include <functional> #include <iomanip> #include <iostream> #include <list> #include <map> #includ...
#include <algorithm> #include <bitset> #include <cctype> #include <cmath> #include <complex> #include <cstdint> #include <cstdio> #include <cstdlib> #include <cstring> #include <ctime> #include <deque> #include <fstream> #include <functional> #include <iomanip> #include <iostream> #include <list> #include <map> #includ...
replace
85
86
85
86
-11
p03174
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
23
24
23
24
-11
p03174
C++
Memory Limit Exceeded
#include <bits/stdc++.h> typedef long long ll; const int MN = 24, MOD = 1e9 + 7; int N, A[MN][MN], dp[MN][1 << MN]; inline int cb(int msk, int b) { return msk & ~(1 << b); } inline int sb(int msk, int b) { return msk | (1 << b); } inline int tb(int msk, int b) { return msk ^ (1 << b); } inline bool ib(int msk, int b) {...
#include <bits/stdc++.h> typedef long long ll; const int MN = 21, MOD = 1e9 + 7; int N, A[MN][MN], dp[MN][1 << MN]; inline int cb(int msk, int b) { return msk & ~(1 << b); } inline int sb(int msk, int b) { return msk | (1 << b); } inline int tb(int msk, int b) { return msk ^ (1 << b); } inline bool ib(int msk, int b) {...
replace
2
3
2
3
MLE
p03174
C++
Time Limit Exceeded
#include <iostream> #include <vector> using namespace std; // ref: https://atcoder.jp/contests/dp/submissions/7981121 int main(int argc, char const *argv[]) { int MOD = 1000000007; int N; cin >> N; vector<vector<int>> a(N, vector<int>(N)); for (int i = 0; i < N; i++) { for (int j = 0; j < N; j++) { ...
#include <iostream> #include <vector> using namespace std; // ref: https://atcoder.jp/contests/dp/submissions/7981121 int main(int argc, char const *argv[]) { int MOD = 1000000007; int N; cin >> N; vector<vector<int>> a(N, vector<int>(N)); for (int i = 0; i < N; i++) { for (int j = 0; j < N; j++) { ...
insert
22
22
22
25
TLE
p03174
C++
Time Limit Exceeded
#include <bits/stdc++.h> using namespace std; #define ll long long #define rep(i, n) for (ll i = 0; i < n; ++i) #define Graph vector<vector<ll>> #define INF (1ll << 60) #define mod 1000000007 template <class T> inline bool chmax(T &a, T b) { if (a < b) { a = b; return 1; } return 0; } template <class T> i...
#include <bits/stdc++.h> using namespace std; #define ll long long #define rep(i, n) for (ll i = 0; i < n; ++i) #define Graph vector<vector<ll>> #define INF (1ll << 60) #define mod 1000000007 template <class T> inline bool chmax(T &a, T b) { if (a < b) { a = b; return 1; } return 0; } template <class T> i...
insert
33
33
33
35
TLE
p03174
C++
Time Limit Exceeded
#define _CRT_SECURE_NO_WARNINGS #include <algorithm> #include <array> #include <bitset> #include <cassert> #include <ciso646> #include <climits> #include <cmath> #include <cstdio> #include <cstring> #include <fstream> #include <functional> #include <iomanip> #include <iostream> #include <limits> #include <list> #inclu...
#define _CRT_SECURE_NO_WARNINGS #include <algorithm> #include <array> #include <bitset> #include <cassert> #include <ciso646> #include <climits> #include <cmath> #include <cstdio> #include <cstring> #include <fstream> #include <functional> #include <iomanip> #include <iostream> #include <limits> #include <list> #inclu...
replace
305
306
305
306
TLE
p03174
C++
Time Limit Exceeded
#include <bits/stdc++.h> using namespace std; #define rep(i, a, b) for (int i = a; i < (b); ++i) #define debug(x) cerr << #x << ": " << x << endl #define trav(a, x) for (auto &a : x) #define all(x) x.begin(), x.end() #define sz(x) (int)(x).size() typedef long long ll; typedef pair<int, int> pii; typedef vector<int> vi;...
#include <bits/stdc++.h> using namespace std; #define rep(i, a, b) for (int i = a; i < (b); ++i) #define debug(x) cerr << #x << ": " << x << endl #define trav(a, x) for (auto &a : x) #define all(x) x.begin(), x.end() #define sz(x) (int)(x).size() typedef long long ll; typedef pair<int, int> pii; typedef vector<int> vi;...
replace
27
28
27
28
TLE
p03174
C++
Time Limit Exceeded
#include <bits/stdc++.h> using namespace std; #define ll long long #define endl "\n" #define FASTIO \ cin.tie(0); \ cout.tie(0); ...
#include <bits/stdc++.h> using namespace std; #define ll long long #define endl "\n" #define FASTIO \ cin.tie(0); \ cout.tie(0); ...
replace
26
27
26
27
TLE
p03174
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; #define mo 1000000007 #define ll long long int int n; int a[22][22]; ll dp[1500000][22]; ll func(int bm, int i) { if (i >= n) return (1); if (dp[bm][i] != -1) return (dp[bm][i]); ll ans = 0; for (int j = 0; j < n; j++) { int p = 1 << j; p = bm & ...
#include <bits/stdc++.h> using namespace std; #define mo 1000000007 #define ll long long int int n; int a[22][22]; ll dp[2200000][22]; ll func(int bm, int i) { if (i >= n) return (1); if (dp[bm][i] != -1) return (dp[bm][i]); ll ans = 0; for (int j = 0; j < n; j++) { int p = 1 << j; p = bm & ...
replace
6
7
6
7
-11
p03174
C++
Time Limit Exceeded
#include <bits/stdc++.h> #define DIM 23 #define INF 1000000000000000007LL #define modulo 1000000007 using namespace std; long long n, a[DIM][DIM], d[DIM][1 << 21]; bool isbit(int mask, int num) { return (mask >> (num - 1)) & 1; } void sbit(int &mask, int num) { mask ^= 1 << (num - 1); } int main() { cin >> n; for...
#include <bits/stdc++.h> #define DIM 23 #define INF 1000000000000000007LL #define modulo 1000000007 using namespace std; long long n, a[DIM][DIM], d[DIM][1 << 21]; bool isbit(int mask, int num) { return (mask >> (num - 1)) & 1; } void sbit(int &mask, int num) { mask ^= 1 << (num - 1); } int main() { cin >> n; for...
replace
17
26
17
28
TLE
p03174
C++
Time Limit Exceeded
#include "bits/stdc++.h" using namespace std; #define endl "\n" typedef long long int ll; inline void fastio() { ios::sync_with_stdio(false); cin.tie(0); cout.tie(0); } inline void setPrecision(int n) { cout.precision(n); } // DEBUG #define dbg(x) cerr << (#x) << ": " << x << endl #define dbgV(x) ...
#include "bits/stdc++.h" using namespace std; #define endl "\n" typedef long long int ll; inline void fastio() { ios::sync_with_stdio(false); cin.tie(0); cout.tie(0); } inline void setPrecision(int n) { cout.precision(n); } // DEBUG #define dbg(x) cerr << (#x) << ": " << x << endl #define dbgV(x) ...
replace
63
64
63
64
TLE
p03174
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; bool grid[22][22]; int N = 22, n, mod = 1e9 + 7, dp[22][22]; int solve(int m, int w) { if (m == n) { if (w == 0) return 1; return 0; } if (dp[m][w] != -1) return dp[m][w]; int ans = 0; for (int i = 0; i < n; i++) { bool okay = ((((1 << i) & w...
#include <bits/stdc++.h> using namespace std; const int N = 24; bool grid[24][24]; long long n, mod = 1e9 + 7, dp[24][1 << 22]; int solve(int m, int w) { if (m == n) { if (w == 0) return 1; return 0; } if (dp[m][w] != -1) return dp[m][w]; int ans = 0; for (int i = 0; i < n; i++) { bool o...
replace
2
4
2
5
0
p03174
C++
Time Limit Exceeded
#include <bits/stdc++.h> #define ll long long using namespace std; int n; int maska[25]; int mod = 1e9 + 7; int dp[25][(1 << 22)]; int main() { cin >> n; for (int i = 1; n >= i; i++) { int val = 1; for (int j = 0; n > j; j++) { int a; cin >> a; if (a == 1) maska[i] ^= val; va...
#include <bits/stdc++.h> #define ll long long using namespace std; int n; int maska[25]; int mod = 1e9 + 7; int dp[25][(1 << 22)]; int main() { cin >> n; for (int i = 1; n >= i; i++) { int val = 1; for (int j = 0; n > j; j++) { int a; cin >> a; if (a == 1) maska[i] ^= val; va...
insert
22
22
22
24
TLE
p03174
C++
Time Limit Exceeded
#include <bits/stdc++.h> using namespace std; using uint = unsigned int; using lint = long long int; using ulint = unsigned long long int; template <class T = int> using V = vector<T>; template <class T = int> using VV = V<V<T>>; template <class T, class U> void assign(V<T> &v, int n, const U &a) { v.assign(n, a); } ...
#include <bits/stdc++.h> using namespace std; using uint = unsigned int; using lint = long long int; using ulint = unsigned long long int; template <class T = int> using V = vector<T>; template <class T = int> using VV = V<V<T>>; template <class T, class U> void assign(V<T> &v, int n, const U &a) { v.assign(n, a); } ...
replace
144
150
144
151
TLE
p03174
C++
Memory Limit Exceeded
/* HELLO WORLD ----------- SHUBHAM ----------- :) CODING */ #include <bits/stdc++.h> #include <ext/pb_ds/assoc_container.hpp> #include <ext/pb_ds/tree_policy.hpp> using namespace std; using namespace __gnu_pbds; #define ff first #define ss second #define pb push_back #define in...
/* HELLO WORLD ----------- SHUBHAM ----------- :) CODING */ #include <bits/stdc++.h> #include <ext/pb_ds/assoc_container.hpp> #include <ext/pb_ds/tree_policy.hpp> using namespace std; using namespace __gnu_pbds; #define ff first #define ss second #define pb push_back // #define...
replace
17
18
17
18
MLE
p03174
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; const int mod = 1e9 + 7; int main() { ios_base::sync_with_stdio(false); cin.tie(nullptr); cout.tie(nullptr); int N; char ch; cin >> N; vector<int> adj(N); for (int i = 0; i < N; ++i) for (int j = 0; j < N; ++j) { cin >> ch; if (ch == '1') ...
#include <bits/stdc++.h> using namespace std; const int mod = 1e9 + 7; int main() { ios_base::sync_with_stdio(false); cin.tie(nullptr); cout.tie(nullptr); int N; char ch; cin >> N; vector<int> adj(N); for (int i = 0; i < N; ++i) for (int j = 0; j < N; ++j) { cin >> ch; if (ch == '1') ...
replace
24
30
24
29
0
p03174
C++
Time Limit Exceeded
#include <algorithm> //swap function is here #include <bits/stdc++.h> #include <cassert> #include <climits> #include <cstdlib> #include <cstring> #include <fstream> #include <iomanip> #include <iostream> #include <map> #include <queue> #include <sstream> // istringstream buffer(myString); #include <stack> #include <vec...
#include <algorithm> //swap function is here #include <bits/stdc++.h> #include <cassert> #include <climits> #include <cstdlib> #include <cstring> #include <fstream> #include <iomanip> #include <iostream> #include <map> #include <queue> #include <sstream> // istringstream buffer(myString); #include <stack> #include <vec...
replace
141
142
141
142
TLE
p03174
C++
Runtime Error
#pragma GCC optimize("Ofast", "unroll-loops") #include <bits/stdc++.h> #define pb push_back #define eb emplace_back #define MP make_pair #define F first #define S second #define MEM(a, b) memset(a, b, sizeof a) #define Tie ios::sync_with_stdio(0), cin.tie(0); using namespace std; typedef long long ll; typedef pair<int,...
#pragma GCC optimize("Ofast", "unroll-loops") #include <bits/stdc++.h> #define pb push_back #define eb emplace_back #define MP make_pair #define F first #define S second #define MEM(a, b) memset(a, b, sizeof a) #define Tie ios::sync_with_stdio(0), cin.tie(0); using namespace std; typedef long long ll; typedef pair<int,...
replace
14
15
14
15
0
p03174
C++
Time Limit Exceeded
#include <bits/stdc++.h> using namespace std; using ll = long long; using P = pair<ll, ll>; using Graph = vector<vector<ll>>; #define rep(i, n) for (ll i = 0; i < (ll)(n); i++) #define rep2(i, m, n) for (ll i = m; i < (ll)(n); i++) #define rrep(i, n, m) for (ll i = n; i >= (ll)(m); i--) const int dx[4] = {1, 0, -1, 0...
#include <bits/stdc++.h> using namespace std; using ll = long long; using P = pair<ll, ll>; using Graph = vector<vector<ll>>; #define rep(i, n) for (ll i = 0; i < (ll)(n); i++) #define rep2(i, m, n) for (ll i = m; i < (ll)(n); i++) #define rrep(i, n, m) for (ll i = n; i >= (ll)(m); i--) const int dx[4] = {1, 0, -1, 0...
insert
38
38
38
40
TLE
p03174
C++
Time Limit Exceeded
#include <bits/stdc++.h> using namespace std; // Define using ll = long long; using ull = unsigned long long; using ld = long double; const ll dx[4] = {1, 0, -1, 0}; const ll dy[4] = {0, 1, 0, -1}; const ll MOD = 1e9 + 7; const ll mod = 998244353; const ll inf = 1 << 30; const ll LINF = LONG_MAX; const ll INF = 1LL <<...
#include <bits/stdc++.h> using namespace std; // Define using ll = long long; using ull = unsigned long long; using ld = long double; const ll dx[4] = {1, 0, -1, 0}; const ll dy[4] = {0, 1, 0, -1}; const ll MOD = 1e9 + 7; const ll mod = 998244353; const ll inf = 1 << 30; const ll LINF = LONG_MAX; const ll INF = 1LL <<...
insert
651
651
651
653
TLE
p03174
C++
Time Limit Exceeded
#include <bits/stdc++.h> using namespace std; typedef long long ll; typedef pair<ll, ll> P; const ll MOD = 1e9 + 7; const ll INF = 1e18; #define rep(i, m, n) for (ll i = (m); i < (n); i++) #define rrep(i, m, n) for (ll i = (m); i >= (n); i--) #define print(x) cout << (x) << endl; #define printa(x, m, n) ...
#include <bits/stdc++.h> using namespace std; typedef long long ll; typedef pair<ll, ll> P; const ll MOD = 1e9 + 7; const ll INF = 1e18; #define rep(i, m, n) for (ll i = (m); i < (n); i++) #define rrep(i, m, n) for (ll i = (m); i >= (n); i--) #define print(x) cout << (x) << endl; #define printa(x, m, n) ...
replace
33
37
33
39
TLE
p03174
C++
Runtime Error
#include <bits/stdc++.h> #define ll long long #define ff first #define ss second #define pb push_back using namespace std; const int N = 1e6 + 69, INF = 1e9, mod = 1e9 + 7; const ll INFLL = 1e18; int n, K; ll dp[405][405], A[30][30], sum[405][405]; int main() { cin >> n; for (int i = 0; i < n; i++) { fo...
#include <bits/stdc++.h> #define ll long long #define ff first #define ss second #define pb push_back using namespace std; const int N = 1e6 + 69, INF = 1e9, mod = 1e9 + 7; const ll INFLL = 1e18; int n, K; ll dp[22][(1 << 22)], A[30][30], sum[405][405]; int main() { cin >> n; for (int i = 0; i < n; i++) { ...
replace
14
15
14
15
0
p03174
C++
Time Limit Exceeded
#include <algorithm> #include <bitset> #include <cassert> #include <cctype> #include <cmath> #include <complex> #include <cstdlib> #include <cstring> #include <fstream> #include <functional> #include <iomanip> #include <iostream> #include <iterator> #include <list> #include <map> #include <queue> #include <random> #inc...
#include <algorithm> #include <bitset> #include <cassert> #include <cctype> #include <cmath> #include <complex> #include <cstdlib> #include <cstring> #include <fstream> #include <functional> #include <iomanip> #include <iostream> #include <iterator> #include <list> #include <map> #include <queue> #include <random> #inc...
replace
54
55
54
55
TLE
p03174
C++
Time Limit Exceeded
// ############################################################################# #include "bits/stdc++.h" // ############################################################################# // Macros #define MOD 1000000007 #define INF 1000000000000009 #define eb emplace_back #define mp make_pair #define fr first #define s...
// ############################################################################# #include "bits/stdc++.h" // ############################################################################# // Macros #define MOD 1000000007 #define INF 1000000000000009 #define eb emplace_back #define mp make_pair #define fr first #define s...
insert
87
87
87
90
TLE
p03174
C++
Time Limit Exceeded
#include "bits/stdc++.h" using namespace std; using ll = long long; using ld = long double; using P = pair<int, int>; constexpr ld EPS = 1e-12; constexpr int INF = numeric_limits<int>::max() / 2; constexpr int MOD = 1e9 + 7; template <typename T> void printv(const vector<T> &v) { int sz = v.size(); for (int i = ...
#include "bits/stdc++.h" using namespace std; using ll = long long; using ld = long double; using P = pair<int, int>; constexpr ld EPS = 1e-12; constexpr int INF = numeric_limits<int>::max() / 2; constexpr int MOD = 1e9 + 7; template <typename T> void printv(const vector<T> &v) { int sz = v.size(); for (int i = ...
replace
35
42
35
42
TLE
p03174
C++
Time Limit Exceeded
#include <bits/stdc++.h> using namespace std; typedef long long ll; #define EPS (1e-7) #define INF (1e9) #define PI (acos(-1)) const int mod = 1000000007; int dp[3000000][22]; bool field[22][22]; vector<int> in[3000000]; int n; int main() { // cout.precision(10); cin >> n; for (int i = 1; i <= n; i++) { for ...
#include <bits/stdc++.h> using namespace std; typedef long long ll; #define EPS (1e-7) #define INF (1e9) #define PI (acos(-1)) const int mod = 1000000007; int dp[3000000][22]; bool field[22][22]; vector<int> in[3000000]; int n; int main() { // cout.precision(10); cin >> n; for (int i = 1; i <= n; i++) { for ...
insert
35
35
35
37
TLE
p03174
C++
Runtime Error
#include <bits/stdc++.h> typedef int64_t LL; using namespace std; const int N = 25; const int mod = 1e9 + 7; bool A[N][N]; int n; int dp[N][1 << 21]; LL solve(int k, int used) { if (k == n) return 1LL; if (dp[k][used] >= 0) return dp[k][used]; LL res = 0; for (int i = 0; i < n; i++) { if (A[k][i] &...
#include <bits/stdc++.h> typedef int64_t LL; using namespace std; const int N = 25; const int mod = 1e9 + 7; bool A[N][N]; int n; int dp[N][1 << 21]; LL solve(int k, int used) { if (k == n) return 1LL; if (dp[k][used] >= 0) return dp[k][used]; LL res = 0; for (int i = 0; i < n; i++) { if (A[k][i] &...
replace
33
34
33
34
-11
p03174
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; #define rep(i, s, n) for (int i = (int)s; i < (int)n; i++) #define ll long long #define ld long double #define pb push_back #define eb emplace_back #define All(x) x.begin(), x.end() #define Range(x, i, j) x.begin() + i, x.begin() + j #define lbidx(x, y) lower_bound(x.begin...
#include <bits/stdc++.h> using namespace std; #define rep(i, s, n) for (int i = (int)s; i < (int)n; i++) #define ll long long #define ld long double #define pb push_back #define eb emplace_back #define All(x) x.begin(), x.end() #define Range(x, i, j) x.begin() + i, x.begin() + j #define lbidx(x, y) lower_bound(x.begin...
replace
221
222
221
222
-11
p03174
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; #define fi first #define se second #define pb push_back #define mp make_pair #define int long long typedef pair<int, int> ii; const int mod = 1e9 + 7; const int N = 21; int n, a[N][N], dp[N][(1 << N)]; signed main() { cin.tie(0), ios::sync_with_stdio(0); cin >> ...
#include <bits/stdc++.h> using namespace std; #define fi first #define se second #define pb push_back #define mp make_pair #define int long long typedef pair<int, int> ii; const int mod = 1e9 + 7; const int N = 22; int n, a[N][N], dp[N][(1 << N)]; signed main() { cin.tie(0), ios::sync_with_stdio(0); cin >> ...
replace
15
16
15
16
-11
p03174
C++
Memory Limit Exceeded
#include <bits/stdc++.h> #define int long long #define CLK clock_t clk = clock(); // Start of main #define OCLK \ cerr << "Time (in ms): " \ << (double)(clock() - clk) * 1000.0 / CLOCKS_PER_SEC...
#include <bits/stdc++.h> #define ll long long #define CLK clock_t clk = clock(); // Start of main #define OCLK \ cerr << "Time (in ms): " \ << (double)(clock() - clk) * 1000.0 / CLOCKS_PER_SEC ...
replace
1
2
1
2
MLE
p03174
Python
Time Limit Exceeded
import numpy as np N = int(input()) A = [np.flatnonzero(np.array(list(map(int, input().split())))) for _ in range(N)] MOD = 10**9 + 7 dp = np.zeros(1 << N, dtype=np.int64) dp[0] = 1 for a in A: new_dp = np.zeros_like(dp) for i in a: x = 1 << i new_dp[x:] += dp[:-x] dp = new_dp dp %= MO...
import numpy as np N = int(input()) A = [np.array(list(map(int, input().split()))).nonzero()[0] for _ in range(N)] MOD = 10**9 + 7 dp = np.zeros(1 << N, dtype=np.int64) dp[0] = 1 for a in A: new_dp = np.zeros_like(dp) for i in a: x = 1 << i new_dp[x:] += dp[:-x] dp = new_dp dp %= MOD p...
replace
3
4
3
4
TLE
p03174
C++
Time Limit Exceeded
#include <algorithm> #include <bitset> #include <climits> #include <cmath> #include <cstdio> #include <iomanip> #include <iostream> #include <map> #include <numeric> #include <queue> #include <set> #include <sstream> #include <stack> #include <string> #include <unordered_map> #include <vector> #define MOD 1000000007 #...
#include <algorithm> #include <bitset> #include <climits> #include <cmath> #include <cstdio> #include <iomanip> #include <iostream> #include <map> #include <numeric> #include <queue> #include <set> #include <sstream> #include <stack> #include <string> #include <unordered_map> #include <vector> #define MOD 1000000007 #...
replace
117
118
117
118
TLE
p03174
C++
Memory Limit Exceeded
#include <bits/stdc++.h> using namespace std; // using lint = long long; struct P { int x, y; bool operator<(const P &a) const { if (x != a.x) return x > a.x; return y > a.y; } }; vector<int> v[1], v1; // bitset<4001000> b; int i, n, d, m, k, a, b, c, h; int o[1111][33]; long long l[33][4000511...
#include <bits/stdc++.h> using namespace std; // using lint = long long; struct P { int x, y; bool operator<(const P &a) const { if (x != a.x) return x > a.x; return y > a.y; } }; vector<int> v[1], v1; // bitset<4001000> b; int i, n, d, m, k, a, b, c, h; int o[1111][33]; long long l[23][2500511...
replace
20
21
20
21
MLE
p03174
C++
Time Limit Exceeded
#include <bits/stdc++.h> using namespace std; using ll = long long; using P = pair<ll, ll>; using Graph = vector<vector<ll>>; #define rep(i, n) for (ll i = 0; i < (ll)(n); i++) #define rep2(i, m, n) for (ll i = m; i < (ll)(n); i++) #define rrep(i, n, m) for (ll i = n; i >= (ll)(m); i--) const int dx[4] = {1, 0, -1, 0...
#include <bits/stdc++.h> using namespace std; using ll = long long; using P = pair<ll, ll>; using Graph = vector<vector<ll>>; #define rep(i, n) for (ll i = 0; i < (ll)(n); i++) #define rep2(i, m, n) for (ll i = m; i < (ll)(n); i++) #define rrep(i, n, m) for (ll i = n; i >= (ll)(m); i--) const int dx[4] = {1, 0, -1, 0...
replace
118
119
118
119
TLE
p03174
C++
Memory Limit Exceeded
// Author : Siriuslight #include "bits/stdc++.h" #include "ext/pb_ds/assoc_container.hpp" #include "ext/pb_ds/tree_policy.hpp" #define FIO \ ios_base::sync_with_stdio(false), cin.tie(0), cout.tie(0), \ cout << setprecision(10) ...
// Author : Siriuslight #include "bits/stdc++.h" #include "ext/pb_ds/assoc_container.hpp" #include "ext/pb_ds/tree_policy.hpp" #define FIO \ ios_base::sync_with_stdio(false), cin.tie(0), cout.tie(0), \ cout << setprecision(10) ...
replace
7
8
7
8
MLE
p03174
C++
Time Limit Exceeded
#include <bits/stdc++.h> using namespace std; #define vi vector<int> #define vvi vector<vi> #define pii pair<int, int> #define ll long long template <typename T, typename U> static inline void amin(T &x, U y) { if (x > y) x = y; } template <typename T, typename U> static inline void amax(T &x, U y) { if (x < y...
#include <bits/stdc++.h> using namespace std; #define vi vector<int> #define vvi vector<vi> #define pii pair<int, int> #define ll long long template <typename T, typename U> static inline void amin(T &x, U y) { if (x > y) x = y; } template <typename T, typename U> static inline void amax(T &x, U y) { if (x < y...
replace
34
35
34
35
TLE
p03175
C++
Runtime Error
/* Written by Nitrogens Desire for getting accepted!! */ #include <algorithm> #include <bitset> #include <cmath> #include <cstdio> #include <cstdlib> #include <cstring> #include <ctime> #include <iostream> #include <map> #include <queue> #include <set> #include <stack> #include <vector> using namespace std; ty...
/* Written by Nitrogens Desire for getting accepted!! */ #include <algorithm> #include <bitset> #include <cmath> #include <cstdio> #include <cstdlib> #include <cstring> #include <ctime> #include <iostream> #include <map> #include <queue> #include <set> #include <stack> #include <vector> using namespace std; ty...
replace
50
51
50
51
0
p03175
C++
Runtime Error
// You either die a hero, or you live long enough to see yourself become the // villain. /** * author: Blind_is_love * created: 12.10.2019, 21:07 **/ #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; typede...
// You either die a hero, or you live long enough to see yourself become the // villain. /** * author: Blind_is_love * created: 12.10.2019, 21:07 **/ #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; typede...
replace
91
92
91
92
0
time taken: 9.7e-05
p03175
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; #define rep(i, n) for (int i = 0; i < (int)(n); i++) typedef long long ll; struct ModInt { using M = ModInt; long long v; ModInt(long long _v = 0) : v(_v % MOD + MOD) { norm(); } M &norm() { v = (v < MOD) ? v : v - MOD; return *this; } M operator+(const...
#include <bits/stdc++.h> using namespace std; #define rep(i, n) for (int i = 0; i < (int)(n); i++) typedef long long ll; struct ModInt { using M = ModInt; long long v; ModInt(long long _v = 0) : v(_v % MOD + MOD) { norm(); } M &norm() { v = (v < MOD) ? v : v - MOD; return *this; } M operator+(const...
replace
69
70
69
70
0
p03175
C++
Runtime Error
#include <bits/stdc++.h> #define st first #define nd second #define pb push_back #define ppb pop_back #define ppf pop_front #define umax(x, y) x = max(x, y) #define umin(x, y) x = min(x, y) #define ll long long #define ii pair<int, int> #define iii pair<ii, int> #define iiii pair<ii, ii> #define sz(x) ((int)x.size()) #...
#include <bits/stdc++.h> #define st first #define nd second #define pb push_back #define ppb pop_back #define ppf pop_front #define umax(x, y) x = max(x, y) #define umin(x, y) x = min(x, y) #define ll long long #define ii pair<int, int> #define iii pair<ii, int> #define iiii pair<ii, ii> #define sz(x) ((int)x.size()) #...
replace
22
23
22
23
0
p03175
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; typedef long long ll; pair<ll, ll> func(vector<vector<int>> &v, bool b[], int ind, ll &mod) { b[ind] = 1; ll t = 1, t1 = 1; for (int i = 0; i < v[ind].size(); i++) { if (b[v[ind][i]] == 0) { pair<ll, ll> p; p = func(v, b, v[ind][i], mod); t = (t...
#include <bits/stdc++.h> using namespace std; typedef long long ll; pair<ll, ll> func(vector<vector<int>> &v, bool b[], int ind, ll &mod) { b[ind] = 1; ll t = 1, t1 = 1; for (int i = 0; i < v[ind].size(); i++) { if (b[v[ind][i]] == 0) { pair<ll, ll> p; p = func(v, b, v[ind][i], mod); t = (t...
replace
20
22
20
24
0
p03175
C++
Time Limit Exceeded
#include <bits/stdc++.h> #include <ext/pb_ds/assoc_container.hpp> #include <ext/pb_ds/tree_policy.hpp> #define ll long long #define pb push_back #define ppb pop_back #define endl '\n' #define mii map<ll, ll> #define pii pair<ll, ll> #define vi vector<ll> #define vs vector<string> #define all(a) (a).begin(), (a).end() ...
#include <bits/stdc++.h> #include <ext/pb_ds/assoc_container.hpp> #include <ext/pb_ds/tree_policy.hpp> #define ll long long #define pb push_back #define ppb pop_back #define endl '\n' #define mii map<ll, ll> #define pii pair<ll, ll> #define vi vector<ll> #define vs vector<string> #define all(a) (a).begin(), (a).end() ...
replace
68
69
68
71
TLE
p03175
C++
Memory Limit Exceeded
#include <iostream> #include <vector> using namespace std; using ll = long long; ll mod = 1e9 + 7; pair<ll, ll> dfs(int s, vector<int> graph[], vector<bool> visited) { visited[s] = 1; pair<ll, ll> pr = {1, 1}; for (int v : graph[s]) { if (!visited[v]) { pair<ll, ll> pr1 = dfs(v, graph, visited); p...
#include <iostream> #include <vector> using namespace std; using ll = long long; ll mod = 1e9 + 7; pair<ll, ll> dfs(int s, vector<int> graph[], vector<bool> &visited) { visited[s] = 1; pair<ll, ll> pr = {1, 1}; for (int v : graph[s]) { if (!visited[v]) { pair<ll, ll> pr1 = dfs(v, graph, visited); ...
replace
5
6
5
6
MLE
p03175
C++
Runtime Error
#include <bits/stdc++.h> #define ll long long #define pb emplace_back using namespace std; const int MAXN = 1e5 + 10, MD = 1e9 + 7; int n; ll dp[MAXN][2]; vector<int> g[MAXN]; void Dfs(int v = 1, int p = -1) { dp[v][0] = 1; dp[v][1] = 1; for (auto i : g[v]) { if (p == i) continue; Dfs(i, v); ...
#include <bits/stdc++.h> #define ll long long #define pb emplace_back using namespace std; const int MAXN = 1e5 + 10, MD = 1e9 + 7; int n; ll dp[MAXN][2]; vector<int> g[MAXN]; void Dfs(int v = 1, int p = -1) { dp[v][0] = 1; dp[v][1] = 1; for (auto i : g[v]) { if (p == i) continue; Dfs(i, v); ...
replace
28
29
28
29
0
p03175
C++
Time Limit Exceeded
#include <bits/stdc++.h> using namespace std; #define fori(i, a, b) for (int i = a; i <= b; i++) #define ford(i, a, b) for (int i = a; i >= b; i--) #define all(a) a.begin(), a.end() #define in(c, x) ((c).find(x) != (c).end()) #define isp(c, x) (find(all(c), x) != (c).end()) #define pb push_back #define ppb pop_back #d...
#include <bits/stdc++.h> using namespace std; #define fori(i, a, b) for (int i = a; i <= b; i++) #define ford(i, a, b) for (int i = a; i >= b; i--) #define all(a) a.begin(), a.end() #define in(c, x) ((c).find(x) != (c).end()) #define isp(c, x) (find(all(c), x) != (c).end()) #define pb push_back #define ppb pop_back #d...
replace
37
39
37
39
TLE
p03175
C++
Runtime Error
#include "bits/stdc++.h" using namespace std; int f[100001][2]; int head[100001], to[100001], nxt[100001]; int tot; int n; void addedge(int u, int v) { tot++; nxt[tot] = head[u]; to[tot] = v; head[u] = tot; } void dfs(int index, int p) { f[index][0] = f[index][1] = 1; for (int i = head[index]; i; i = nxt[i]...
#include "bits/stdc++.h" using namespace std; int f[100001][2]; int head[100001], to[200001], nxt[200001]; int tot; int n; void addedge(int u, int v) { tot++; nxt[tot] = head[u]; to[tot] = v; head[u] = tot; } void dfs(int index, int p) { f[index][0] = f[index][1] = 1; for (int i = head[index]; i; i = nxt[i]...
replace
3
4
3
4
0
p03175
C++
Runtime Error
#include <iostream> #include <vector> using namespace std; // dp[i][j]=(頂点iを(j = 1黒く: j = // 0白く)塗ったとき、iを親とする部分木の塗り方の場合の数) int dp[100100][2]; int dp[100][2]; vector<vector<int>> g; const int MOD = 1e9 + 7; void dfs(int v, int p) { dp[v][0] = 1; dp[v][1] = 1; for (auto next_n : g[v]) { if (next_n == p) ...
#include <iostream> #include <vector> using namespace std; // dp[i][j]=(頂点iを(j = 1黒く: j = // 0白く)塗ったとき、iを親とする部分木の塗り方の場合の数) long long dp[100100][2]; // long long dp[100][2]; vector<vector<int>> g; const int MOD = 1e9 + 7; void dfs(int v, int p) { dp[v][0] = 1; dp[v][1] = 1; for (auto next_n : g[v]) { if (...
replace
6
8
6
9
0
p03175
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; #define int long long int #define ld long double #define ff first #define ss second #define mp make_pair #define pb push_back #define endl "\n" #define si set<int> #define vi vector<int> #define pii pair<int, int> #define vpii vector<pii> #define mii map<int, int> #define...
#include <bits/stdc++.h> using namespace std; #define int long long int #define ld long double #define ff first #define ss second #define mp make_pair #define pb push_back #define endl "\n" #define si set<int> #define vi vector<int> #define pii pair<int, int> #define vpii vector<pii> #define mii map<int, int> #define...
delete
118
122
118
118
0
p03175
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 F first #define S second #define vi vector<int> #define mii map<int, i...
#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 F first #define S second #define vi vector<int> #define mii map<int, i...
replace
64
65
64
65
-11
p03175
C++
Runtime Error
// KiSmAt #include "bits/stdc++.h" using namespace std; using ll = long long; const ll inf = 1e18; const int mod = 1e9 + 7; const int N = 2 * 1e5 + 10; ll res; ll a[N], dp[N][2]; vector<ll> v[N]; inline ll add(ll x, ll y) { return (x % mod + y % mod) % mod; } inline ll sub(ll x...
// KiSmAt #include "bits/stdc++.h" using namespace std; using ll = long long; const ll inf = 1e18; const int mod = 1e9 + 7; const int N = 2 * 1e5 + 10; ll res; ll a[N], dp[N][2]; vector<ll> v[N]; inline ll add(ll x, ll y) { return (x % mod + y % mod) % mod; } inline ll sub(ll x...
replace
27
28
27
28
-11
p03175
C++
Runtime Error
#include <bits/stdc++.h> #define ALL(x) x.begin(), x.end() using namespace std; typedef long long ll; typedef vector<int> vi; ll mod = 1e9 + 7; vector<vi> memo(10123, vi(2)); vector<vi> adj(10123); void dfs(int u, int p) { if (memo[u][0]) { return; } ll black = 1, white = 1; for (int v : adj[u]) { ...
#include <bits/stdc++.h> #define ALL(x) x.begin(), x.end() using namespace std; typedef long long ll; typedef vector<int> vi; ll mod = 1e9 + 7; vector<vi> memo(100123, vi(2)); vector<vi> adj(100123); void dfs(int u, int p) { if (memo[u][0]) { return; } ll black = 1, white = 1; for (int v : adj[u]) { ...
replace
11
13
11
13
0
p03175
C++
Time Limit Exceeded
#include <bits/stdc++.h> using namespace std; #define popcnt(a) __builtin_popcount(a) #define FastIO() ios::sync_with_stdio(false), cin.tie(0); #define IO() freopen("palindrome.in", "rw", stdin) #define error(args...) \ { ...
#include <bits/stdc++.h> using namespace std; #define popcnt(a) __builtin_popcount(a) #define FastIO() ios::sync_with_stdio(false), cin.tie(0); #define IO() freopen("palindrome.in", "rw", stdin) #define error(args...) \ { ...
delete
29
30
29
29
TLE
p03175
C++
Runtime Error
#include <bits/stdc++.h> // #include <ext/numeric> #include <ext/pb_ds/assoc_container.hpp> // Common file #include <ext/pb_ds/tree_policy.hpp> // Including tree_order_statistics_node_update #define oo 0x3f3f3f3f #define OO 0x3f3f3f3f3f3f3f3f #define ones(n) __builtin_popcount(n) #define ONES(n) __builtin_popcountll(n)...
#include <bits/stdc++.h> // #include <ext/numeric> #include <ext/pb_ds/assoc_container.hpp> // Common file #include <ext/pb_ds/tree_policy.hpp> // Including tree_order_statistics_node_update #define oo 0x3f3f3f3f #define OO 0x3f3f3f3f3f3f3f3f #define ones(n) __builtin_popcount(n) #define ONES(n) __builtin_popcountll(n)...
replace
21
22
21
22
0
p03175
C++
Runtime Error
/* Written by Nitrogens Desire for getting accepted!! */ #include <algorithm> #include <bitset> #include <cmath> #include <cstdio> #include <cstdlib> #include <cstring> #include <ctime> #include <iostream> #include <map> #include <queue> #include <set> #include <stack> #include <vector> using namespace std; ty...
/* Written by Nitrogens Desire for getting accepted!! */ #include <algorithm> #include <bitset> #include <cmath> #include <cstdio> #include <cstdlib> #include <cstring> #include <ctime> #include <iostream> #include <map> #include <queue> #include <set> #include <stack> #include <vector> using namespace std; ty...
replace
49
50
49
50
0
p03175
C++
Runtime Error
#include "bits/stdc++.h" using namespace std; #define FI freopen("in.txt", "r", stdin) #define FO freopen("out.txt", "w", stdout) #define FAST ios_base::sync_with_stdio(false), cin.tie(NULL), cout.tie(NULL) #define FOR(i, n) for (int i = 1; i <= n; i++) #define For(i, n) for (int i = 0; i < n; i++) #define ROF(i, n)...
#include "bits/stdc++.h" using namespace std; #define FI freopen("in.txt", "r", stdin) #define FO freopen("out.txt", "w", stdout) #define FAST ios_base::sync_with_stdio(false), cin.tie(NULL), cout.tie(NULL) #define FOR(i, n) for (int i = 1; i <= n; i++) #define For(i, n) for (int i = 0; i < n; i++) #define ROF(i, n)...
replace
130
131
130
131
0
tlebel: 3
p03175
C++
Time Limit Exceeded
#include <bits/stdc++.h> using namespace std; const long long MOD = 1000000007; pair<long long, long long> dfs(vector<vector<int>> c, int v) { long long ans0 = 1, ans1 = 1; for (int w : c[v]) { pair<long long, long long> P = dfs(c, w); ans0 *= (P.first + P.second); ans0 %= MOD; ans1 *= P.first; ...
#include <bits/stdc++.h> using namespace std; const long long MOD = 1000000007; pair<long long, long long> dfs(vector<vector<int>> &c, int v) { long long ans0 = 1, ans1 = 1; for (int w : c[v]) { pair<long long, long long> P = dfs(c, w); ans0 *= (P.first + P.second); ans0 %= MOD; ans1 *= P.first; ...
replace
3
4
3
4
TLE
p03175
C++
Time Limit Exceeded
#include <bits/stdc++.h> using namespace std; #define ll long long #define MOD 1000000007 #define sz 100100 ll dp[sz][2]; inline ll mul(ll a, ll b) { a = ((a % MOD) + MOD) % MOD; b = ((b % MOD) + MOD) % MOD; return (a * b) % MOD; } inline ll add(ll a, ll b) { a = ((a % MOD) + MOD) % MOD; b = ((b % MOD) + M...
#include <bits/stdc++.h> using namespace std; #define ll long long #define MOD 1000000007 #define sz 100100 ll dp[sz][2]; inline ll mul(ll a, ll b) { a = ((a % MOD) + MOD) % MOD; b = ((b % MOD) + MOD) % MOD; return (a * b) % MOD; } inline ll add(ll a, ll b) { a = ((a % MOD) + MOD) % MOD; b = ((b % MOD) + M...
replace
30
31
30
31
TLE
p03175
C++
Time Limit Exceeded
#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; #define rep(i, a, n) for (int i = a; i < n; i++) #define per(i, a, n) for (int i = n - 1; i >= a; i--) #define mp make_pair #define fi first #define se second #define S...
#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; #define rep(i, a, n) for (int i = a; i < n; i++) #define per(i, a, n) for (int i = n - 1; i >= a; i--) #define mp make_pair #define fi first #define se second #define S...
replace
110
111
110
112
TLE
p03175
C++
Runtime Error
#include <algorithm> #include <cstdio> #include <iostream> #include <math.h> #include <queue> #include <stack> #include <string> #include <vector> const long long INF = 1000000007; using namespace std; typedef long long ll; typedef pair<int, int> pii; typedef pair<int, pii> piii; typedef pair<pii, pii> piiii; int n...
#include <algorithm> #include <cstdio> #include <iostream> #include <math.h> #include <queue> #include <stack> #include <string> #include <vector> const long long INF = 1000000007; using namespace std; typedef long long ll; typedef pair<int, int> pii; typedef pair<int, pii> piii; typedef pair<pii, pii> piiii; int n...
replace
19
23
19
23
0
p03175
C++
Runtime Error
#include <bits/stdc++.h> #define ll long long using namespace std; const int N = 3e5 + 5; const ll M = 1e9 + 7; vector<int> v[N]; ll dp[N][2]; void dfs(int s, int p) { dp[s][0] = dp[s][1] = 1; for (auto i : v[s]) { dfs(i, s); dp[s][0] = (dp[s][0] * dp[i][1]) % M; dp[s][1] = (dp[s][1] * ((dp[i][0] + dp[...
#include <bits/stdc++.h> #define ll long long using namespace std; const int N = 3e5 + 5; const ll M = 1e9 + 7; vector<int> v[N]; ll dp[N][2]; void dfs(int s, int p) { dp[s][0] = dp[s][1] = 1; for (auto i : v[s]) { if (i != p) { dfs(i, s); dp[s][0] = (dp[s][0] * dp[i][1]) % M; dp[s][1] = (dp[s...
replace
10
14
10
15
-11
p03175
C++
Runtime Error
#include <bits/stdc++.h> #define ll long long #define ld long double #define pb push_back #define pii pair<int, int> #define vi vector<int> #define vii vector<pii> #define mi map<int, int> #define mii map<pii, int> #define all(a) (a).begin(), (a).end() #define F first #define S second #define sz(x) (int)x.size() #defi...
#include <bits/stdc++.h> #define ll long long #define ld long double #define pb push_back #define pii pair<int, int> #define vi vector<int> #define vii vector<pii> #define mi map<int, int> #define mii map<pii, int> #define all(a) (a).begin(), (a).end() #define F first #define S second #define sz(x) (int)x.size() #defi...
replace
21
22
21
22
0
p03175
C++
Time Limit Exceeded
#include <bits/stdc++.h> #include <unordered_map> #include <unordered_set> using namespace std; #define REP(i, m, n) for (int i = (m); i < (n); i++) #define rep(i, n) REP(i, 0, n) #define pb push_back #define all(a) a.begin(), a.end() #define rall(c) (c).rbegin(), (c).rend() #define mp make_pair #define double long dou...
#include <bits/stdc++.h> #include <unordered_map> #include <unordered_set> using namespace std; #define REP(i, m, n) for (int i = (m); i < (n); i++) #define rep(i, n) REP(i, 0, n) #define pb push_back #define all(a) a.begin(), a.end() #define rall(c) (c).rbegin(), (c).rend() #define mp make_pair #define double long dou...
insert
33
33
33
34
TLE
p03175
C++
Runtime Error
#include <bits/stdc++.h> #define M_PI 3.14159265358979323846 // pi using namespace std; typedef long long ll; typedef unsigned long long ull; typedef vector<ll> VI; typedef pair<ll, ll> P; typedef tuple<ll, ll, ll> t3; typedef tuple<ll, ll, ll, ll> t4; #define rep(a, n) for (ll a = 0; a < n; a++) #define repi(a, b, ...
#include <bits/stdc++.h> #define M_PI 3.14159265358979323846 // pi using namespace std; typedef long long ll; typedef unsigned long long ull; typedef vector<ll> VI; typedef pair<ll, ll> P; typedef tuple<ll, ll, ll> t3; typedef tuple<ll, ll, ll, ll> t4; #define rep(a, n) for (ll a = 0; a < n; a++) #define repi(a, b, ...
replace
63
64
63
64
0
p03175
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; #define ll long long #define md 1000000007 #define mx 1e18 #define pb push_back #define endl '\n' #define fastio \ ios_base::sync_with_stdio(false); \ cin.tie(NULL...
#include <bits/stdc++.h> using namespace std; #define ll long long #define md 1000000007 #define mx 1e18 #define pb push_back #define endl '\n' #define fastio \ ios_base::sync_with_stdio(false); \ cin.tie(NULL...
replace
33
38
33
38
0
p03175
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; #define _overload3(_1, _2, _3, _4, name, ...) name #define _rep(i, n) repi(i, 0, n) #define repi(i, a, n) for (int i = a; i < n; i++) #define per(i, a, n, s) for (int i = a; s > 0 ? i < n : i > n; i += s) #define rep(...) _overload3(__VA_ARGS__, per, repi, _rep, )(__VA_ARGS...
#include <bits/stdc++.h> using namespace std; #define _overload3(_1, _2, _3, _4, name, ...) name #define _rep(i, n) repi(i, 0, n) #define repi(i, a, n) for (int i = a; i < n; i++) #define per(i, a, n, s) for (int i = a; s > 0 ? i < n : i > n; i += s) #define rep(...) _overload3(__VA_ARGS__, per, repi, _rep, )(__VA_ARGS...
replace
25
29
25
29
0
p03175
C++
Runtime Error
// #pragma GCC optimize "trapv" #include <bits/stdc++.h> #define ll long long int #define fab(a, b, i) for (int i = a; i < b; i++) #define pb push_back #define db double #define mp make_pair #define endl "\n" #define f first #define se second #define all(x) x.begin(), x.end() #define MOD 1000000007 #define quick ...
// #pragma GCC optimize "trapv" #include <bits/stdc++.h> #define ll long long int #define fab(a, b, i) for (int i = a; i < b; i++) #define pb push_back #define db double #define mp make_pair #define endl "\n" #define f first #define se second #define all(x) x.begin(), x.end() #define MOD 1000000007 #define quick ...
replace
39
43
39
40
-11
p03175
C++
Time Limit Exceeded
#include <bits/stdc++.h> using namespace std; typedef long long ll; typedef double lf; typedef pair<ll, ll> ii; #define REP(i, n) for (int i = 0; i < n; i++) #define REP1(i, n) for (ll i = 1; i <= n; i++) #define RST(i, n) memset(i, n, sizeof i) #define SZ(a) (int)a.size() #define ALL(a) a.begin(), a.end() #define X fi...
#include <bits/stdc++.h> using namespace std; typedef long long ll; typedef double lf; typedef pair<ll, ll> ii; #define REP(i, n) for (int i = 0; i < n; i++) #define REP1(i, n) for (ll i = 1; i <= n; i++) #define RST(i, n) memset(i, n, sizeof i) #define SZ(a) (int)a.size() #define ALL(a) a.begin(), a.end() #define X fi...
replace
81
84
81
82
TLE
p03175
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; #include <unordered_map> #define inputarr(a, n) \ for (ll i = 0; i < n; i++) \ cin >> a[i]; #define prllarr(a, n) ...
#include <bits/stdc++.h> using namespace std; #include <unordered_map> #define inputarr(a, n) \ for (ll i = 0; i < n; i++) \ cin >> a[i]; #define prllarr(a, n) ...
replace
93
94
93
94
-11
p03175
C++
Runtime Error
#include <bits/stdc++.h> #include <ext/pb_ds/assoc_container.hpp> using namespace __gnu_pbds; using namespace std; typedef long long int lli; #define ff first #define ss second #define pb push_back #define mp make_pair #define pii pair<lli, lli> #define vi vector<lli> #define mii map<lli, lli> #define pqb priority_queu...
#include <bits/stdc++.h> #include <ext/pb_ds/assoc_container.hpp> using namespace __gnu_pbds; using namespace std; typedef long long int lli; #define ff first #define ss second #define pb push_back #define mp make_pair #define pii pair<lli, lli> #define vi vector<lli> #define mii map<lli, lli> #define pqb priority_queu...
delete
34
38
34
34
0
p03175
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; typedef long long ll; typedef pair<ll, ll> P; const int MOD = 1e9 + 7; int N; vector<int> adj[11000]; ll dp[11000][2]; void dfs(int nd, int prv = -1) { dp[nd][0] = dp[nd][1] = 1; for (int nxt : adj[nd]) { if (nxt == prv) continue; dfs(nxt, nd); dp[nd...
#include <bits/stdc++.h> using namespace std; typedef long long ll; typedef pair<ll, ll> P; const int MOD = 1e9 + 7; int N; vector<int> adj[110000]; ll dp[110000][2]; void dfs(int nd, int prv = -1) { dp[nd][0] = dp[nd][1] = 1; for (int nxt : adj[nd]) { if (nxt == prv) continue; dfs(nxt, nd); dp[...
replace
7
9
7
9
0
p03175
C++
Runtime Error
#include <algorithm> #include <iostream> #include <vector> using namespace std; const long long mod = 1000000000 + 7; vector<int> g[100000]; long long f[100000][2]; int dd[100000], d2[100000][2]; int n; long long qhd(int u, int tt) { dd[u] = 1; long long sum = 1; if (d2[u][tt] == 0) { for (auto i = g[u].begin...
#include <algorithm> #include <iostream> #include <vector> using namespace std; const long long mod = 1000000000 + 7; vector<int> g[100001]; long long f[100001][2]; int dd[100001], d2[100001][2]; int n; long long qhd(int u, int tt) { dd[u] = 1; long long sum = 1; if (d2[u][tt] == 0) { for (auto i = g[u].begin...
replace
5
8
5
8
0
p03175
C++
Runtime Error
#pragma GCC optimize "trapv" #include <bits/stdc++.h> #include <ext/pb_ds/assoc_container.hpp> #include <ext/pb_ds/tree_policy.hpp> #define rep(i, a, n) for (int i = a; i < n; i++) #define rep3(n) for (int i = 0; i < n; i++) #define inarr(arr, n) rep(i, a, n) cin >> arr[i] #define ll long long int #define pb push_back ...
#pragma GCC optimize "trapv" #include <bits/stdc++.h> #include <ext/pb_ds/assoc_container.hpp> #include <ext/pb_ds/tree_policy.hpp> #define rep(i, a, n) for (int i = a; i < n; i++) #define rep3(n) for (int i = 0; i < n; i++) #define inarr(arr, n) rep(i, a, n) cin >> arr[i] #define ll long long int #define pb push_back ...
replace
37
38
37
38
0
p03175
C++
Time Limit Exceeded
#include <fstream> #include <iostream> #include <vector> #define NMAX 100005 #define MOD 1000000007 #define f cin using namespace std; // ifstream f("date.in"); vector<long long int> a[NMAX]; vector<long long int> b[NMAX]; long long int n; long long int dp[NMAX][2]; long long int putere_doi[NMAX]; long long int vis[...
#include <fstream> #include <iostream> #include <vector> #define NMAX 100005 #define MOD 1000000007 #define f cin using namespace std; // ifstream f("date.in"); vector<long long int> a[NMAX]; vector<long long int> b[NMAX]; long long int n; long long int dp[NMAX][2]; long long int putere_doi[NMAX]; long long int vis[...
replace
63
64
63
69
TLE
p03175
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; using ll = long long; const int maxN = 1e5, MOD = 1e9 + 7; vector<vector<int>> eg(maxN); vector<int> q; vector<ll> dpw(maxN), dpb(maxN); bool visited[maxN]; int main() { int n, x, y; cin >> n; for (int i = 0; i < n - 1; i++) { cin >> x >> y; eg[x].push_ba...
#include <bits/stdc++.h> using namespace std; using ll = long long; const int maxN = 1e5 + 5, MOD = 1e9 + 7; vector<vector<int>> eg(maxN); vector<int> q; vector<ll> dpw(maxN), dpb(maxN); bool visited[maxN]; int main() { int n, x, y; cin >> n; for (int i = 0; i < n - 1; i++) { cin >> x >> y; eg[x].pus...
replace
6
7
6
7
0
p03175
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; const int MAX = 1e5 + 10; const long long mod = 1e9 + 7ll; vector<vector<int>> adjlist; long long dp[MAX][2]; int n; long long solve(int parent, int node, int color) { if (adjlist.size() == 1 && parent != -1) return 1ll; long long &ret = dp[node][color]; if (re...
#include <bits/stdc++.h> using namespace std; const int MAX = 1e5 + 10; const long long mod = 1e9 + 7ll; vector<vector<int>> adjlist; long long dp[MAX][2]; int n; long long solve(int parent, int node, int color) { if (adjlist.size() == 1 && parent != -1) return 1ll; long long &ret = dp[node][color]; if (re...
replace
34
35
34
35
-11
p03175
C++
Time Limit Exceeded
#include <bits/stdc++.h> #define MOD 1000000007 #define fi(i, a, b) for (ll i = a; i < b; i++) #define fd(i, a, b) for (ll i = a; i >= b; i--) #define cfi(container, it) \ for (auto it = container.begin(); it != container.end(); it++) #define cfd(container, it) ...
#include <bits/stdc++.h> #define MOD 1000000007 #define fi(i, a, b) for (ll i = a; i < b; i++) #define fd(i, a, b) for (ll i = a; i >= b; i--) #define cfi(container, it) \ for (auto it = container.begin(); it != container.end(); it++) #define cfd(container, it) ...
replace
41
43
41
44
TLE
p03175
C++
Time Limit Exceeded
#include <bits/stdc++.h> // #include <ext/pb_ds/assoc_container.hpp> // #include <ext/pb_ds/tree_policy.hpp> #define ll long long #define ld long double #define mk make_pair #define fi first #define se second #define vll vector<ll> #define pii pair<ll, ll> #define vvll vector<vector<ll>> #define pb push_back #define sz...
#include <bits/stdc++.h> // #include <ext/pb_ds/assoc_container.hpp> // #include <ext/pb_ds/tree_policy.hpp> #define ll long long #define ld long double #define mk make_pair #define fi first #define se second #define vll vector<ll> #define pii pair<ll, ll> #define vvll vector<vector<ll>> #define pb push_back #define sz...
insert
60
60
60
62
TLE
p03175
C++
Runtime Error
#pragma gcc optimize("Ofast") #include <bits/stdc++.h> using namespace std; using ll = long long; const int MOD = 1e9 + 7; int main() { ios_base::sync_with_stdio(0), cin.tie(0), cout.tie(0); int n; cin >> n; vector<vector<int>> G(n + 1); for (int i = 0; i < n - 1; ++i) { int x, y; cin >> x >> y; ...
#pragma gcc optimize("Ofast") #include <bits/stdc++.h> using namespace std; using ll = long long; const int MOD = 1e9 + 7; int main() { ios_base::sync_with_stdio(0), cin.tie(0), cout.tie(0); int n; cin >> n; vector<vector<int>> G(n + 1); for (int i = 0; i < n - 1; ++i) { int x, y; cin >> x >> y; ...
replace
17
18
17
18
0
p03175
C++
Runtime Error
#include <cstdio> #include <cstring> #include <iostream> using namespace std; typedef long long llt; const int MaxN = 100000 + 5, MaxM = 100000 + 5; const llt Mod = 1e9 + 7; int N; int cnte; int Head[MaxN], To[MaxM], Next[MaxM]; int fa[MaxN]; llt dp[MaxN][2]; inline void add_edge(int from, int to) { cnte++; To[...
#include <cstdio> #include <cstring> #include <iostream> using namespace std; typedef long long llt; const int MaxN = 100000 + 5, MaxM = 200000 + 5; const llt Mod = 1e9 + 7; int N; int cnte; int Head[MaxN], To[MaxM], Next[MaxM]; int fa[MaxN]; llt dp[MaxN][2]; inline void add_edge(int from, int to) { cnte++; To[...
replace
7
8
7
8
0
p03175
C++
Time Limit Exceeded
#include <bits/stdc++.h> using namespace std; using ll = long long; using P = pair<ll, ll>; using Graph = vector<vector<ll>>; #define rep(i, n) for (ll i = 0; i < (ll)(n); i++) #define rep2(i, m, n) for (ll i = m; i < (ll)(n); i++) #define rrep(i, n, m) for (ll i = n; i >= (ll)(m); i--) const int dx[4] = {1, 0, -1, 0...
#include <bits/stdc++.h> using namespace std; using ll = long long; using P = pair<ll, ll>; using Graph = vector<vector<ll>>; #define rep(i, n) for (ll i = 0; i < (ll)(n); i++) #define rep2(i, m, n) for (ll i = m; i < (ll)(n); i++) #define rrep(i, n, m) for (ll i = n; i >= (ll)(m); i--) const int dx[4] = {1, 0, -1, 0...
insert
130
130
130
131
TLE
p03175
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; typedef long long ll; int n; int dp[100100][2]; int head[100100], nxt[100100], to[100100]; int edgeCount; int md = 1e9 + 7; void addEdge(int x, int y) { to[edgeCount] = y; nxt[edgeCount] = head[x]; head[x] = edgeCount; ++edgeCount; } int f(int u, int p, bool block...
#include <bits/stdc++.h> using namespace std; typedef long long ll; int n; int dp[100100][2]; int head[200100], nxt[200100], to[200100]; int edgeCount; int md = 1e9 + 7; void addEdge(int x, int y) { to[edgeCount] = y; nxt[edgeCount] = head[x]; head[x] = edgeCount; ++edgeCount; } int f(int u, int p, bool block...
replace
7
8
7
8
0
p03175
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
59
61
59
60
0
p03175
C++
Time Limit Exceeded
#pragma region template 1.1 #pragma region def #include <bits/stdc++.h> using namespace std; typedef long long ll; typedef vector<ll> vi; typedef pair<ll, ll> ii; #define REP(i, n) for (ll i = 0; i < (n); ++i) #define REP1(i, n) for (ll i = 1; i <= (n); ++i) #define OUT(x) cout << (x) << endl; #define OUTA(a) ...
#pragma region template 1.1 #pragma region def #include <bits/stdc++.h> using namespace std; typedef long long ll; typedef vector<ll> vi; typedef pair<ll, ll> ii; #define REP(i, n) for (ll i = 0; i < (n); ++i) #define REP1(i, n) for (ll i = 1; i <= (n); ++i) #define OUT(x) cout << (x) << endl; #define OUTA(a) ...
insert
145
145
145
146
TLE
p03175
C++
Runtime Error
#include <cmath> #include <iomanip> #include <iostream> #include <vector> using namespace std; typedef long long ll; #define INF 1000000000000009LL #define MOD 1000000007LL ll dp[100005][2]; vector<vector<int>> v(10000); ll dfs(int node, int prev_color, int p) { if (dp[node][prev_color] != -1) return dp[node...
#include <cmath> #include <iomanip> #include <iostream> #include <vector> using namespace std; typedef long long ll; #define INF 1000000000000009LL #define MOD 1000000007LL ll dp[100005][2]; vector<vector<int>> v(100000); ll dfs(int node, int prev_color, int p) { if (dp[node][prev_color] != -1) return dp[nod...
replace
13
14
13
14
0
p03175
C++
Time Limit Exceeded
#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 fore(i, a) for (auto &i : a) #define all(x) (x).begin(), (x).end() // #pragma GCC optimize ("-O3") using namespace std; void _main(); int main() { cin.tie(0); ios::sync_with_stdio(fal...
#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 fore(i, a) for (auto &i : a) #define all(x) (x).begin(), (x).end() // #pragma GCC optimize ("-O3") using namespace std; void _main(); int main() { cin.tie(0); ios::sync_with_stdio(fal...
insert
102
102
102
105
TLE
p03175
C++
Runtime Error
#include <bits/stdc++.h> #include <iostream> #define int long long using namespace std; vector<int> tree[100001]; int dp[100001][2]; int solve(int u, int constraint, int pr) { if (dp[u][constraint] != -1) { return dp[u][constraint]; } int ans = 0; int w1 = 1; for (int child : tree[u]) { if (child !=...
#include <bits/stdc++.h> #include <iostream> #define int long long using namespace std; vector<int> tree[100001]; int dp[100001][2]; int solve(int u, int constraint, int pr) { if (dp[u][constraint] != -1) { return dp[u][constraint]; } int ans = 0; int w1 = 1; for (int child : tree[u]) { if (child !=...
insert
36
36
36
37
-11
p03176
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; #define taskname "TEST" #define pb push_back typedef long double ld; typedef long long ll; const int maxn = 1e5 + 5; const int mod = 1e9 + 7; int n; ll dp[maxn], a[maxn], h[maxn]; void update(int x, ll val) { for (; x <= n; x += x & -x) dp[x] = max(dp[x], val); } ll ...
#include <bits/stdc++.h> using namespace std; #define taskname "TEST" #define pb push_back typedef long double ld; typedef long long ll; const int maxn = 2e5 + 5; const int mod = 1e9 + 7; int n; ll dp[maxn], a[maxn], h[maxn]; void update(int x, ll val) { for (; x <= n; x += x & -x) dp[x] = max(dp[x], val); } ll ...
replace
7
8
7
8
0
p03176
C++
Runtime Error
/*input 5 1 2 3 4 5 1000000000 1000000000 1000000000 1000000000 1000000000 */ #include <bits/stdc++.h> using namespace std; #define int long long #define pii pair<int, int> #define pb push_back #define f first #define s second #define IOS \ ios::sync...
/*input 5 1 2 3 4 5 1000000000 1000000000 1000000000 1000000000 1000000000 */ #include <bits/stdc++.h> using namespace std; #define int long long #define pii pair<int, int> #define pb push_back #define f first #define s second #define IOS \ ios::sync...
replace
17
20
17
20
0