제출 #473295

#제출 시각아이디문제언어결과실행 시간메모리
473295hhhhaura악어의 지하 도시 (IOI11_crocodile)C++14
100 / 100
592 ms61220 KiB
#define wiwihorz #include "crocodile.h" #include <bits/stdc++.h> #pragma GCC optimize("Ofast") #pragma loop-opt(on) #define rep(i, a, b) for(int i = a; i <= b; i ++) #define rrep(i, a, b) for(int i = b; i >= a; i --) #define all(x) x.begin(), x.end() #define ceil(a, b) ((a + b - 1) / (b)) #define INF 2000000000 #define MOD 1000000007 #define eps (1e-9) using namespace std; #define lld long double #define pii pair<int, int> #define random mt19937 rnd(chrono::steady_clock::now().time_since_epoch().count()) #ifdef wiwihorz #define print(a...) cerr << "Line " << __LINE__ << ": ", kout("[" + string(#a) + "] = ", a) void vprint(auto L, auto R) {while(L < R) cerr << *L << " \n"[next(L) == R], ++L;} void kout() { cerr << endl; } template<class T1, class ... T2> void kout(T1 a, T2 ... e) { cerr << a << " ", kout(e...); } #else #define print(...) 0 #define vprint(...) 0 #endif vector<vector<pii>> mp; vector<int> a, b; int travel_plan(int N, int M, int R[][2], int L[], int K, int P[]) { mp.assign(N, vector<pii>()); a.assign(N, INF); b.assign(N, INF); priority_queue<pii, vector<pii>, greater<pii>> pq; rep(i, 0, M - 1) { mp[R[i][0]].push_back({R[i][1], L[i]}); mp[R[i][1]].push_back({R[i][0], L[i]}); } rep(i, 0, K - 1) { a[P[i]] = b[P[i]] = 0; pq.push({0, P[i]}); } while(pq.size()) { pii p = pq.top(); pq.pop(); if(b[p.second] != p.first) continue; int cur = p.second; for(auto i : mp[cur]) { int v = min(INF, b[cur] + i.second); int ori = b[i.first]; if(v < a[i.first]) swap(v, a[i.first]); if(v < b[i.first]) swap(v, b[i.first]); if(ori != b[i.first]) pq.push({b[i.first], i.first}); } } return b[0]; }

컴파일 시 표준 에러 (stderr) 메시지

crocodile.cpp:5: warning: ignoring '#pragma loop ' [-Wunknown-pragmas]
    5 | #pragma loop-opt(on)
      | 
crocodile.cpp:24:13: warning: use of 'auto' in parameter declaration only available with '-fconcepts-ts'
   24 | void vprint(auto L, auto R) {while(L < R) cerr << *L << " \n"[next(L) == R], ++L;}
      |             ^~~~
crocodile.cpp:24:21: warning: use of 'auto' in parameter declaration only available with '-fconcepts-ts'
   24 | void vprint(auto L, auto R) {while(L < R) cerr << *L << " \n"[next(L) == R], ++L;}
      |                     ^~~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...