제출 #902211

#제출 시각아이디문제언어결과실행 시간메모리
902211Muhammad_Aneeq철로 (IOI14_rail)C++17
30 / 100
51 ms628 KiB
#include "rail.h" #include <vector> #include <algorithm> using namespace std; int dist(int i,int j) { return getDistance(i,j); } void findLocation(int n, int pos, int location[], int stype[]) { int f=1e9+10; int ind=-1; for (int i=1;i<n;i++) { int z=(dist(0,i)); if (z<f) { f=z; ind=i; } } vector<pair<int,int>>sm,bi; for (int i=1;i<n;i++) { if (i==ind) continue; int z=dist(ind,i); if (dist(0,i)==z+f) sm.push_back({z,i}); else bi.push_back({z,i}); } sort(begin(sm),end(sm)); sort(begin(bi),end(bi)); location[0]=pos; stype[0]=1; for (int i=0;i<sm.size();i++) { location[sm[i].second]=pos-sm[i].first+f; stype[sm[i].second]=1; } for (int i=0;i<bi.size();i++) { location[bi[i].second]=pos+bi[i].first-f; stype[bi[i].second]=2; } location[ind]=pos+f; stype[ind]=2; }

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

rail.cpp: In function 'void findLocation(int, int, int*, int*)':
rail.cpp:37:16: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<std::pair<int, int> >::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   37 |  for (int i=0;i<sm.size();i++)
      |               ~^~~~~~~~~~
rail.cpp:42:16: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<std::pair<int, int> >::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   42 |  for (int i=0;i<bi.size();i++)
      |               ~^~~~~~~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...