Submission #733352

# Submission time Handle Problem Language Result Execution time Memory
733352 2023-04-30T14:15:55 Z Trunkty Computer Network (BOI14_network) C++14
100 / 100
115 ms 8012 KB
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
//#define int ll

#include "network.h"

int arr[1005];
vector<int> dist[1005];

void findRoute(int n, int a, int b){
    for(int i=1;i<=n;i++){
        if(i!=b){
            arr[i] = ping(b,i);
            dist[arr[i]].push_back(i);
        }
    }
    dist[0].push_back(b);
    for(int i=arr[a]-1;i>=0;i--){
        for(int j:dist[i]){
            if(ping(a,j)==0){
                a = j;
                travelTo(j);
                break;
            }
        }
    }
    travelTo(b);
}

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]
   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 Correct 75 ms 8012 KB Output is correct
2 Correct 82 ms 7432 KB Output is correct
3 Correct 82 ms 6944 KB Output is correct
4 Correct 75 ms 7040 KB Output is correct
5 Correct 72 ms 6732 KB Output is correct
6 Correct 74 ms 6624 KB Output is correct
7 Correct 0 ms 340 KB Output is correct
8 Correct 1 ms 340 KB Output is correct
9 Correct 1 ms 340 KB Output is correct
10 Correct 1 ms 340 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 79 ms 6648 KB Output is correct
2 Correct 20 ms 2780 KB Output is correct
3 Correct 82 ms 7804 KB Output is correct
4 Correct 89 ms 6188 KB Output is correct
5 Correct 79 ms 7892 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 79 ms 6712 KB Output is correct
2 Correct 20 ms 2824 KB Output is correct
3 Correct 83 ms 7824 KB Output is correct
4 Correct 115 ms 6132 KB Output is correct
5 Correct 85 ms 7884 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 75 ms 6672 KB Output is correct
2 Correct 18 ms 2772 KB Output is correct
3 Correct 85 ms 7796 KB Output is correct
4 Correct 71 ms 6208 KB Output is correct
5 Correct 79 ms 7980 KB Output is correct