Submission #82834

# Submission time Handle Problem Language Result Execution time Memory
82834 2018-11-02T01:31:07 Z imaxblue Computer Network (BOI14_network) C++17
100 / 100
156 ms 47656 KB
#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) == 0){
        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]);
             ~~~~~^~~~~~~~~~~~~~~~~~~~~~~
# Verdict Execution time Memory Grader output
1 Correct 118 ms 4216 KB Output is correct
2 Correct 125 ms 7540 KB Output is correct
3 Correct 103 ms 10416 KB Output is correct
4 Correct 111 ms 13248 KB Output is correct
5 Correct 102 ms 15760 KB Output is correct
6 Correct 100 ms 18376 KB Output is correct
7 Correct 2 ms 18376 KB Output is correct
8 Correct 2 ms 18376 KB Output is correct
9 Correct 2 ms 18376 KB Output is correct
10 Correct 2 ms 18376 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 107 ms 18376 KB Output is correct
2 Correct 27 ms 18376 KB Output is correct
3 Correct 118 ms 22540 KB Output is correct
4 Correct 99 ms 24480 KB Output is correct
5 Correct 117 ms 28116 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 104 ms 28116 KB Output is correct
2 Correct 43 ms 28116 KB Output is correct
3 Correct 118 ms 32332 KB Output is correct
4 Correct 99 ms 34252 KB Output is correct
5 Correct 147 ms 37888 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 111 ms 37888 KB Output is correct
2 Correct 27 ms 37888 KB Output is correct
3 Correct 120 ms 42064 KB Output is correct
4 Correct 94 ms 43980 KB Output is correct
5 Correct 156 ms 47656 KB Output is correct