Submission #216931

#TimeUsernameProblemLanguageResultExecution timeMemory
216931rajarshi_basuComputer Network (BOI14_network)C++14
Compilation error
0 ms0 KiB
#include <iostream> #include <iomanip> #include <stdio.h> #include <string> #include <cmath> #include "network.h" #define FOR(i,n) for(int i=0;i<n;i++) #define FORE(i,a,b) for(int i=a;i<=b;i++) #define ll long long int #define ld long double #define vi vector<int> #define pb push_back #define ff first #define ss second #define ii pair<int,int> #define iii pair<int,ii> #define vv vector using namespace std; const int MAXN = 1001; vector<int> dists[MAXN]; void findRoute(int n,int a,int b){ int dist = ping(a,b); FORE(i,1,n){ if(i == a or i == b)continue; dists[ping(i,b)].pb(i); } vi inters; int currNode = a; for(int d = dist-1;d>=0;d--){ for(auto e: dists[d]){ int v = ping(currNode,e); if(d + v + 1 == dist){ currNode = e; inters.pb(e); break; } } } inters.pb(b); for(auto e : inters){ travelTo(e); } }

Compilation message (stderr)

network.cpp:24:1: error: 'vector' does not name a type; did you mean 'perror'?
 vector<int> dists[MAXN];
 ^~~~~~
 perror
network.cpp: In function 'void findRoute(int, int, int)':
network.cpp:29:9: error: 'dists' was not declared in this scope
         dists[ping(i,b)].pb(i);
         ^~~~~
network.cpp:29:9: note: suggested alternative: 'dist'
         dists[ping(i,b)].pb(i);
         ^~~~~
         dist
network.cpp:13:12: error: 'vector' was not declared in this scope
 #define vi vector<int>
            ^
network.cpp:31:5: note: in expansion of macro 'vi'
     vi inters;
     ^~
network.cpp:13:12: note: suggested alternative: 'perror'
 #define vi vector<int>
            ^
network.cpp:31:5: note: in expansion of macro 'vi'
     vi inters;
     ^~
network.cpp:13:19: error: expected primary-expression before 'int'
 #define vi vector<int>
                   ^
network.cpp:31:5: note: in expansion of macro 'vi'
     vi inters;
     ^~
network.cpp:35:21: error: 'dists' was not declared in this scope
         for(auto e: dists[d]){
                     ^~~~~
network.cpp:35:21: note: suggested alternative: 'dist'
         for(auto e: dists[d]){
                     ^~~~~
                     dist
network.cpp:39:17: error: 'inters' was not declared in this scope
                 inters.pb(e);
                 ^~~~~~
network.cpp:39:17: note: suggested alternative: 'int8_t'
                 inters.pb(e);
                 ^~~~~~
                 int8_t
network.cpp:44:5: error: 'inters' was not declared in this scope
     inters.pb(b);
     ^~~~~~
network.cpp:44:5: note: suggested alternative: 'int8_t'
     inters.pb(b);
     ^~~~~~
     int8_t
network.cpp:45:18: error: unable to deduce 'auto&&' from 'inters'
     for(auto e : inters){
                  ^~~~~~
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]);
             ~~~~~^~~~~~~~~~~~~~~~~~~~~~~