Submission #1176067

#TimeUTC-0UsernameProblemLanguageResultExecution timeMemory
11760672025-03-29 20:23:57VMaksimoski008Passport (JOI23_passport)C++17
40 / 100
2105 ms1114112 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[i][i].push_back({ L[i], R[i], 1 });
for(int i=1; i<=n; i++) {
for(int j=i+1; j<=n; j++) {
G[i][j].push_back({ i+1, j, 0 });
G[i][j].push_back({ i, j-1, 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[i][j].push_back({ mn, j, 1 });
G[i][j].push_back({ i, mx, 1 });
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...