제출 #962117

#제출 시각아이디문제언어결과실행 시간메모리
962117IUA_Hasin철로 (IOI14_rail)C++17
30 / 100
57 ms612 KiB
#include "rail.h" #include <bits/stdc++.h> #define endl "\n" #define yeap cout<<"YES"<<endl #define nope cout<<"NO"<<endl #define ll long long using namespace std; const ll M = 5001; ll vis[M]; void findLocation(int N, int first, int location[], int stype[]) { location[0] = first; stype[0] = 1; vector<pair<ll, ll>> v; for(int i=1; i<N; i++){ ll a = getDistance(0, i); v.push_back({a, i}); } ll mn = v[0].first; ll mnind = v[0].second; for(int i=0; i<v.size(); i++){ ll a = v[i].first; ll b = v[i].second; // cout << a << " " << b << endl; if(a<mn){ mn = a; mnind = b; } } // cout<<endl; // cout << mn << " " << mnind << endl; // cout<<endl; location[mnind] = first+mn; stype[mnind] = 2; for(int i=1; i<N; i++){ if(i!=mnind){ ll a = getDistance(0, i); ll b = getDistance(mnind, i); // cout << a << " " << b << endl; if((mn+b)==a){ stype[i] = 1; location[i] = location[mnind]-b; } else { stype[i] = 2; location[i] = location[0]+a; } } } // cout<<endl; // for(int i=0; i<N; i++){ // cout << stype[i] << " " << location[i] << endl; // } }

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

rail.cpp: In function 'void findLocation(int, int, int*, int*)':
rail.cpp:26:19: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<std::pair<long long int, long long int> >::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   26 |     for(int i=0; i<v.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...