Submission #315447

#TimeUsernameProblemLanguageResultExecution timeMemory
315447Kenzo_1114Airline Route Map (JOI18_airline)C++17
0 / 100
826 ms22784 KiB
#include<bits/stdc++.h> #include "Alicelib.h" using namespace std; const int MAXN = 1510; int in[MAXN]; void Alice(int n, int m, int a[], int b[]) { int nodes = n; vector<pair<int, int> > ans; for(int i = 0; i < m; i++) in[a[i]]++, in[b[i]]++; for(int i = 0; i < n; i++) for(int j = in[i]; j < i + 10; j++) ans.push_back(make_pair(i, nodes++)); InitG(nodes, (int) ans.size() + m); for(int i = 0; i < m; i++) MakeG(i, a[i], b[i]); for(int i = m; i < m + (int) ans.size(); i++) MakeG(i, ans[i - m].first, ans[i - m].second); }
#include<bits/stdc++.h> #include "Boblib.h" using namespace std; const int MAXN = 1510; int in[MAXN], p[MAXN]; void Bob(int v, int u, int c[], int d[]) { for(int i = 0; i < u; i++) in[c[i]]++, in[d[i]]++; for(int i = 0; i < v; i++) { if(in[i] < 10) p[i] = MAXN * MAXN; else p[i] = in[i] - 10; } vector<pair<int, int> > ans; int n = 0; for(int i = 0; i < u; i++) { int a = p[c[i]]; int b = p[d[i]]; if(a == MAXN * MAXN || b == MAXN * MAXN) continue; n = max(n, max(a, b)); ans.push_back(make_pair(a, b)); } InitMap(n, (int) ans.size()); for(int i = 0; i < (int) ans.size(); i++) MakeMap(ans[i].first, ans[i].second); }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...