Submission #752575

# Submission time Handle Problem Language Result Execution time Memory
752575 2023-06-03T08:47:37 Z penguin133 Computer Network (BOI14_network) C++17
0 / 100
1000 ms 4552 KB

        #include <bits/stdc++.h>
        using namespace std;
         
        //#define int long long
        #include "network.h"
        #define pi pair<int, int>
        #define pii pair<int, pi>
        #define fi first
        #define se second
        #ifdef _WIN32
        #define getchar_unlocked _getchar_nolock
        #endif
        mt19937_64 rng(chrono::steady_clock::now().time_since_epoch().count());
         
        vector <int> tmp[10005];
         
        void findRoute (int N, int a, int b)
        {
        	int hi;
            for(int i=1;i<=N;i++){
              if(i == b)continue;
        		int x = ping(i, b);
              x++;
        		if(i == a)hi = x;
        		else tmp[x].push_back(i);
        	}
        	int cur = a;
        	while(hi){
        		for(auto i : tmp[hi-1]){
        			if(ping(cur, i) == 0){
        				travelTo(i);
        				cur = i;
        				hi--;
        				break;
        			}
        		}
        	}
          travelTo(b);
        }

Compilation message

network.cpp: In function 'void findRoute(int, int, int)':
network.cpp:23:15: warning: this 'if' clause does not guard... [-Wmisleading-indentation]
   23 |               if(i == b)continue;
      |               ^~
network.cpp:24:11: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the 'if'
   24 |           int x = ping(i, b);
      |           ^~~
network.cpp:21:14: warning: 'hi' may be used uninitialized in this function [-Wmaybe-uninitialized]
   21 |          int hi;
      |              ^~
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]
   48 |     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]
   51 |             scanf("%d", &distance[u][v]);
      |             ~~~~~^~~~~~~~~~~~~~~~~~~~~~~
# Verdict Execution time Memory Grader output
1 Execution timed out 1078 ms 4452 KB Time limit exceeded
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Execution timed out 1068 ms 4352 KB Time limit exceeded
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Execution timed out 1079 ms 4452 KB Time limit exceeded
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Execution timed out 1076 ms 4552 KB Time limit exceeded
2 Halted 0 ms 0 KB -