# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
1176068 | VMaksimoski008 | Passport (JOI23_passport) | C++17 | 1297 ms | 1114112 KiB |
#include <bits/stdc++.h>
#define ar array
using namespace std;
signed main() {
ios_base::sync_with_stdio(false);
cout.tie(0); cin.tie(0);
int n; cin >> n;
vector<int> L(n+1), R(n+1);
for(int i=1; i<=n; i++) cin >> L[i] >> R[i];
vector<ar<int, 3> > G[n+1][n+1];
int dp[n+1][n+1];
for(int i=1; i<=n; i++) G[L[i]][R[i]].push_back({ i, i, 1 });
for(int i=1; i<=n; i++) {
for(int j=i+1; j<=n; j++) {
G[i+1][j].push_back({ i, j, 0 });
G[i][j-1].push_back({ i, j, 0 });
}
}
for(int i=1; i<=n; i++) {
int mn = 1e9, mx = 0;
for(int j=i; j<=n; j++) {
mn = min(mn, L[j]);
mx = max(mx, R[j]);
G[mn][j].push_back({ i, j, 1 });
G[i][mx].push_back({ i, j, 1 });
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |