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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
p03173 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
long long dp[405][405];
long long pre[405];
int main() {
int N;
cin >> N;
for (int i = 1; i <= N; i++) {
cin >> pre[i];
pre[i] += pre[i - 1];
}
for (int len = 2; len <= N; len++) {
for (int l = 0; l <= N; l++) {
int r = l + len;
dp[l][r]... | #include <bits/stdc++.h>
using namespace std;
long long dp[405][405];
long long pre[405];
int main() {
int N;
cin >> N;
for (int i = 1; i <= N; i++) {
cin >> pre[i];
pre[i] += pre[i - 1];
}
for (int len = 2; len <= N; len++) {
for (int l = 0; l + len <= N; l++) {
int r = l + len;
dp... | replace | 15 | 16 | 15 | 16 | 0 | |
p03173 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
#define FOR(i, a, b) for (int i = (a), _b = (b); i < (_b); ++i)
#define FORD(i, a, b) for (int i = (a), _b = (b); i > (_b); --i)
#define pb push_back
#define mp make_pair
#define all(c) (c).begin(), (c).end()
#define present(c, x) ((c).find(x) != (c).end())
#define cprese... | #include <bits/stdc++.h>
using namespace std;
#define FOR(i, a, b) for (int i = (a), _b = (b); i < (_b); ++i)
#define FORD(i, a, b) for (int i = (a), _b = (b); i > (_b); --i)
#define pb push_back
#define mp make_pair
#define all(c) (c).begin(), (c).end()
#define present(c, x) ((c).find(x) != (c).end())
#define cprese... | insert | 45 | 45 | 45 | 47 | 0 | |
p03173 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)n; i++)
typedef long long ll;
const int MAX = 401;
const ll INF = 1e17;
ll sum[MAX] = {};
vector<vector<ll>> dp(MAX, vector<ll>(MAX, -1));
ll dfs(int i, int j) {
if (dp[i][j] != -1)
return dp[i][j];
if (i == j)
return... | #include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)n; i++)
typedef long long ll;
const int MAX = 401;
const ll INF = 1e17;
ll sum[MAX] = {};
vector<vector<ll>> dp(MAX, vector<ll>(MAX, -1));
ll dfs(int i, int j) {
if (dp[i][j] != -1)
return dp[i][j];
if (i == j)
return... | replace | 19 | 20 | 19 | 20 | TLE | |
p03173 | C++ | Runtime Error | #define _USE_MATH_DEFINES
#include <algorithm>
#include <bitset>
#include <climits>
#include <cmath>
#include <cstdio>
#include <fstream>
#include <functional>
#include <iomanip>
#include <iostream>
#include <list>
#include <map>
#include <queue>
#include <random>
#include <set>
#include <stack>
#include <string>
#incl... | #define _USE_MATH_DEFINES
#include <algorithm>
#include <bitset>
#include <climits>
#include <cmath>
#include <cstdio>
#include <fstream>
#include <functional>
#include <iomanip>
#include <iostream>
#include <list>
#include <map>
#include <queue>
#include <random>
#include <set>
#include <stack>
#include <string>
#incl... | insert | 137 | 137 | 137 | 139 | 0 | |
p03173 | 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 | TLE | |
p03173 | C++ | Runtime Error | /************
* @Just Another Source code by: ankit.sangwan1999
* @created on: 24 Jun 2020
* @Based On : MCM
*/
#include <bits/stdc++.h>
using namespace std;
#define fastio \
ios_base::sync_with_stdio(false); ... | /************
* @Just Another Source code by: ankit.sangwan1999
* @created on: 24 Jun 2020
* @Based On : MCM
*/
#include <bits/stdc++.h>
using namespace std;
#define fastio \
ios_base::sync_with_stdio(false); ... | replace | 70 | 73 | 70 | 73 | 0 | |
p03173 | C++ | Runtime Error | #include <stdio.h>
typedef long long ll;
using namespace std;
int main(void) {
ll i, j, k, n;
scanf("%lld", &n);
ll a[n], dp[n][n], sum[n];
for (i = 0; i < n; ++i) {
scanf("%lld", &a[i]);
if (i)
sum[i] = sum[i - 1] + a[i];
else
sum[i] = a[i];
}
for (i = 0; i < n; ++i)
for (j = 0... | #include <stdio.h>
typedef long long ll;
using namespace std;
int main(void) {
ll i, j, k, n;
scanf("%lld", &n);
ll a[n], dp[n][n], sum[n];
for (i = 0; i < n; ++i) {
scanf("%lld", &a[i]);
if (i)
sum[i] = sum[i - 1] + a[i];
else
sum[i] = a[i];
}
for (i = 0; i < n; ++i)
for (j = 0... | replace | 21 | 22 | 21 | 22 | 0 | |
p03173 | C++ | Time Limit Exceeded | #include <algorithm>
#include <cstdio>
#include <cstring>
using namespace std;
int n;
long long memo[405][405];
long long pre[405];
long long dp(int i, int j) {
if (i == j)
return 0;
else if (memo[i][j] != -1)
return memo[i][j];
long long ans = 1000000000000000000;
for (int x = i; x < j; x++) {
ans ... | #include <algorithm>
#include <cstdio>
#include <cstring>
using namespace std;
int n;
long long memo[405][405];
long long pre[405];
long long dp(int i, int j) {
if (i == j)
return 0;
else if (memo[i][j] != -1)
return memo[i][j];
long long ans = 1000000000000000000;
for (int x = i; x < j; x++) {
ans ... | replace | 16 | 17 | 16 | 17 | TLE | |
p03173 | C++ | Runtime Error | #include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (n); i++)
#define rrep(i, n) for (int i = (n)-1; i >= 0; i--)
#define rep1(i, n) for (int i = 1; i <= (n); i++)
#define rrep1(i, n) for (int i = (n); i > 0; i--)
#define ll long long
#define pi pair<int, int>
#define pll pair<ll, ll>
#define MOD 10000000... | #include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (n); i++)
#define rrep(i, n) for (int i = (n)-1; i >= 0; i--)
#define rep1(i, n) for (int i = 1; i <= (n); i++)
#define rrep1(i, n) for (int i = (n); i > 0; i--)
#define ll long long
#define pi pair<int, int>
#define pll pair<ll, ll>
#define MOD 10000000... | replace | 18 | 20 | 18 | 20 | 0 | |
p03173 | C++ | Runtime Error | #include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (n); i++)
#define rrep(i, n) for (int i = (n)-1; i >= 0; i--)
#define rep1(i, n) for (int i = 1; i <= (n); i++)
#define rrep1(i, n) for (int i = (n); i > 0; i--)
#define ll long long
#define pi pair<int, int>
#define pll pair<ll, ll>
#define MOD 10000000... | #include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (n); i++)
#define rrep(i, n) for (int i = (n)-1; i >= 0; i--)
#define rep1(i, n) for (int i = 1; i <= (n); i++)
#define rrep1(i, n) for (int i = (n); i > 0; i--)
#define ll long long
#define pi pair<int, int>
#define pll pair<ll, ll>
#define MOD 10000000... | replace | 18 | 21 | 18 | 21 | 0 | |
p03173 | C++ | Runtime Error | #include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp> // Common file
#include <ext/pb_ds/detail/standard_policies.hpp>
#include <ext/pb_ds/tree_policy.hpp> // Including tree_order_statistics_node_update
using namespace std;
using namespace __gnu_pbds;
typedef tree<int, null_type, less<int>, rb_tree_tag,
... | #include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp> // Common file
#include <ext/pb_ds/detail/standard_policies.hpp>
#include <ext/pb_ds/tree_policy.hpp> // Including tree_order_statistics_node_update
using namespace std;
using namespace __gnu_pbds;
typedef tree<int, null_type, less<int>, rb_tree_tag,
... | replace | 37 | 38 | 37 | 38 | 0 | |
p03173 | C++ | Runtime Error | #include <bits/stdc++.h>
#define maxn 450
using namespace std;
typedef long long LL;
LL a[maxn];
LL f[maxn][maxn];
int main() {
ios::sync_with_stdio(false);
int N;
cin >> N;
for (int i = 1; i <= N; i += 1)
cin >> a[i];
for (int L = 2; L <= N; L += 1)
for (int i = 1; i <= N; i += 1) {
f[i][L] = 1... | #include <bits/stdc++.h>
#define maxn 450
using namespace std;
typedef long long LL;
LL a[maxn];
LL f[maxn][maxn];
int main() {
ios::sync_with_stdio(false);
int N;
cin >> N;
for (int i = 1; i <= N; i += 1)
cin >> a[i];
for (int L = 2; L <= N; L += 1)
for (int i = 1; i + L <= N + 1; i += 1) {
f[i... | replace | 13 | 14 | 13 | 14 | 0 | |
p03173 | C++ | Runtime Error | #include <bits/stdc++.h>
#define mod 1000000007
#define sp ' '
#define intmax 2147483647
#define llmax 9223372036854775807
#define nyan "(=^・ω・^=)"
#define mkp make_pair
#define lP pair<ll, ll>
#define iP pair<int, int>
typedef long long ll;
using namespace std;
int N, a[400];
ll DP[400][400], s[401];
int main() {
c... | #include <bits/stdc++.h>
#define mod 1000000007
#define sp ' '
#define intmax 2147483647
#define llmax 9223372036854775807
#define nyan "(=^・ω・^=)"
#define mkp make_pair
#define lP pair<ll, ll>
#define iP pair<int, int>
typedef long long ll;
using namespace std;
int N, a[400];
ll DP[400][400], s[401];
int main() {
c... | replace | 23 | 24 | 23 | 24 | 0 | |
p03173 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double ld;
#define REP(i, n) for (int i = 0; i < (n); ++i)
#define REPR(i, n) for (int i = n - 1; i >= 0; --i)
#define FOR(i, m, n) for (ll i = m; i < n; ++i)
#define FORR(i, m, n) for (ll i = m; i >= n; --i)
#define ALL(v) (v).begin(), (v... | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double ld;
#define REP(i, n) for (int i = 0; i < (n); ++i)
#define REPR(i, n) for (int i = n - 1; i >= 0; --i)
#define FOR(i, m, n) for (ll i = m; i < n; ++i)
#define FORR(i, m, n) for (ll i = m; i >= n; --i)
#define ALL(v) (v).begin(), (v... | replace | 39 | 40 | 39 | 40 | -11 | |
p03173 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
#define pb push_back
#define mp make_pair
#define pii pair<ll, ll>
#define NIL -(long long)(1e9)
#define ll long long
#define satir cout << "\n"
#define ALL(v) (v).begin(), (v).end()
#define f first
#define s second
#define sps << " " <<
#define sp << " "
#define spl cout ... | #include <bits/stdc++.h>
using namespace std;
#define pb push_back
#define mp make_pair
#define pii pair<ll, ll>
#define NIL -(long long)(1e9)
#define ll long long
#define satir cout << "\n"
#define ALL(v) (v).begin(), (v).end()
#define f first
#define s second
#define sps << " " <<
#define sp << " "
#define spl cout ... | replace | 70 | 74 | 70 | 73 | 0 | |
p03173 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
#define IOS \
ios::sync_with_stdio(0); \
cin.tie(0); \
cout.tie(0);
#define ll long... | #include <bits/stdc++.h>
using namespace std;
#define IOS \
ios::sync_with_stdio(0); \
cin.tie(0); \
cout.tie(0);
#define ll long... | replace | 56 | 57 | 56 | 57 | 0 | |
p03173 | C++ | Time Limit Exceeded | #include <algorithm>
#include <bitset>
#include <ciso646>
#include <cmath>
#include <complex>
#include <cstdio>
#include <functional>
#include <iomanip>
#include <iostream>
#include <map>
#include <queue>
#include <random>
#include <set>
#include <stack>
#include <string>
#include <unordered_map>
#include <vector>
usin... | #include <algorithm>
#include <bitset>
#include <ciso646>
#include <cmath>
#include <complex>
#include <cstdio>
#include <functional>
#include <iomanip>
#include <iostream>
#include <map>
#include <queue>
#include <random>
#include <set>
#include <stack>
#include <string>
#include <unordered_map>
#include <vector>
usin... | replace | 48 | 49 | 48 | 49 | TLE | |
p03173 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
#define ll long long
#define pii pair<int, int>
#define st first
#define nd second
#define turbo \
ios_base::sync_with_stdio(false); \
cin.tie(0); ... | #include <bits/stdc++.h>
#define ll long long
#define pii pair<int, int>
#define st first
#define nd second
#define turbo \
ios_base::sync_with_stdio(false); \
cin.tie(0); ... | replace | 30 | 33 | 30 | 32 | TLE | |
p03173 | C++ | Time Limit Exceeded | #include <algorithm>
#include <cmath>
#include <cstring>
#include <deque>
#include <iostream>
#include <map>
#include <set>
#include <stack>
#include <string>
#include <vector>
using namespace std;
using ll = long long;
#define rep(i, n) for (ll i = 0; i < n; i++)
template <typename T1, typename T2> inline void chmin(T... | #include <algorithm>
#include <cmath>
#include <cstring>
#include <deque>
#include <iostream>
#include <map>
#include <set>
#include <stack>
#include <string>
#include <vector>
using namespace std;
using ll = long long;
#define rep(i, n) for (ll i = 0; i < n; i++)
template <typename T1, typename T2> inline void chmin(T... | replace | 35 | 36 | 35 | 36 | TLE | |
p03173 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
using namespace std;
#define inf (pow(10, 18))
#define ll long long int
#define mod 1000000007
#define ntq(z) \
long long int z; \
cin >> z; ... | #include <bits/stdc++.h>
using namespace std;
#define inf (pow(10, 18))
#define ll long long int
#define mod 1000000007
#define ntq(z) \
long long int z; \
cin >> z; ... | insert | 218 | 218 | 218 | 219 | TLE | |
p03173 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
// #define int ll
using PII = pair<ll, ll>;
#define FOR(i, a, n) for (ll i = (ll)a; i < (ll)n; ++i)
#define REP(i, n) FOR(i, 0, n)
#define ALL(x) x.begin(), x.end()
template <typename T> T &chmin(T &a, const T &b) { return a = min(a, b); }
template ... | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
// #define int ll
using PII = pair<ll, ll>;
#define FOR(i, a, n) for (ll i = (ll)a; i < (ll)n; ++i)
#define REP(i, n) FOR(i, 0, n)
#define ALL(x) x.begin(), x.end()
template <typename T> T &chmin(T &a, const T &b) { return a = min(a, b); }
template ... | insert | 73 | 73 | 73 | 75 | 0 | |
p03173 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
#define ll long long int
#define lld long double
#define pb push_back
#define pii pair<ll, ll>
#define mi map<ll, ll>
#define vec vector<ll>
#define all(a) (a).begin(), (a).end()
#define F first
#define S second
#define mod 1000000007
#define rep(i, a, b) for (ll i = a; i < b; i++)
#define repi... | #include <bits/stdc++.h>
#define ll long long int
#define lld long double
#define pb push_back
#define pii pair<ll, ll>
#define mi map<ll, ll>
#define vec vector<ll>
#define all(a) (a).begin(), (a).end()
#define F first
#define S second
#define mod 1000000007
#define rep(i, a, b) for (ll i = a; i < b; i++)
#define repi... | replace | 88 | 89 | 88 | 89 | TLE | |
p03173 | C++ | Runtime Error | #include <bits/stdc++.h>
typedef long long ll;
using namespace std;
typedef pair<int, int> pii;
#define endl '\n'
#define F first
#define S second
const int MAX_N = 4e2 + 4;
int n;
int a[MAX_N];
ll dp[MAX_N][MAX_N], na[MAX_N][MAX_N];
int main() {
memset(dp, 0x7F, sizeof(dp));
scanf("%d", &n);
for (int i = 1; i ... | #include <bits/stdc++.h>
typedef long long ll;
using namespace std;
typedef pair<int, int> pii;
#define endl '\n'
#define F first
#define S second
const int MAX_N = 4e2 + 4;
int n;
int a[MAX_N];
ll dp[MAX_N][MAX_N], na[MAX_N][MAX_N];
int main() {
memset(dp, 0x7F, sizeof(dp));
scanf("%d", &n);
for (int i = 1; i ... | replace | 19 | 20 | 19 | 20 | 0 | |
p03173 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
const int N = 400;
int n, a[N];
long long sum[N], mem[N][N];
bool vis[N][N];
long long dp(int i, int j) {
if (i == j) {
return 0;
}
if (vis[i][j]) {
return mem[i][j];
}
vis[i][j] = true;
long long ans = LLONG_MAX;
for (int m = i; m < j; m++) {
an... | #include <bits/stdc++.h>
using namespace std;
const int N = 405;
int n, a[N];
long long sum[N], mem[N][N];
bool vis[N][N];
long long dp(int i, int j) {
if (i == j) {
return 0;
}
if (vis[i][j]) {
return mem[i][j];
}
vis[i][j] = true;
long long ans = LLONG_MAX;
for (int m = i; m < j; m++) {
an... | replace | 2 | 3 | 2 | 3 | 0 | |
p03173 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
#define int long long
int dp[500][500], sum[500][500];
int32_t main() {
ios::sync_with_stdio(false);
cin.tie(0);
int n, x;
cin >> n;
for (int i = 0; i < n; i++) {
cin >> x;
for (int j = 0; j <= i; j++)
sum[j][i] = x;
}
for (int i = 0; i < n; i++)... | #include <bits/stdc++.h>
using namespace std;
#define int long long
int dp[500][500], sum[500][500];
int32_t main() {
ios::sync_with_stdio(false);
cin.tie(0);
int n, x;
cin >> n;
for (int i = 0; i < n; i++) {
cin >> x;
for (int j = 0; j <= i; j++)
sum[j][i] = x;
}
for (int i = 0; i < n; i++)... | replace | 22 | 23 | 22 | 23 | 0 | |
p03173 | C++ | Runtime Error | #include <bits/stdc++.h>
#define mp make_pair
#define fi first
#define se second
#define VAL 100000
#define ll long long
#define INF 10000000000000000LL
#define pll pair<long long, long long>
const int MAX = 1e5 + 10;
const int MOD = 1e9 + 7;
const int TOT_PRIMES = 19;
const int MAX_A = 70;
using namespace std;
vector<... | #include <bits/stdc++.h>
#define mp make_pair
#define fi first
#define se second
#define VAL 100000
#define ll long long
#define INF 10000000000000000LL
#define pll pair<long long, long long>
const int MAX = 1e5 + 10;
const int MOD = 1e9 + 7;
const int TOT_PRIMES = 19;
const int MAX_A = 70;
using namespace std;
vector<... | replace | 15 | 16 | 15 | 16 | 0 | |
p03173 | C++ | Runtime Error | // Exp val.
// https://atcoder.jp/contests/dp/tasks/dp_j
// https://codeforces.com/blog/entry/64250?#comment-523543
#include <bits/stdc++.h> //Carefully Crafted by hetp111
using namespace std;
#define int long long
#define double long double
#define all(v) (v).begin(), (v).end()
#define vi vector<int>
#define vvi vecto... | // Exp val.
// https://atcoder.jp/contests/dp/tasks/dp_j
// https://codeforces.com/blog/entry/64250?#comment-523543
#include <bits/stdc++.h> //Carefully Crafted by hetp111
using namespace std;
#define int long long
#define double long double
#define all(v) (v).begin(), (v).end()
#define vi vector<int>
#define vvi vecto... | replace | 40 | 42 | 40 | 42 | 0 | |
p03173 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
#define int long long
signed main() {
ios_base::sync_with_stdio(false);
int n;
cin >> n;
int dp[n + 1][n + 1];
int arr[n + 1];
int prefix[n + 1];
arr[0] = 0;
for (int i = 1; i <= n; i++) {
cin >> arr[i];
dp[i][i] = 0;
dp[i - 1][i] = arr[i - 1] +... | #include <bits/stdc++.h>
using namespace std;
#define int long long
signed main() {
ios_base::sync_with_stdio(false);
int n;
cin >> n;
int dp[n + 1][n + 1];
int arr[n + 1];
int prefix[n + 1];
arr[0] = 0;
for (int i = 1; i <= n; i++) {
cin >> arr[i];
dp[i][i] = 0;
dp[i - 1][i] = arr[i - 1] +... | replace | 21 | 22 | 21 | 22 | 0 | |
p03173 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
using namespace std;
#define int long long
const int MOD = 10000000000007LL;
int dp[410][410] = {};
int a[410];
//[l, r)
int solve(int l, int r) {
if (!dp[l][r] == MOD)
return dp[l][r];
if (r - l == 1) {
dp[l][r] = 0;
return dp[l][r];
}
int rec = MOD;
int sum = 0;
f... | #include <bits/stdc++.h>
using namespace std;
#define int long long
const int MOD = 10000000000007LL;
int dp[410][410] = {};
int a[410];
//[l, r)
int solve(int l, int r) {
// cout << l << " " << r << endl;
if (!(dp[l][r] == MOD))
return dp[l][r];
if (r - l == 1) {
dp[l][r] = 0;
return dp[l][r];
... | replace | 12 | 13 | 12 | 14 | TLE | |
p03173 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
using namespace std;
template <class T> using V = vector<T>;
template <class T> using VV = V<V<T>>;
template <class T> using VVV = V<VV<T>>;
template <class S, class T> using P = pair<S, T>;
template <class... T> using TP = tuple<T...>;
using ll = long long;
using ull = unsigned long long;
us... | #include <bits/stdc++.h>
using namespace std;
template <class T> using V = vector<T>;
template <class T> using VV = V<V<T>>;
template <class T> using VVV = V<VV<T>>;
template <class S, class T> using P = pair<S, T>;
template <class... T> using TP = tuple<T...>;
using ll = long long;
using ull = unsigned long long;
us... | insert | 1,397 | 1,397 | 1,397 | 1,399 | TLE | |
p03173 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
using namespace std;
int n, a[401];
long long b[401], dp[401][401], mod = 1e9 + 7;
long long func(int l, int r) {
if (l == r)
return dp[l][r] = 0;
if (l + 1 == r)
return dp[l][r] = a[l];
long long res = 1e18;
for (int i = l + 1; i < r; ++i)
res = min(res, func(l, i) + func... | #include <bits/stdc++.h>
using namespace std;
int n, a[401];
long long b[401], dp[401][401], mod = 1e9 + 7;
long long func(int l, int r) {
if (l == r)
return dp[l][r] = 0;
if (l + 1 == r)
return dp[l][r] = a[l];
if (dp[l][r] != 0)
return dp[l][r];
long long res = 1e18;
for (int i = l + 1; i < r;... | insert | 11 | 11 | 11 | 13 | TLE | |
p03173 | C++ | Runtime Error | #include "bits/stdc++.h"
#define all(x) (x).begin(), (x).end()
using namespace std;
const int MSIZE = 404;
long long dp[MSIZE][MSIZE];
long long arr[MSIZE];
long long pref[MSIZE];
long long Sum(int l, int r) {
l = max(l, 0);
return pref[r] - (l ? pref[l - 1] : 0LL);
}
int main() {
ios_base::sync_with_stdio(... | #include "bits/stdc++.h"
#define all(x) (x).begin(), (x).end()
using namespace std;
const int MSIZE = 404;
long long dp[MSIZE][MSIZE];
long long arr[MSIZE];
long long pref[MSIZE];
long long Sum(int l, int r) {
l = max(l, 0);
return pref[r] - (l ? pref[l - 1] : 0LL);
}
int main() {
ios_base::sync_with_stdio(... | replace | 32 | 33 | 32 | 33 | 0 | |
p03173 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
#define ll long long
const ll inf = 1e16;
int n, a[410];
ll f[410][410], s[410];
int main() {
scanf("%d", &n);
for (int i = 0; i <= n; i++) {
for (int j = 0; j <= n; j++) {
f[i][j] = inf;
}
}
for (int i = 1; i <= n; i++) {
scanf("%d", &a[i]);
s... | #include <bits/stdc++.h>
using namespace std;
#define ll long long
const ll inf = 1e16;
int n, a[410];
ll f[410][410], s[410];
int main() {
scanf("%d", &n);
for (int i = 0; i <= n; i++) {
for (int j = 0; j <= n; j++) {
f[i][j] = inf;
}
}
for (int i = 1; i <= n; i++) {
scanf("%d", &a[i]);
s... | replace | 19 | 20 | 19 | 20 | 0 | |
p03173 | C++ | Runtime Error | #include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (n); i++)
using ll = long long int;
using namespace std;
template <class T> inline bool chmax(T &a, T b) {
if (a < b) {
a = b;
return 1;
}
return 0;
}
template <class T> inline bool chmin(T &a, T b) {
if (a > b) {
a = b;
return 1;
... | #include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (n); i++)
using ll = long long int;
using namespace std;
template <class T> inline bool chmax(T &a, T b) {
if (a < b) {
a = b;
return 1;
}
return 0;
}
template <class T> inline bool chmin(T &a, T b) {
if (a > b) {
a = b;
return 1;
... | replace | 29 | 30 | 29 | 30 | 0 | |
p03173 | C++ | Runtime Error | #include <cstring>
#include <iostream>
#include <vector>
#define INF (1LL << 60)
using namespace std;
long long int dp[3001][3001];
long long int sum[3001][3001];
long long int slimes(vector<int> &v, int i, int j) {
if (i == j)
return 0;
if (dp[i][j] != -1)
return dp[i][j]; // Look-Up
long long int minC... | #include <cstring>
#include <iostream>
#include <vector>
#define INF (1LL << 60)
using namespace std;
long long int dp[3001][3001];
long long int sum[3001][3001];
long long int slimes(vector<int> &v, int i, int j) {
if (i == j)
return 0;
if (dp[i][j] != -1)
return dp[i][j]; // Look-Up
long long int minC... | replace | 17 | 18 | 17 | 18 | -11 | |
p03173 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
using namespace std;
#define repr(i, a, b) for (int i = a; i < b; i++)
#define rep(i, n) for (int i = 0; i < n; i++)
#define reprrev(i, a, b) for (int i = b - 1; i >= a; i--)
#define reprev(i, n) reprrev(i, 0, n)
typedef long long ll;
typedef unsigned long long ull;
template <class T> inline bo... | #include <bits/stdc++.h>
using namespace std;
#define repr(i, a, b) for (int i = a; i < b; i++)
#define rep(i, n) for (int i = 0; i < n; i++)
#define reprrev(i, a, b) for (int i = b - 1; i >= a; i--)
#define reprev(i, n) reprrev(i, 0, n)
typedef long long ll;
typedef unsigned long long ull;
template <class T> inline bo... | replace | 84 | 85 | 84 | 85 | TLE | |
p03173 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
const int MXN = 4e0 + 20;
long long n, a[MXN], ps[MXN], dp[MXN][MXN];
void npt() {
cin >> n;
for (int i = 1; i <= n; i++) {
cin >> a[i];
ps[i] = ps[i - 1] + a[i];
}
for (int i = 0; i < MXN; i++)
for (int j = 0; j < MXN; j++)
dp[i][j] = 1e15 + 20... | #include <bits/stdc++.h>
using namespace std;
const int MXN = 4e2 + 20;
long long n, a[MXN], ps[MXN], dp[MXN][MXN];
void npt() {
cin >> n;
for (int i = 1; i <= n; i++) {
cin >> a[i];
ps[i] = ps[i - 1] + a[i];
}
for (int i = 0; i < MXN; i++)
for (int j = 0; j < MXN; j++)
dp[i][j] = 1e15 + 20... | replace | 3 | 4 | 3 | 4 | 0 | |
p03173 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int, int> pii;
ll dp[405][405];
int l[405];
int n;
ll solve(int lhs, int rhs) {
if (lhs == rhs)
return 0;
ll total = 0;
for (int i = lhs; i <= rhs; i++) {
total += l[i];
}
dp[lhs][rhs] = 1e18;
for (int i = lhs; i < ... | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int, int> pii;
ll dp[405][405];
int l[405];
int n;
ll solve(int lhs, int rhs) {
if (lhs == rhs)
return 0;
if (dp[lhs][rhs])
return dp[lhs][rhs];
ll total = 0;
for (int i = lhs; i <= rhs; i++) {
total += l[i];
}
... | insert | 14 | 14 | 14 | 16 | TLE | |
p03173 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const int mxN = 1e9;
const ll mod = 1e9 + 7;
ll pow(ll a, ll b) {
ll r = 1;
while (b) {
if (b % 2 != 0)
r = (r * a) % mod;
a = (a * a) % mod;
b /= 2;
}
return r;
}
int main() {
ios_base::sync_with_stdio(false);
cin.tie(... | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const int mxN = 1e9;
const ll mod = 1e9 + 7;
ll pow(ll a, ll b) {
ll r = 1;
while (b) {
if (b % 2 != 0)
r = (r * a) % mod;
a = (a * a) % mod;
b /= 2;
}
return r;
}
int main() {
ios_base::sync_with_stdio(false);
cin.tie(... | replace | 45 | 46 | 45 | 46 | 0 | |
p03173 | C++ | Runtime Error | #include <algorithm>
#include <iostream>
using namespace std;
typedef long long ll;
const ll INF = 1145141919810893;
int N;
ll dp[400][400];
ll cost[400];
ll ruisekiwa[401]; // idx i ~ idx j (i < j)は [i, j)
int main() {
cin >> N;
for (int i = 0; i < N; i++) {
cin >> cost[i];
ruisekiwa[i + 1] = cost[i] +... | #include <algorithm>
#include <iostream>
using namespace std;
typedef long long ll;
const ll INF = 1145141919810893;
int N;
ll dp[400][400];
ll cost[400];
ll ruisekiwa[401]; // idx i ~ idx j (i < j)は [i, j)
int main() {
cin >> N;
for (int i = 0; i < N; i++) {
cin >> cost[i];
ruisekiwa[i + 1] = cost[i] +... | replace | 32 | 33 | 32 | 33 | 0 | |
p03173 | C++ | Runtime Error | #include <iostream>
#define nmax 405
using namespace std;
int n, a[nmax];
long long s[nmax][nmax];
long long dp[nmax][nmax];
int main() {
int i, j, k, l;
cin >> n;
for (i = 1; i <= n; i++)
cin >> a[i];
for (i = 1; i <= n; i++)
for (j = i; j <= n; j++)
s[i][j] = s[i][j - 1] + a[j];
for (i = 1; ... | #include <iostream>
#define nmax 405
using namespace std;
int n, a[nmax];
long long s[nmax][nmax];
long long dp[nmax][nmax];
int main() {
int i, j, k, l;
cin >> n;
for (i = 1; i <= n; i++)
cin >> a[i];
for (i = 1; i <= n; i++)
for (j = i; j <= n; j++)
s[i][j] = s[i][j - 1] + a[j];
for (i = 1; ... | replace | 24 | 25 | 24 | 25 | 0 | |
p03173 | C++ | Runtime Error | #define _CRT_SECURE_NO_WARNINGS
#include <algorithm>
#include <array>
#include <bitset>
#include <cassert>
#include <climits>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <functional>
#include <iostream>
#include <map>
#include <numeric>
#include <queue>
#include <random>
#include <... | #define _CRT_SECURE_NO_WARNINGS
#include <algorithm>
#include <array>
#include <bitset>
#include <cassert>
#include <climits>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <functional>
#include <iostream>
#include <map>
#include <numeric>
#include <queue>
#include <random>
#include <... | replace | 44 | 45 | 44 | 45 | 0 | |
p03173 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
#define F first
#define S second
#define ll long long int
#define P pair<ll, ll>
#define vii vector<P>
#define vvi vector<vector<ll>>
#define P_B push_back
#define MOD 1000000007
#define pi 3.141592653589793238
int main() {
ios_base::sync_with_stdio(false);
cin.tie(N... | #include <bits/stdc++.h>
using namespace std;
#define F first
#define S second
#define ll long long int
#define P pair<ll, ll>
#define vii vector<P>
#define vvi vector<vector<ll>>
#define P_B push_back
#define MOD 1000000007
#define pi 3.141592653589793238
int main() {
ios_base::sync_with_stdio(false);
cin.tie(N... | replace | 45 | 46 | 45 | 46 | 0 | |
p03173 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
#define int long long
const int maxn = 401;
int dp[maxn][maxn];
int pref[maxn];
signed main() {
int n;
cin >> n;
vector<int> a(n + 1);
for (int i = 1; i <= n; i++)
cin >> a[i];
pref[0] = 0;
for (int i = 1; i <= n; i++)
pref[i] = pref[i - 1] + a[i];
for... | #include <bits/stdc++.h>
using namespace std;
#define int long long
const int maxn = 401;
int dp[maxn][maxn];
int pref[maxn];
signed main() {
int n;
cin >> n;
vector<int> a(n + 1);
for (int i = 1; i <= n; i++)
cin >> a[i];
pref[0] = 0;
for (int i = 1; i <= n; i++)
pref[i] = pref[i - 1] + a[i];
for... | insert | 23 | 23 | 23 | 25 | 0 | |
p03173 | C++ | Time Limit Exceeded | #include <algorithm>
#include <iomanip>
#include <iostream>
#include <string.h>
#include <vector>
using namespace std;
#define mod (long)(1e9 + 7)
#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_clz... | #include <algorithm>
#include <iomanip>
#include <iostream>
#include <string.h>
#include <vector>
using namespace std;
#define mod (long)(1e9 + 7)
#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_clz... | insert | 121 | 121 | 121 | 123 | TLE | |
p03173 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
#define int long long
const int MAXN = 4e2 + 5;
const int INF = 1e16 + 7;
int dp[MAXN][MAXN];
int sum[MAXN];
int arr[MAXN];
int32_t main() {
int n;
cin >> n;
for (int i = 1; i <= n; i++) {
cin >> arr[i];
sum[i] = sum[i - 1] + arr[i];
}
for (int l = 2; l <=... | #include <bits/stdc++.h>
using namespace std;
#define int long long
const int MAXN = 4e2 + 5;
const int INF = 1e16 + 7;
int dp[MAXN][MAXN];
int sum[MAXN];
int arr[MAXN];
int32_t main() {
int n;
cin >> n;
for (int i = 1; i <= n; i++) {
cin >> arr[i];
sum[i] = sum[i - 1] + arr[i];
}
for (int l = 2; l <=... | insert | 18 | 18 | 18 | 20 | 0 | |
p03173 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
long long f[102][102];
long long a[102];
long long sum[102];
int main() {
int n, i, j, k;
scanf("%d", &n);
for (i = 1; i <= n; i++) {
scanf("%lld", &a[i]);
sum[i] = sum[i - 1] + a[i];
}
for (j = 1; j <= n - 1; j++) {
for (i = 1; i + j <= n; i++) {
... | #include <bits/stdc++.h>
using namespace std;
long long f[402][402];
long long a[402];
long long sum[402];
int main() {
int n, i, j, k;
scanf("%d", &n);
for (i = 1; i <= n; i++) {
scanf("%lld", &a[i]);
sum[i] = sum[i - 1] + a[i];
}
for (j = 1; j <= n - 1; j++) {
for (i = 1; i + j <= n; i++) {
... | replace | 2 | 5 | 2 | 5 | 0 | |
p03173 | C++ | Runtime Error | #include <bits/stdc++.h>
#include <ext/hash_map>
#include <ext/numeric>
using namespace std;
using namespace __gnu_cxx;
#define REP(i, n) for ((i) = 0; (i) < (n); (i)++)
#define rep(i, x, n) for ((i) = (x); (i) < (n); (i)++)
#define REV(i, n) for ((i) = (n); (i) >= 0; (i)--)
#define FORIT(it, x) for ((it) = (x).begin... | #include <bits/stdc++.h>
#include <ext/hash_map>
#include <ext/numeric>
using namespace std;
using namespace __gnu_cxx;
#define REP(i, n) for ((i) = 0; (i) < (n); (i)++)
#define rep(i, x, n) for ((i) = (x); (i) < (n); (i)++)
#define REV(i, n) for ((i) = (n); (i) >= 0; (i)--)
#define FORIT(it, x) for ((it) = (x).begin... | replace | 73 | 74 | 73 | 74 | 0 | |
p03173 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
ll inf = (ll)1 << 60;
ll n;
vector<ll> v;
vector<vector<ll>> memo;
vector<vector<ll>> size;
// Find the cheapest cost to combine the range [lo,hi]
ll solve(ll lo, ll hi) {
if (memo[lo][hi] != inf)
return memo[lo][hi];
if (lo == hi) {
m... | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
ll inf = (ll)1 << 60;
ll n;
vector<ll> v;
vector<vector<ll>> memo;
vector<vector<ll>> size;
// Find the cheapest cost to combine the range [lo,hi]
ll solve(ll lo, ll hi) {
if (memo[lo][hi] != inf)
return memo[lo][hi];
if (lo == hi) {
m... | insert | 34 | 34 | 34 | 37 | TLE | |
p03173 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
/* typedef */
typedef long long ll;
typedef pair<int, int> pii;
/* constant */
const int MAX = 305;
const int NIL = -1;
const ll LINF = 1LL << 50;
const int mod = 1e+9 + 7;
/* global variables */
/* funciton */
/* main */
int main() {
int N;
cin >> N;
vector<ll> a(N);... | #include <bits/stdc++.h>
using namespace std;
/* typedef */
typedef long long ll;
typedef pair<int, int> pii;
/* constant */
const int MAX = 305;
const int NIL = -1;
const ll LINF = 1LL << 50;
const int mod = 1e+9 + 7;
/* global variables */
/* funciton */
/* main */
int main() {
int N;
cin >> N;
vector<ll> a(N);... | replace | 27 | 28 | 27 | 28 | -6 | Fatal glibc error: malloc assertion failure in sysmalloc: (old_top == initial_top (av) && old_size == 0) || ((unsigned long) (old_size) >= MINSIZE && prev_inuse (old_top) && ((unsigned long) old_end & (pagesize - 1)) == 0)
|
p03173 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
using namespace std;
#define ffor(n) for (int i = 0; i < n; i++)
#define fffor(n) for (int j = 0; j < n; j++)
int INF = 1e9 + 7;
long long INF2 = 1e16;
long long f(int l, int r, vector<long long> &v, vector<vector<long long>> &dp,
vector<vector<long long>> &range_sum) {
if (l == ... | #include <bits/stdc++.h>
using namespace std;
#define ffor(n) for (int i = 0; i < n; i++)
#define fffor(n) for (int j = 0; j < n; j++)
int INF = 1e9 + 7;
long long INF2 = 1e16;
long long f(int l, int r, vector<long long> &v, vector<vector<long long>> &dp,
vector<vector<long long>> &range_sum) {
if (dp[l]... | insert | 9 | 9 | 9 | 11 | TLE | |
p03173 | C++ | Runtime Error | #include <bits/stdc++.h>
#define pb push_back
#define ll long long
#define si short int
#define speed ios_base::sync_with_stdio(0), cin.tie(0), cout.tie(0)
#define pill pair<ll, ll>
#define f first
#define s second
using namespace std;
const ll N = 181;
const ll big = 1e18;
const ll block = 100;
const ll mod = 1e6;
... | #include <bits/stdc++.h>
#define pb push_back
#define ll long long
#define si short int
#define speed ios_base::sync_with_stdio(0), cin.tie(0), cout.tie(0)
#define pill pair<ll, ll>
#define f first
#define s second
using namespace std;
const ll N = 481;
const ll big = 1e18;
const ll block = 100;
const ll mod = 1e6;
... | replace | 11 | 12 | 11 | 12 | 0 | |
p03173 | C++ | Runtime Error | #include <bits/stdc++.h>
#define rep(i, n) for (lli i = 0; i < (n); i++)
#define rrep(i, n) for (lli i = (n)-1; i >= 0; i--)
using namespace std;
using lli = long long int;
#define int long long int
void YESNO(bool), YesNo(bool);
template <class T1, class T2> bool chmin(T1 &l, const T2 &r);
template <class T1, class T2... | #include <bits/stdc++.h>
#define rep(i, n) for (lli i = 0; i < (n); i++)
#define rrep(i, n) for (lli i = (n)-1; i >= 0; i--)
using namespace std;
using lli = long long int;
#define int long long int
void YESNO(bool), YesNo(bool);
template <class T1, class T2> bool chmin(T1 &l, const T2 &r);
template <class T1, class T2... | replace | 22 | 23 | 22 | 23 | 0 | |
p03173 | 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;
#define pb push_back
#define mp make_pair
#define x first
#define y second
typedef long long int ll;
// typedef tree< ll, null_type, less_equal< ll >, rb_tree_... | #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 pb push_back
#define mp make_pair
#define x first
#define y second
typedef long long int ll;
// typedef tree< ll, null_type, less_equal< ll >, rb_tree_... | replace | 53 | 57 | 53 | 54 | -11 | |
p03173 | C++ | Runtime Error | /*
Author: Racer5x
*************************************** UNAUTHORISED COPYING OF CODE
PROHIBITED **********************************
*/
/*#pragma GCC optimize("O3")
#pragma GCC optimize("Ofast")
#pragma GCC optimize("unroll-loops")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")*/
... | /*
Author: Racer5x
*************************************** UNAUTHORISED COPYING OF CODE
PROHIBITED **********************************
*/
/*#pragma GCC optimize("O3")
#pragma GCC optimize("Ofast")
#pragma GCC optimize("unroll-loops")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")*/
... | replace | 55 | 61 | 55 | 56 | -6 | terminate called after throwing an instance of 'std::bad_alloc'
what(): std::bad_alloc
|
p03173 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
using namespace std;
const long long int maxx = 1e15L;
const int sz = 444;
long long dp[sz][sz], sum[sz][sz];
vector<long long> v;
long long f(int a, int b) {
if (a == b) {
return 0;
}
long long ans = maxx;
for (int i = a; i < b; ++i) {
ans = min(ans, f(a, i) + f(i + 1, b) + ... | #include <bits/stdc++.h>
using namespace std;
const long long int maxx = 1e15L;
const int sz = 444;
long long dp[sz][sz], sum[sz][sz];
vector<long long> v;
long long f(int a, int b) {
if (a == b) {
return 0;
}
if (dp[a][b] != maxx) {
return dp[a][b];
}
long long ans = maxx;
for (int i = a; i < b;... | insert | 12 | 12 | 12 | 15 | TLE | |
p03173 | C++ | Runtime Error | #include <bits/stdc++.h>
#define ll long long int
#define uu first
#define vv second
#define pii pair<int, int>
#define pll pair<ll, ll>
#define INF 1e18
#define fastRead \
ios_base::sync_with_stdio(0); \
ci... | #include <bits/stdc++.h>
#define ll long long int
#define uu first
#define vv second
#define pii pair<int, int>
#define pll pair<ll, ll>
#define INF 1e18
#define fastRead \
ios_base::sync_with_stdio(0); \
ci... | replace | 15 | 16 | 15 | 16 | 0 | |
p03173 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
using namespace std;
#define ff first
#define ss second
typedef long long ll;
typedef long double ld;
typedef pair<int, int> pi;
const int MOD = 1e9 + 7;
const ll INF = 1e18;
const double EPS = 1e-6;
const int MAX_N = 405;
int N;
ll a[MAX_N];
ll memo[MAX_N][MAX_N];
ll dp(int l, int r) {
... | #include <bits/stdc++.h>
using namespace std;
#define ff first
#define ss second
typedef long long ll;
typedef long double ld;
typedef pair<int, int> pi;
const int MOD = 1e9 + 7;
const ll INF = 1e18;
const double EPS = 1e-6;
const int MAX_N = 405;
int N;
ll a[MAX_N];
ll memo[MAX_N][MAX_N];
ll dp(int l, int r) {
... | replace | 33 | 34 | 33 | 34 | TLE | |
p03173 | C++ | Time Limit Exceeded | //----------------------------templates
#pragma GCC optimize("Ofast")
#pragma GCC target("tune=native")
#pragma GCC target("avx")
//----------------------------
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
#define int ll
#define FOR(i, j, n) for (int i = (int)(j)... | //----------------------------templates
#pragma GCC optimize("Ofast")
#pragma GCC target("tune=native")
#pragma GCC target("avx")
//----------------------------
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
#define int ll
#define FOR(i, j, n) for (int i = (int)(j)... | insert | 51 | 51 | 51 | 53 | TLE | |
p03173 | C++ | Runtime Error | #include <bits/stdc++.h>
#define REP(i, a, b) for (long long i = a; i <= b; ++i)
#define REPN(i, a, b) for (long long i = a; i <= b; --i)
#define rep(i, a, b) for (long long i = a; i < b; ++i)
#define rep0(i, b) for (long long i = 0; i < b; ++i)
#define REP0(i, b) for (long long i = 0; i <= b; ++i)
#include <cmath>
#in... | #include <bits/stdc++.h>
#define REP(i, a, b) for (long long i = a; i <= b; ++i)
#define REPN(i, a, b) for (long long i = a; i <= b; --i)
#define rep(i, a, b) for (long long i = a; i < b; ++i)
#define rep0(i, b) for (long long i = 0; i < b; ++i)
#define REP0(i, b) for (long long i = 0; i <= b; ++i)
#include <cmath>
#in... | replace | 29 | 30 | 29 | 30 | -11 | |
p03173 | C++ | Runtime Error | #include <bits/stdc++.h>
const int M = 998244353;
#define int long long int
using namespace std;
#define fast \
ios_base::sync_with_stdio(0); \
cin.tie(0); ... | #include <bits/stdc++.h>
const int M = 998244353;
#define int long long int
using namespace std;
#define fast \
ios_base::sync_with_stdio(0); \
cin.tie(0); ... | replace | 14 | 16 | 14 | 16 | 0 | |
p03173 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (n); ++i)
using namespace std;
const int64_t INF = 1e18;
int main() {
int N;
cin >> N;
vector<int> A(N);
for (auto &e : A)
cin >> e;
using P = pair<int64_t, int64_t>;
map<int, map<int, P>> dp;
auto f = [&](auto &&f, int l, int r) -> P {
... | #include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (n); ++i)
using namespace std;
const int64_t INF = 1e18;
int main() {
int N;
cin >> N;
vector<int> A(N);
for (auto &e : A)
cin >> e;
using P = pair<int64_t, int64_t>;
vector<vector<P>> dp(N + 1, vector<P>(N + 1));
auto f = [&](auto &&f, i... | replace | 12 | 13 | 12 | 13 | TLE | |
p03173 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
typedef long long LL;
typedef pair<int, int> PII;
typedef vector<int> VI;
#define MP make_pair
#define PB push_back
#define X first
#define Y second
#define FOR(i, a, b) for (int i = (a); i < (b); ++i)
#define RFOR(i, b, a) for (int i = (b)-1; i >= (a); --i)
#define ITER(... | #include <bits/stdc++.h>
using namespace std;
typedef long long LL;
typedef pair<int, int> PII;
typedef vector<int> VI;
#define MP make_pair
#define PB push_back
#define X first
#define Y second
#define FOR(i, a, b) for (int i = (a); i < (b); ++i)
#define RFOR(i, b, a) for (int i = (b)-1; i >= (a); --i)
#define ITER(... | insert | 61 | 61 | 61 | 64 | 0 | Time elapsed: 0.034309
|
p03173 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
using namespace std;
using int64 = long long;
template <typename T>
vector<vector<T>> Make2DVector(int d1, int d2, T default_value) {
return vector<vector<T>>(d1, vector<T>(d2, default_value));
}
int main() {
ios::sync_with_stdio(false);
cin.tie(0);
int n;
cin >> n;
vector<int6... | #include <bits/stdc++.h>
using namespace std;
using int64 = long long;
template <typename T>
vector<vector<T>> Make2DVector(int d1, int d2, T default_value) {
return vector<vector<T>>(d1, vector<T>(d2, default_value));
}
int main() {
ios::sync_with_stdio(false);
cin.tie(0);
int n;
cin >> n;
vector<int6... | insert | 24 | 24 | 24 | 27 | TLE | |
p03173 | C++ | Time Limit Exceeded | #pragma GCC optimize("Ofast,no-stack-protector,unroll-loops,fast-math,O3")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
#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;
voi... | #pragma GCC optimize("Ofast,no-stack-protector,unroll-loops,fast-math,O3")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
#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;
voi... | replace | 63 | 64 | 63 | 64 | TLE | |
p03173 | C++ | Runtime Error | #include <algorithm>
#include <cctype>
#include <cstdio>
#include <cstring>
#include <queue>
#define qmin(x, y) (x = min(x, y))
#define qmax(x, y) (x = max(x, y))
using namespace std;
inline char gc() {
// static char buf[100000],*p1,*p2;
// return
//(p1==p2)&&(p2=(p1=buf)+fread(buf,1,100000,stdin),p1==p2)?EOF:*... | #include <algorithm>
#include <cctype>
#include <cstdio>
#include <cstring>
#include <queue>
#define qmin(x, y) (x = min(x, y))
#define qmax(x, y) (x = max(x, y))
using namespace std;
inline char gc() {
// static char buf[100000],*p1,*p2;
// return
//(p1==p2)&&(p2=(p1=buf)+fread(buf,1,100000,stdin),p1==p2)?EOF:*... | replace | 42 | 43 | 42 | 43 | 0 | |
p03173 | C++ | Runtime Error | #include <cmath>
#include <iostream>
#include <map>
#include <queue>
#include <string>
#include <vector>
typedef long long ll;
const ll MOD = 1e9 + 7;
const long long INF = 1LL << 60;
const double PI = 3.14159265358979323846;
const int NMAX = 100005;
using namespace std;
pair<ll, ll> dp[401][401];
int main() {
int... | #include <cmath>
#include <iostream>
#include <map>
#include <queue>
#include <string>
#include <vector>
typedef long long ll;
const ll MOD = 1e9 + 7;
const long long INF = 1LL << 60;
const double PI = 3.14159265358979323846;
const int NMAX = 100005;
using namespace std;
pair<ll, ll> dp[401][401];
int main() {
int... | replace | 36 | 37 | 36 | 37 | 0 | |
p03173 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
long long dp[401][401];
long long a[401];
long long ps[401];
int main() {
int n;
cin >> n;
memset(dp, 0x3f3f3f3f, sizeof dp);
for (int i = 1; i <= n; i++) {
cin >> a[i];
dp[i][i] = 0;
if (i > 0) {
dp[i - 1][i] = a[i - 1] + a[i];
}
}
parti... | #include <bits/stdc++.h>
using namespace std;
long long dp[402][402];
long long a[402];
long long ps[402];
int main() {
int n;
cin >> n;
memset(dp, 0x3f3f3f3f, sizeof dp);
for (int i = 1; i <= n; i++) {
cin >> a[i];
dp[i][i] = 0;
if (i > 0) {
dp[i - 1][i] = a[i - 1] + a[i];
}
}
parti... | replace | 2 | 5 | 2 | 5 | 0 | |
p03173 | C++ | Runtime Error | #include <iostream>
using namespace std;
int main() {
int n;
cin >> n;
int a[n];
for (int i = 0; i < n; i++)
cin >> a[i];
long long dp[402][402] = {}, sum[402][402] = {};
for (int i = 0; i < n; i++)
for (int j = i + 1; j <= n; j++) {
dp[i][j] = 1LL << 60;
sum[i][j] = sum[i][j - 1] + a[j ... | #include <iostream>
using namespace std;
int main() {
int n;
cin >> n;
int a[n];
for (int i = 0; i < n; i++)
cin >> a[i];
long long dp[402][402] = {}, sum[402][402] = {};
for (int i = 0; i < n; i++)
for (int j = i + 1; j <= n; j++) {
dp[i][j] = 1LL << 60;
sum[i][j] = sum[i][j - 1] + a[j ... | replace | 17 | 18 | 17 | 18 | 0 | |
p03173 | C++ | Runtime Error | // Radhe Radhe
#include <bits/stdc++.h>
// #include<boost/multiprecision/cpp_int.hpp>
// #include <ext/pb_ds/assoc_container.hpp>
// #include <ext/pb_ds/tree_policy.hpp>
// using namespace __gnu_pbds;
// using namespace boost::multiprecision;
// #include<boost/math/common_factor.hpp>
#include <ext/numeric>
using namesp... | // Radhe Radhe
#include <bits/stdc++.h>
// #include<boost/multiprecision/cpp_int.hpp>
// #include <ext/pb_ds/assoc_container.hpp>
// #include <ext/pb_ds/tree_policy.hpp>
// using namespace __gnu_pbds;
// using namespace boost::multiprecision;
// #include<boost/math/common_factor.hpp>
#include <ext/numeric>
using namesp... | delete | 27 | 32 | 27 | 27 | -11 | |
p03173 | C++ | Runtime Error | #include <bits/stdc++.h>
#define int long long
#define endl '\n'
#define IOS \
ios::sync_with_stdio(0); \
cin.tie(0); \
cout.tie(0... | #include <bits/stdc++.h>
#define int long long
#define endl '\n'
#define IOS \
ios::sync_with_stdio(0); \
cin.tie(0); \
cout.tie(0... | replace | 9 | 10 | 9 | 10 | 0 | |
p03173 | C++ | Runtime Error | #include <bits/stdc++.h>
typedef long long int ll;
using namespace std;
ll pref_sum[404][404], dp[404][404];
int a[3000];
int main() {
int n;
cin >> n;
for (int i = 0; i < n; i++)
cin >> a[i];
if (n == 1) {
cout << a[0] << endl;
return 0;
}
memset(pref_sum, 0, sizeof(pref_sum));
memset(dp, 0, ... | #include <bits/stdc++.h>
typedef long long int ll;
using namespace std;
ll pref_sum[404][404], dp[404][404];
int a[3000];
int main() {
int n;
cin >> n;
for (int i = 0; i < n; i++)
cin >> a[i];
if (n == 1) {
cout << a[0] << endl;
return 0;
}
if (n == 2) {
cout << a[0] + a[1] << endl;
retu... | insert | 12 | 12 | 12 | 16 | 0 | |
p03173 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
using namespace std::literals::string_literals;
using i64 = long long;
using std::cin;
using std::cout;
using std::endl;
template <typename T> std::vector<T> make_v(size_t a) {
return std::vector<T>(a);
}
template <typename T, typename... Ts> auto make_v(size_t a, Ts... ts) {
return std::... | #include <bits/stdc++.h>
using namespace std::literals::string_literals;
using i64 = long long;
using std::cin;
using std::cout;
using std::endl;
template <typename T> std::vector<T> make_v(size_t a) {
return std::vector<T>(a);
}
template <typename T, typename... Ts> auto make_v(size_t a, Ts... ts) {
return std::... | insert | 18 | 18 | 18 | 20 | TLE | |
p03173 | C++ | Time Limit Exceeded | #define DEBUG 1
#include <algorithm>
#include <cmath>
#include <cstring>
#include <deque>
#include <iomanip>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <tuple>
#include <utility>
#include <vector>
using namespace std;
using ll = long long;
using ull = ... | #define DEBUG 1
#include <algorithm>
#include <cmath>
#include <cstring>
#include <deque>
#include <iomanip>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <tuple>
#include <utility>
#include <vector>
using namespace std;
using ll = long long;
using ull = ... | insert | 145 | 145 | 145 | 146 | TLE | |
p03173 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
using namespace std;
long long MOD = 1000000007;
#define IOS() \
ios_base::sync_with_stdio(0); \
cin.tie(0);
typedef long long ll;
#define pb push_back
typedef pair<ll, ll> pi;
l... | #include <bits/stdc++.h>
using namespace std;
long long MOD = 1000000007;
#define IOS() \
ios_base::sync_with_stdio(0); \
cin.tie(0);
typedef long long ll;
#define pb push_back
typedef pair<ll, ll> pi;
l... | replace | 28 | 29 | 28 | 29 | TLE | |
p03173 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
#define ALL(obj) begin(obj), end(obj)
using namespace std;
template <class T> bool chmin(T &a, const T &b) {
if (b < a) {
a = b;
return 1;
}
return 0;
}
using ll = long long;
using P = pair<ll, ll>;
const ll INF = 1e18;
int N;
vector<ll> a;
vector<vector<P>>
dp; // first: コス... | #include <bits/stdc++.h>
#define ALL(obj) begin(obj), end(obj)
using namespace std;
template <class T> bool chmin(T &a, const T &b) {
if (b < a) {
a = b;
return 1;
}
return 0;
}
using ll = long long;
using P = pair<ll, ll>;
const ll INF = 1e18;
int N;
vector<ll> a;
vector<vector<P>>
dp; // first: コス... | insert | 24 | 24 | 24 | 26 | TLE | |
p03173 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
using namespace std;
#define ll long long
#define mod 1000000007
ll dp[401][401];
vector<ll> v, pre;
ll get(ll l, ll r) { return pre[r] - (l > 0 ? pre[l - 1] : 0); }
ll f(ll l, ll r) {
if (l == r)
return 0;
if (r - l == 1)
return v[l] + v[r];
if (dp[l][r] != -1)
dp[l][r];... | #include <bits/stdc++.h>
using namespace std;
#define ll long long
#define mod 1000000007
ll dp[401][401];
vector<ll> v, pre;
ll get(ll l, ll r) { return pre[r] - (l > 0 ? pre[l - 1] : 0); }
ll f(ll l, ll r) {
if (l == r)
return 0;
if (r - l == 1)
return v[l] + v[r];
if (dp[l][r] != -1)
return dp... | replace | 18 | 19 | 18 | 19 | TLE | |
p03173 | 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 rep(i, begin, end) ... | #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 rep(i, begin, end) ... | delete | 28 | 33 | 28 | 28 | -11 | |
p03173 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int(i) = (0); (i) < (int)(n); ++(i))
using ll = long long;
using namespace std;
#define INF ((1 << 30) - 1)
#define LLINF (1LL << 60)
#define EPS (1e-10)
// dp[i][r] := l以上r未満のスライムを1体にするときのコストの最小値
// dp[i][i+1] = 0
// dp[l][r] = min(dp[l][m], dp[m][... | #include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int(i) = (0); (i) < (int)(n); ++(i))
using ll = long long;
using namespace std;
#define INF ((1 << 30) - 1)
#define LLINF (1LL << 60)
#define EPS (1e-10)
// dp[i][r] := l以上r未満のスライムを1体にするときのコストの最小値
// dp[i][i+1] = 0
// dp[l][r] = min(dp[l][m], dp[m][... | replace | 15 | 17 | 15 | 17 | 0 | |
p03173 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
using namespace std;
#define ll long long
long long helper(vector<long long> &vec, vector<vector<long long>> &dp,
long long l, long long r) {
if (l == r)
return 0;
if (l + 1 == r)
return dp[l][r] = vec[l] + vec[r];
long long ans = LLONG_MAX, sum = 0;
for (long l... | #include <bits/stdc++.h>
using namespace std;
#define ll long long
long long helper(vector<long long> &vec, vector<vector<long long>> &dp,
long long l, long long r) {
if (l == r)
return 0;
if (l + 1 == r)
return dp[l][r] = vec[l] + vec[r];
if (dp[l][r] != -1)
return dp[l][r];
long l... | insert | 9 | 9 | 9 | 11 | TLE | |
p03173 | C++ | Runtime Error | #include <algorithm>
#include <iostream>
#include <limits>
#define MAX_ELEMENTS 400
using namespace std;
// I have to create a binary tree where each inner node has the value of its two
// sons, I want to minimize the value of the root.
long long dp[MAX_ELEMENTS]
[MAX_ELEMENTS]; // The weight of having ... | #include <algorithm>
#include <iostream>
#include <limits>
#define MAX_ELEMENTS 400
using namespace std;
// I have to create a binary tree where each inner node has the value of its two
// sons, I want to minimize the value of the root.
long long dp[MAX_ELEMENTS]
[MAX_ELEMENTS]; // The weight of having ... | replace | 39 | 40 | 39 | 40 | 0 | |
p03173 | C++ | Time Limit Exceeded | #include <algorithm>
#include <iostream>
using namespace std;
long long dp[409][409];
long long N, A[409], V[409][409];
long long dfs(long long L, long long R) {
if (L > R)
return 0;
if (L == R)
return A[L];
if (dp[L][R] != 0)
return dp[L][R];
long long minx = (1LL << 60);
for (int i = L + 1; i... | #include <algorithm>
#include <iostream>
using namespace std;
long long dp[409][409];
long long N, A[409], V[409][409];
long long dfs(long long L, long long R) {
if (L > R)
return 0;
if (L == R)
return A[L];
if (dp[L][R] != 0)
return dp[L][R];
long long minx = (1LL << 60);
for (int i = L + 1; i... | insert | 19 | 19 | 19 | 20 | TLE | |
p03173 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
#pragma GCC optimize("Ofast")
#pragma GCC target("avx,avx2,fma")
#define gc(x) \
do { \
while ((x = getchar()) < '0') ... | #include <bits/stdc++.h>
#pragma GCC optimize("Ofast")
#pragma GCC target("avx,avx2,fma")
#define gc(x) \
do { \
while ((x = getchar()) < '0') ... | replace | 47 | 48 | 47 | 60 | TLE | |
p03173 | C++ | Runtime Error | /*--ILRS-- sr4saurabh */
#include <bits/stdc++.h>
using namespace std;
typedef long long int ll;
#define pb push_back
#define popb pop_back
#define mp make_pair
#define ve vector
#define vii vector<int>
#define vll vector<ll>
#define pii pair<int, int>
#define pll pair<ll, ll>
#define vpl vector<pll>
#define fi first
... | /*--ILRS-- sr4saurabh */
#include <bits/stdc++.h>
using namespace std;
typedef long long int ll;
#define pb push_back
#define popb pop_back
#define mp make_pair
#define ve vector
#define vii vector<int>
#define vll vector<ll>
#define pii pair<int, int>
#define pll pair<ll, ll>
#define vpl vector<pll>
#define fi first
... | replace | 25 | 29 | 25 | 29 | -11 | |
p03173 | C++ | Runtime Error | #include <algorithm>
#include <bits/stdc++.h>
#include <cmath>
#include <cstdlib>
using namespace std;
using ll = long long;
using P = pair<ll, ll>;
using Graph = vector<vector<ll>>;
struct edge {
ll to;
ll cost;
};
using graph = vector<vector<edge>>;
#define rep(i, n) for (ll i = 0; i < (n); ++i)
#define rep2(i, n... | #include <algorithm>
#include <bits/stdc++.h>
#include <cmath>
#include <cstdlib>
using namespace std;
using ll = long long;
using P = pair<ll, ll>;
using Graph = vector<vector<ll>>;
struct edge {
ll to;
ll cost;
};
using graph = vector<vector<edge>>;
#define rep(i, n) for (ll i = 0; i < (n); ++i)
#define rep2(i, n... | replace | 59 | 60 | 59 | 60 | -11 | |
p03173 | C++ | Runtime Error | /*
https://atcoder.jp/contests/dp/tasks/dp_n
*/
#include <bits/stdc++.h>
using namespace std;
long long dp[401][401];
int main() {
ios_base::sync_with_stdio(0);
cin.tie(0);
cout.tie(0);
int n;
cin >> n;
long long a[401] = {0};
for (int i = 1; i <= n; i++) {
cin >> a[i];
a[i] += a[i - 1];
}
mem... | /*
https://atcoder.jp/contests/dp/tasks/dp_n
*/
#include <bits/stdc++.h>
using namespace std;
long long dp[401][401];
int main() {
ios_base::sync_with_stdio(0);
cin.tie(0);
cout.tie(0);
int n;
cin >> n;
long long a[401] = {0};
for (int i = 1; i <= n; i++) {
cin >> a[i];
a[i] += a[i - 1];
}
mem... | replace | 28 | 31 | 28 | 32 | 0 | |
p03173 | C++ | Time Limit Exceeded | #include <iostream>
using namespace std;
int a[401];
long long dp[401][401];
long long pref[401];
int main() {
long long n, l;
cin >> n;
for (int i = 0; i < n; i++) {
cin >> a[i];
}
pref[0] = a[0];
for (int i = 1; i < n; i++) {
pref[i] = pref[i - 1] + a[i];
for (int len = 1; len <= n; len++) {
... | #include <iostream>
using namespace std;
int a[401];
long long dp[401][401];
long long pref[401];
int main() {
long long n, l;
cin >> n;
for (int i = 0; i < n; i++) {
cin >> a[i];
}
pref[0] = a[0];
for (int i = 1; i < n; i++) {
pref[i] = pref[i - 1] + a[i];
}
for (int len = 1; len <= n; len++) {... | replace | 14 | 32 | 14 | 32 | TLE | |
p03174 | C++ | Time Limit Exceeded | #include <algorithm>
#include <array>
#include <bitset>
#include <cassert>
#include <climits>
#include <cmath>
#include <complex>
#include <cstring>
#include <iomanip>
#include <iostream>
#include <limits>
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <unordered_map>
#includ... | #include <algorithm>
#include <array>
#include <bitset>
#include <cassert>
#include <climits>
#include <cmath>
#include <complex>
#include <cstring>
#include <iomanip>
#include <iostream>
#include <limits>
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <unordered_map>
#includ... | replace | 517 | 518 | 517 | 518 | TLE | |
p03174 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
#define pb push_back
#define ll long long int
#define mp make_pair
#define S second
#define F first
int mod = 1e9 + 7;
#define input_from_file freopen("input.txt", "r", stdin);
ll dp[1 << 22][25];
ll allmask;
ll recursion(ll &n, ll mask, vector<vector<int>> &vec, ll level)... | #include <bits/stdc++.h>
using namespace std;
#define pb push_back
#define ll long long int
#define mp make_pair
#define S second
#define F first
int mod = 1e9 + 7;
#define input_from_file freopen("input.txt", "r", stdin);
ll dp[1 << 22][25];
ll allmask;
ll recursion(ll &n, ll mask, vector<vector<int>> &vec, ll level)... | replace | 33 | 34 | 33 | 34 | -11 | |
p03174 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double ld;
typedef unsigned long long ull;
typedef vector<int> vi;
typedef vector<bool> vb;
typedef vector<double> vd;
typedef vector<ll> vll;
typedef vector<vector<int>> vvi;
typedef vector<vector<long long>> vvll;
typedef vector<vd> vvd... | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double ld;
typedef unsigned long long ull;
typedef vector<int> vi;
typedef vector<bool> vb;
typedef vector<double> vd;
typedef vector<ll> vll;
typedef vector<vector<int>> vvi;
typedef vector<vector<long long>> vvll;
typedef vector<vd> vvd... | replace | 37 | 40 | 37 | 41 | TLE | |
p03174 | C++ | Time Limit Exceeded | #pragma GCC optimize("O3")
#include <bits/stdc++.h>
using namespace std;
#define MuhammedAly \
ios_base::sync_with_stdio(0); \
cin.tie(0); \
co... | #pragma GCC optimize("O3")
#include <bits/stdc++.h>
using namespace std;
#define MuhammedAly \
ios_base::sync_with_stdio(0); \
cin.tie(0); \
co... | replace | 46 | 47 | 46 | 47 | TLE | |
p03174 | C++ | Runtime Error | #include <bits/stdc++.h>
using vll = std::vector<long long>;
constexpr long long mod{1000000007};
int n;
bool edge[21][21]{};
std::vector<vll> mf;
long long rc(int, int);
int main() {
scanf("%d", &n);
for (int i{}; i < n; i++)
for (int j{}; j < n; j++) {
int a;
scanf("%d", &a);
edge[i][j] ... | #include <bits/stdc++.h>
using vll = std::vector<long long>;
constexpr long long mod{1000000007};
int n;
bool edge[21][21]{};
std::vector<vll> mf;
long long rc(int, int);
int main() {
scanf("%d", &n);
for (int i{}; i < n; i++)
for (int j{}; j < n; j++) {
int a;
scanf("%d", &a);
edge[i][j] ... | replace | 23 | 24 | 23 | 24 | -6 | free(): invalid pointer
|
p03174 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
using namespace ::std;
#define all(x) (x).begin(), (x).end()
typedef long long ll;
typedef array<int, 3> tri;
typedef long double ld;
template <class T> istream &operator>>(istream &I, vector<T> &v) {
for (T &e : v)
I >> e;
return I;
}
template <class T> ostream &operator<<(ostream &... | #include <bits/stdc++.h>
using namespace ::std;
#define all(x) (x).begin(), (x).end()
typedef long long ll;
typedef array<int, 3> tri;
typedef long double ld;
template <class T> istream &operator>>(istream &I, vector<T> &v) {
for (T &e : v)
I >> e;
return I;
}
template <class T> ostream &operator<<(ostream &... | insert | 36 | 36 | 36 | 38 | TLE | |
p03174 | C++ | Runtime Error |
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define MAXN 100100
const ll inf = (ll)1e10;
const ll MOD = (ll)1e9 + 7;
ll dp[21][1 << 21];
bool chk(int pos, int mask) { return mask & (1 << pos); }
int on(int pos, int mask) { return mask | (1 << pos); }
int n, done;
int adj[21][21];
ll solve(ll po... |
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define MAXN 100100
const ll inf = (ll)1e10;
const ll MOD = (ll)1e9 + 7;
ll dp[22][1 << 22];
bool chk(int pos, int mask) { return mask & (1 << pos); }
int on(int pos, int mask) { return mask | (1 << pos); }
int n, done;
int adj[21][21];
ll solve(ll po... | replace | 7 | 8 | 7 | 8 | -11 | |
p03174 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
#define ll long long
#define MAX 2999
ll mod = pow(10, 9) + 7;
ll dp[22][1 << 21];
using namespace std;
int main() {
int n;
cin >> n;
int A[n][n];
for (int i = 0; i < n; i++) {
for (int j = 0; j < n; j++)
cin >> A[i][j];
}
for (int i = 0; i <= n; i++) {
for (int j =... | #include <bits/stdc++.h>
#define ll long long
#define MAX 2999
ll mod = pow(10, 9) + 7;
ll dp[22][1 << 21];
using namespace std;
int main() {
int n;
cin >> n;
int A[n][n];
for (int i = 0; i < n; i++) {
for (int j = 0; j < n; j++)
cin >> A[i][j];
}
for (int i = 0; i <= n; i++) {
for (int j =... | insert | 26 | 26 | 26 | 29 | TLE | |
p03174 | C++ | Time Limit Exceeded | #include <iostream>
#include <vector>
using namespace std;
struct _ {
ios_base::Init i;
_() { ios_base::sync_with_stdio(false), cin.tie(NULL), cout.tie(NULL); }
} _;
#define MOD 1000000007
int main() {
int n;
cin >> n;
vector<vector<int>> a(n, vector<int>(n, 0));
for (int i = 0; i <= n - 1; i++)
for... | #include <iostream>
#include <vector>
using namespace std;
struct _ {
ios_base::Init i;
_() { ios_base::sync_with_stdio(false), cin.tie(NULL), cout.tie(NULL); }
} _;
#define MOD 1000000007
int main() {
int n;
cin >> n;
vector<vector<int>> a(n, vector<int>(n, 0));
for (int i = 0; i <= n - 1; i++)
for... | insert | 26 | 26 | 26 | 28 | TLE | |
p03174 | C++ | Runtime Error | // In The Name Of God
#include <bits/stdc++.h>
#define F first
#define S second
#define mp make_pair
#define L(x) (2 * (x))
#define R(x) ((2 * (x)) + 1)
#define pii pair<int, int>
#define pb push_back
using namespace std;
const int N = 4e2 + 5, Mod = 1e9 + 7, P = 727, Lg = 21, TOF = 1900;
int Dp[Lg][(1 << Lg)], A[Lg][... | // In The Name Of God
#include <bits/stdc++.h>
#define F first
#define S second
#define mp make_pair
#define L(x) (2 * (x))
#define R(x) ((2 * (x)) + 1)
#define pii pair<int, int>
#define pb push_back
using namespace std;
const int N = 4e2 + 5, Mod = 1e9 + 7, P = 727, Lg = 22, TOF = 1900;
int Dp[Lg][(1 << Lg)], A[Lg][... | replace | 10 | 11 | 10 | 11 | -11 | |
p03174 | 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; i >= 0; i--)
#define FOR(i, m, n) for (int i = m; i < n; i++)
#define fi first
#define se second
#define mp make_pair
#define itrfor(itr, A) for (auto itr = A.begin(); itr != A.end(); itr++)
te... | #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; i >= 0; i--)
#define FOR(i, m, n) for (int i = m; i < n; i++)
#define fi first
#define se second
#define mp make_pair
#define itrfor(itr, A) for (auto itr = A.begin(); itr != A.end(); itr++)
te... | insert | 76 | 76 | 76 | 78 | TLE | |
p03174 | C++ | Time Limit Exceeded | #include <iostream>
using namespace std;
typedef long long ll;
ll dp[22][(1 << 21)];
int a[21][21];
const ll MOD = 1e9 + 7;
int main() {
int n;
cin >> n;
for (int i = 0; i < n; i++) {
for (int j = 0; j < n; j++) {
cin >> a[i][j];
}
}
dp[0][0] = 1;
for (int i = 0; i < n; i++) {
for (int... | #include <iostream>
using namespace std;
typedef long long ll;
ll dp[22][(1 << 21)];
int a[21][21];
const ll MOD = 1e9 + 7;
int main() {
int n;
cin >> n;
for (int i = 0; i < n; i++) {
for (int j = 0; j < n; j++) {
cin >> a[i][j];
}
}
dp[0][0] = 1;
for (int i = 0; i < n; i++) {
for (int... | insert | 21 | 21 | 21 | 23 | TLE | |
p03174 | C++ | Time Limit Exceeded | #include <algorithm>
#include <bitset>
#include <cmath>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <utility>
#include <vector>
using namespace std;
typedef long long ll;
ll MOD = 1000000007;
int main() {
int N;
cin >> N;
vector<bitset<21>> a(... | #include <algorithm>
#include <bitset>
#include <cmath>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <utility>
#include <vector>
using namespace std;
typedef long long ll;
ll MOD = 1000000007;
int main() {
int N;
cin >> N;
vector<bitset<21>> a(... | insert | 39 | 39 | 39 | 41 | TLE |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.