제출 #696706

#제출 시각아이디문제언어결과실행 시간메모리
696706browntoadRobot (JOI21_ho_t4)C++14
0 / 100
101 ms21720 KiB
#include <bits/stdc++.h> using namespace std; #define ll long long #define int ll #define FOR(i, a, b) for (int i=(a); i<(b); i++) #define REP(i, n) FOR(i, 0, n) #define REP1(i, n) FOR(i, 1, n+1) #define pii pair<int, int> #define ppi pair<int, pii> #define f first #define s second #define pb push_back #define ALL(x) (x).begin(), (x).end() #define SZ(x) (int)((x).size()) const ll maxn = 1e5+5; const ll maxm = 2e5+5; map<pii, bool> occ; // the special dp[i][j] state (if it is alr determined or not) vector<int> dpv(maxn); priority_queue<ppi, vector<ppi>, greater<ppi> > pq; map<pii, int> vord; struct edge{ int to, c, p; int idc; // for that node, the rank of the color bool operator <(edge b){ return c<b.c; } }; vector<edge> e[maxn]; vector<vector<int> > ec[maxm]; int n, m; signed main(){ cin>>n>>m; REP(i, m){ int u, v, c, p; cin>>u>>v>>c>>p; e[u].pb({v, c, p, 0}); e[v].pb({u, c, p, 0}); } REP1(i, n){ sort(ALL(e[i])); int cnt = 1; REP(j, SZ(e[i])){ if (j!=0 && e[i][j].c!=e[i][j-1].c){ cnt++; } e[i][j].idc = cnt; } ec[i].resize(cnt+1); REP(j, SZ(e[i])){ ec[i][e[i][j].idc].pb(j); } } // compute dp pq.push({0, {1, 0}}); while(pq.size()){ ppi tmp = pq.top(); pq.pop(); if (occ.count(tmp.s)) continue; } }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...