제출 #812445

#제출 시각아이디문제언어결과실행 시간메모리
812445Andrey철로 (IOI14_rail)C++14
30 / 100
3064 ms197556 KiB
#include "rail.h" #include<bits/stdc++.h> using namespace std; priority_queue<pair<int,pair<int,int>>> idk; void findLocation(int n, int first, int location[], int stype[]) { location[0] = first; stype[0] = 1; for(int i = 1; i < n; i++) { location[i] = -1; } for(int i = 1; i < n; i++) { idk.push({-getDistance(0,i),{0,i}}); } int a,b,c,t,p; while(!idk.empty()) { a = -idk.top().first; b = idk.top().second.first; c = idk.top().second.second; idk.pop(); if(location[c] != -1) { continue; } t = stype[b]; if(t == 1) { location[c] = location[b]+a; stype[c] = 2; } else { location[c] = location[b]-a; stype[c] = 1; } for(int i = 0; i < n; i++) { if(location[i] == -1) { idk.push({-getDistance(c,i),{c,i}}); } } } }

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

rail.cpp: In function 'void findLocation(int, int, int*, int*)':
rail.cpp:16:17: warning: unused variable 'p' [-Wunused-variable]
   16 |     int a,b,c,t,p;
      |                 ^
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...