#include "network.h"
#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define mp make_pair
#define pb push_back
#define x first
#define y second
#define pii pair<int, int>
#define p3i pair<pii, int>
#define pll pair<ll, ll>
#define p3l pair<pll, ll>
#define vi vector<int>
#define vpii vector<pii>
#define vp3i vector<p3i>
#define vpll vector<pll>
#define vp3l vector<p3l>
#define lseg L, (L+R)/2, N*2+1
#define rseg (L+R)/2+1, R, N*2+2
#define ub upper_bound
#define lb lower_bound
#define pq priority_queue
#define MN 1000000007
#define fox(k, x) for (int k=0; k<x; ++k)
#define fox1(k, x) for (int k=1; k<=x; ++k)
#define foxr(k, x) for (int k=x-1; k>=0; --k)
#define fox1r(k, x) for (int k=x; k>0; --k)
#define ms multiset
#define flood(x) memset(x, 0x3f3f3f3f, sizeof x)
#define drain(x) memset(x, 0, sizeof x)
#define rng() ((rand() << 14)+rand())
#define scan(X) do{while((X=getchar())<'0'); for(X-='0'; '0'<=(_=getchar()); X=(X<<3)+(X<<1)+_-'0');}while(0)
char _;
#define pi 3.14159265358979323846
/*
int distanc[5][5]=
{0, 0, 0, 0, 0,
0, 0, 1, 1, 2,
0, 1, 0, 2, 1,
0, 1, 2, 0, 1,
0, 2, 1, 1, 0
};
int ping(int a, int b){
return distanc[a][b];
}
void travelTo(int N){cout << "*" << N << ' ' << endl;}*/
int d2[1005];
void findRoute(int n, int a, int b){
int diameter = ping(a, b) + 1;
fox1(l, n){
if (l!=b)
d2[l] = ping(b, l) + 1;
}
fox1(dis, diameter){
fox1(l, n){
if (d2[l] == diameter - dis && l!=a && ping(a, l) == 1){
travelTo(l);
a=l;
break;
}
}
}
}
/*
int32_t main(){
findRoute(4, 1, 4);
return 0;
}*/
Compilation message
grader.c: In function 'int main()':
grader.c:48:11: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
scanf ("%d%d%d%d", &N, &a, &b, &M);
~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~
grader.c:51:18: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
scanf("%d", &distance[u][v]);
~~~~~^~~~~~~~~~~~~~~~~~~~~~~
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
119 ms |
8116 KB |
Travelling to nonadjacent computer |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
104 ms |
10664 KB |
Travelling to nonadjacent computer |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
108 ms |
13316 KB |
Travelling to nonadjacent computer |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
108 ms |
15836 KB |
Travelling to nonadjacent computer |
2 |
Halted |
0 ms |
0 KB |
- |