Submission #991850

#TimeUsernameProblemLanguageResultExecution timeMemory
991850simona1230Airline Route Map (JOI18_airline)C++17
Compilation error
0 ms0 KiB
#include <bits/stdc++.h> #include "Alicelib.h" using namespace std; void Alice(int n,int m,int a[],int b[]) { vector<pair<int,int> > v; int l[1024]; int num=0; for(int i=0;i<n;i++) { int cnt=i+3; l[i]=num; for(int j=1;j<cnt;j++) { v.push_back({num,num+1}); num++; } v.push_back({num,num-cnt+1}); num++; v.push_back({l[i],num}); l[i]=num; } for(int i=0;i<m;i++) { v.push_back({l[a[i]],l[b[i]]}); } InitG(num,v.size()); for(int i=0;i<v.size();i++) { MakeG(i,v[i].first,v[i].second); } }
#include <bits/stdc++.h> #include "Boblib.h" using namespace std; int x[100001],y[100001]; vector<int> e[100001]; int used[100001]; int l[100001]; int maxx=0; void dfs(int i,int c,int bg,int p) { used[i]=1; for(int j=0;j<e[i].size();j++) { int nb=e[i][j]; if(e[nb].size()==2&&nb!=p)dfs(nb,c+1,bg,i); else { maxx=max(maxx,c-2); for(int k=0;k<v[bg].size();k++) { if(!used[v[bg][i]]) l[v[nb][i]]=c-2; } } } } void Bob(int v,int u,int c[],int d[]) { for(int i=0;i<u;i++) { e[c[i]].push_back(d[i]); e[d[i]].push_back(c[i]); } for(int i=0;i<v;i++) { if(e[i].size()==3)dfs(i,1,i,-1); } for(int i=0;i<u;i++) { if(l[c[i]]&&l[d[i]]) ans.push_back({l[c[i]]-1,l[d[i]]-1}); } InitMap(maxx,ans.size()); for(int i=0;i<ans.size();i++) MakeMap(ans[i].first,ans[i].second); }

Compilation message (stderr)

Alice.cpp: In function 'void Alice(int, int, int*, int*)':
Alice.cpp:38:18: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<std::pair<int, int> >::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   38 |     for(int i=0;i<v.size();i++)
      |                 ~^~~~~~~~~

Bob.cpp: In function 'void dfs(int, int, int, int)':
Bob.cpp:14:18: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   14 |     for(int j=0;j<e[i].size();j++)
      |                 ~^~~~~~~~~~~~
Bob.cpp:21:27: error: 'v' was not declared in this scope
   21 |             for(int k=0;k<v[bg].size();k++)
      |                           ^
Bob.cpp: In function 'void Bob(int, int, int*, int*)':
Bob.cpp:46:13: error: 'ans' was not declared in this scope; did you mean 'abs'?
   46 |             ans.push_back({l[c[i]]-1,l[d[i]]-1});
      |             ^~~
      |             abs
Bob.cpp:49:18: error: 'ans' was not declared in this scope; did you mean 'abs'?
   49 |     InitMap(maxx,ans.size());
      |                  ^~~
      |                  abs