제출 #588233

#제출 시각UTC-0아이디문제언어결과실행 시간메모리
5882332022-07-02 20:33:05FatihSolak철로 (IOI14_rail)C++17
100 / 100
98 ms32076 KiB
#include "rail.h"
#include <bits/stdc++.h>
#define N 5005
using namespace std;
int d[N][N];
int get(int i,int j){
if(i > j)swap(i,j);
if(i == j)return 0;
if(d[i][j])
return d[i][j];
return d[i][j] = getDistance(i,j);
}
void findLocation(int n, int first, int location[], int stype[])
{
for(int i = 0;i<n;i++){
location[i] = -1;
stype[i] = -1;
}
location[0] = first;
stype[0] = 1;
if(n == 1)return;
vector<pair<int,int>> v;
for(int i = 0;i<n;i++){
if(i == 0)continue;
v.push_back({get(0,i),i});
}
sort(v.begin(),v.end());
int last = v[0].second;
int x = last;
location[v[0].second] = get(0,v[0].second) + first;
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

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

rail.cpp: In function 'void findLocation(int, int, int*, int*)':
rail.cpp:33:20: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<std::pair<int, int> >::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   33 |     for(int i = 1;i<v.size();i++){
      |                   ~^~~~~~~~~
rail.cpp:68:20: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<std::pair<int, int> >::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   68 |     for(int i = 1;i<v.size();i++){
      |                   ~^~~~~~~~~
rail.cpp:64:9: warning: unused variable 'y' [-Wunused-variable]
   64 |     int y = 0;
      |         ^
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...