Submission #19033

#TimeUTC-0UsernameProblemLanguageResultExecution timeMemory
190332016-02-17 06:36:05suhgyuho_williamRail (IOI14_rail)C++98
100 / 100
201 ms892 KiB
#include "rail.h"
#include <algorithm>
#include <stdio.h>
using namespace std;
int dis0[5010];
int disx[5010];
int bef[5010],next[5010];
int op[5010],num[5010];
bool cmp(int x,int y){
return dis0[x] < dis0[y];
}
bool cmp2(int x,int y){
return disx[x] < disx[y];
}
void findLocation(int N, int first, int location[], int stype[]){
int i,j,k;
int small,x;
int t,v,nv;
int rear,tmp;
location[0] = first; stype[0] = 1;
small = 999999999;
for(i=1; i<N; i++){
dis0[i] = getDistance(0,i);
if(small > dis0[i]){
small = dis0[i];
x = i;
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

Compilation message (stderr)

rail.cpp: In function 'void findLocation(int, int, int*, int*)':
rail.cpp:33:31: warning: 'x' may be used uninitialized in this function [-Wmaybe-uninitialized]
     location[x] = first+dis0[x];
                         ~~~~~~^
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...