# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
42421 | nickyrio | 도장 모으기 (JOI14_stamps) | C++14 | 234 ms | 80304 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include <bits/stdc++.h>
#define FOR(i, a, b) for (int i = a; i<= b; ++i)
#define FORD(i, a, b) for (int i = a; i>=b; --i)
#define REP(i, a) for (int i = 0; i<a; ++i)
#define DEBUG(x) { cerr << #x << " = " << x << endl; }
#define Arr(A, l, r) { cerr << #A << " = "; FOR(_, l, r) cerr << A[_] << ' '; cerr << endl; }
#define N 3333
#define pp pair<int, int>
#define next __next
#define prev __prev
#define __builtin_popcount __builtin_popcountll
#define bit(S, i) (((S) >> i) & 1)
#define IO ios::sync_with_stdio(false); cin.tie(NULL);cout.tie(NULL);
using namespace std;
/* There are 4 cases to get stamps :
1. Right-right : Up -> Down
2. Right-left : Up -> Up
3. Left-right : Down -> Up
4. Left-left : Down -> Down
*/
// There are no more than N R-R, L-L with optimal solution.
//dp[i][j] : The minimum time to get the i'th station and remain j left-left unpaired.
// Answer is dp[n + 1][0]
void Min(long long &a, long long b) { a = a > b ? b : a; }
int n;
long long t, dp[N][N], u[N], v[N], d[N], e[N];
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |