Submission #1200760

#TimeUsernameProblemLanguageResultExecution timeMemory
1200760mr_junkSwapping Cities (APIO20_swap)C++17
Compilation error
0 ms0 KiB
#include <bits/stdc++.h> /include "stub.h" #define file(s) if (fopen(s".in", "r")) freopen(s".in", "r", stdin), freopen(s".out", "w", stdout) #define int long long using namespace std; const int NN=1e2+60,N=1e6+70,MOD=1e9+7,inf=1e18+7,pr1=420,K=(int)(sqrt(2e5)); int binpow (int num,int pw,int MOD1=MOD){ if (pw==0) return 1; int x=binpow(num,pw/2,MOD1); x=x*x%MOD1; if (pw%2==1) x=x*num%MOD1; return x%MOD1;} vector<pair<int,int>> g[N]; int getMinimumFuelCapacity(int X,int Y){ return -1; } void init(int N,int M,int U[],int V[],int W[]){ for(int i=0;i<M;i++){ g[U[i]].push_back({V[i],W[i]}); g[V[i]].push_back({U[i],W[i]}); }int q; cin>>q; while(q--){ int x,y; cin>>x>>y; cout<<getMinimumFuelCapacity(x,y)<<"\n"; } } void junk(){ int n,m; cin>>n>>m; int u[m],v[m],w[m]; for(int i=0;i<m;i++){ cin>>u[i]>>v[i]>>w[i]; }init(n,m,u,v,w); } signed main(/*ITS OVER ANAKIN. I HAVE A HIGH GROUND*/){//file(""); cin.tie(0)->sync_with_stdio(0); int Test=1;//cin>>Test; while(Test--){junk();} /*YOU UNDERESTIMATE MY POWER*/}

Compilation message (stderr)

swap.cpp:2:1: error: expected unqualified-id before '/' token
    2 | /include "stub.h"
      | ^
swap.cpp:12:1: error: 'vector' does not name a type
   12 | vector<pair<int,int>> g[N];
      | ^~~~~~
swap.cpp: In function 'void init(long long int, long long int, long long int*, long long int*, long long int*)':
swap.cpp:18:17: error: 'g' was not declared in this scope
   18 |                 g[U[i]].push_back({V[i],W[i]});
      |                 ^
swap.cpp:21:9: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
   21 |         cin>>q;
      |         ^~~
      |         std::cin
In file included from /usr/include/x86_64-linux-gnu/c++/11/bits/stdc++.h:75,
                 from swap.cpp:1:
/usr/include/c++/11/iostream:60:18: note: 'std::cin' declared here
   60 |   extern istream cin;           /// Linked to standard input
      |                  ^~~
swap.cpp:25:17: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
   25 |                 cout<<getMinimumFuelCapacity(x,y)<<"\n";
      |                 ^~~~
      |                 std::cout
In file included from /usr/include/x86_64-linux-gnu/c++/11/bits/stdc++.h:75,
                 from swap.cpp:1:
/usr/include/c++/11/iostream:61:18: note: 'std::cout' declared here
   61 |   extern ostream cout;          /// Linked to standard output
      |                  ^~~~
swap.cpp: In function 'void junk()':
swap.cpp:30:9: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
   30 |         cin>>n>>m;
      |         ^~~
      |         std::cin
In file included from /usr/include/x86_64-linux-gnu/c++/11/bits/stdc++.h:75,
                 from swap.cpp:1:
/usr/include/c++/11/iostream:60:18: note: 'std::cin' declared here
   60 |   extern istream cin;           /// Linked to standard input
      |                  ^~~
swap.cpp: In function 'int main()':
swap.cpp:37:1: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
   37 | cin.tie(0)->sync_with_stdio(0);
      | ^~~
      | std::cin
In file included from /usr/include/x86_64-linux-gnu/c++/11/bits/stdc++.h:75,
                 from swap.cpp:1:
/usr/include/c++/11/iostream:60:18: note: 'std::cin' declared here
   60 |   extern istream cin;           /// Linked to standard input
      |                  ^~~