Submission #787804

#TimeUTC-0UsernameProblemLanguageResultExecution timeMemory
7878042023-07-19 12:53:46vnm06Towns (IOI15_towns)C++14
0 / 100
1 ms596 KiB
#include "towns.h"
#include<bits/stdc++.h>
using namespace std;
int st[150][150];
int pitaj(int i, int j)
{
if(st[i][j]!=-1) return st[i][j];
st[i][j]=getDistance(i, j);
st[j][i]=st[i][j];
}
int hubDistance(int N, int sub)
{
int n=N;
memset(st, -1, sizeof(st));
for(int i=0; i<n; i++) st[i][i]=0;
int v1=0;
for(int i=1; i<n; i++)
{
if(pitaj(0, i)>pitaj(0, v1)) v1=i;
}
int v2=0;
for(int i=0; i<n; i++)
{
if(pitaj(v1, i)>pitaj(v1, v2)) v2=i;
}
int R=1e9;
for(int i=0; i<n; i++)
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

Compilation message (stderr)

towns.cpp: In function 'int hubDistance(int, int)':
towns.cpp:14:28: warning: unused parameter 'sub' [-Wunused-parameter]
   14 | int hubDistance(int N, int sub)
      |                        ~~~~^~~
towns.cpp: In function 'int pitaj(int, int)':
towns.cpp:11:13: warning: control reaches end of non-void function [-Wreturn-type]
   11 |     st[j][i]=st[i][j];
      |     ~~~~~~~~^~~~~~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...