Submission #954412

#TimeUsernameProblemLanguageResultExecution timeMemory
954412ArtieAaronAirline Route Map (JOI18_airline)C++14
0 / 100
364 ms10840 KiB
#include "Alicelib.h" #include <cassert> #include <cstdio> #include <bits/stdc++.h> using namespace std; #define vec vector typedef int lli; typedef pair<lli, lli> ii; typedef vec<lli> vi; typedef vec<ii> vii; typedef vec<vi> vvi; #define f first #define s second #define pb push_back #define sz(v) (v).size() #define mid lli((l + r)/2) #define all(v) sort((v).begin(), (v).end()) #define rall(v) sort((v).rbegin(), (v).rend()) #define SL '\n' #define fore(a,s,d) for(lli a = (s), asd = (d); a < asd; a++) #define wd(a,s,d) for(lli a = (s), asd = (d); a > asd; a --) #define _ ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0); const lli NN = 1500; vi pd = { 1, 2, 4, 8, 16, 32, 64, 128, 256, 512, 1024, 2048 }; void Alice(int N, int M, int A[], int B[]){ vi ans(N-1); ans.pb(512 + N); fore(i,1,N) ans[i-1] = pd[i]; // for(auto i: ans) cout << i << ' '; cout << SL; fore(i,0,M){ lli a = A[i], b = B[i]; if(b > a) swap(a, b); ans[a-1] += pd[b]; } // for(auto i: ans) cout << i << ' '; cout << SL; { lli mans = 0; for(auto i: ans) mans += i; InitG(1500, mans); } lli l = 0, r = 1499; for(auto &i: ans){ while(i--){ MakeG(l, l, r); l ++; } r --; } }
#include "Boblib.h" #include <cassert> #include <cstdio> #include <bits/stdc++.h> using namespace std; #define vec vector typedef int lli; typedef pair<lli, lli> ii; typedef vec<lli> vi; typedef vec<ii> vii; typedef vec<vi> vvi; #define f first #define s second #define pb push_back #define sz(v) (v).size() #define mid lli((l + r)/2) #define all(v) sort((v).begin(), (v).end()) #define rall(v) sort((v).rbegin(), (v).rend()) #define SL '\n' #define fore(a,s,d) for(lli a = (s), asd = (d); a < asd; a++) #define wd(a,s,d) for(lli a = (s), asd = (d); a > asd; a --) #define _ ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0); const lli NN = 1500; vi pd = { 1, 2, 4, 8, 16, 32, 64, 128, 256, 512, 1024, 2048 }; void Bob(int V, int U, int C[], int D[]){ vi ans(V); fore(i,0,U){ ans[C[i]] ++; ans[D[i]] ++; } rall(ans); lli nn = ans[0] - 512; vii aristas; for(lli i = nn-1; i >= 0; i --){ lli p = ans[nn - i]; p -= pd[i]; lli y = 0; while(p){ if(p&1){ aristas.pb(ii({i, y})); } p >>= 1; y ++; } } InitMap(nn, sz(aristas)); for(auto i: aristas){ MakeMap(i.f, i.s); } }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...