| # | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
|---|---|---|---|---|---|---|---|
| 1098387 | 2024-10-09 10:58:56 | MMihalev | Highway Tolls (IOI18_highway) | C++14 | Compilation error | 0 ms | 0 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
#include "highway.h"
#include<iostream>
#include<algorithm>
#include<vector>
using namespace std;
const int MAX_N=1e5+5;
int n,m;
vector<int>w;
vector<pair<int,int> >g[MAX_N];
long long edges,cost;
int root;
int a,b;
int parent[MAX_N];
int paredge[MAX_N];
int depth[MAX_N];
vector<int>leaves;
vector<int>ends;
void initdfs(int u,int par)
{
parent[u]=par;
for(auto [v,edge] : g[u])
{
if(v==par)continue;
depth[v]=depth[u]+1;
paredge[v]=edge;
initdfs(v,u);
}
}
int onpath(int l,int r)
{
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
Compilation message (stderr)
highway.cpp: In function 'void initdfs(int, int)':
highway.cpp:21:14: warning: structured bindings only available with '-std=c++17' or '-std=gnu++17'
21 | for(auto [v,edge] : g[u])
| ^
highway.cpp: In function 'int onpath(int, int)':
highway.cpp:36:18: warning: structured bindings only available with '-std=c++17' or '-std=gnu++17'
36 | for(auto [v,edge]:g[u])
| ^
highway.cpp:44:18: warning: structured bindings only available with '-std=c++17' or '-std=gnu++17'
44 | for(auto [v,edge]:g[u])
| ^
highway.cpp: In function 'void markdfs(int, bool)':
highway.cpp:59:14: warning: structured bindings only available with '-std=c++17' or '-std=gnu++17'
59 | for(auto [v,edge]:g[u])
| ^
highway.cpp: In function 'void leavesdfs(int)':
highway.cpp:67:14: warning: structured bindings only available with '-std=c++17' or '-std=gnu++17'
67 | for(auto [v,edge]:g[u])
| ^
highway.cpp:73:15: error: expected ')' before 'g'
73 | if(u!=root g[u].size()==1)leaves.push_back(u);
| ~ ^~
| )
highway.cpp: In function 'void solve(int, int, int)':
highway.cpp:117:5: error: reference to 'ends' is ambiguous
117 | ends.push_back(rec(0,leaves.size()-1,cnt));
| ^~~~
In file included from /usr/include/c++/10/iostream:39,
from highway.cpp:2:
/usr/include/c++/10/ostream:693:5: note: candidates are: 'template<class _CharT, class _Traits> std::basic_ostream<_CharT, _Traits>& std::ends(std::basic_ostream<_CharT, _Traits>&)'
693 | ends(basic_ostream<_CharT, _Traits>& __os)
| ^~~~
highway.cpp:17:12: note: 'std::vector<int> ends'
17 | vector<int>ends;
| ^~~~
highway.cpp: In function 'void find_pair(int, std::vector<int>, std::vector<int>, int, int)':
highway.cpp:164: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]
164 | for(int i=0;i<g[root].size();i++)
| ~^~~~~~~~~~~~~~~
highway.cpp:170: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]
170 | for(int i=0;i<g[root].size();i++)
| ~^~~~~~~~~~~~~~~
highway.cpp:177:9: error: reference to 'ends' is ambiguous
177 | ends.push_back(root);
| ^~~~
In file included from /usr/include/c++/10/iostream:39,
from highway.cpp:2:
/usr/include/c++/10/ostream:693:5: note: candidates are: 'template<class _CharT, class _Traits> std::basic_ostream<_CharT, _Traits>& std::ends(std::basic_ostream<_CharT, _Traits>&)'
693 | ends(basic_ostream<_CharT, _Traits>& __os)
| ^~~~
highway.cpp:17:12: note: 'std::vector<int> ends'
17 | vector<int>ends;
| ^~~~
highway.cpp:185:12: error: reference to 'ends' is ambiguous
185 | answer(ends[0],ends[1]);
| ^~~~
In file included from /usr/include/c++/10/iostream:39,
from highway.cpp:2:
/usr/include/c++/10/ostream:693:5: note: candidates are: 'template<class _CharT, class _Traits> std::basic_ostream<_CharT, _Traits>& std::ends(std::basic_ostream<_CharT, _Traits>&)'
693 | ends(basic_ostream<_CharT, _Traits>& __os)
| ^~~~
highway.cpp:17:12: note: 'std::vector<int> ends'
17 | vector<int>ends;
| ^~~~
highway.cpp:185:20: error: reference to 'ends' is ambiguous
185 | answer(ends[0],ends[1]);
| ^~~~
In file included from /usr/include/c++/10/iostream:39,
from highway.cpp:2:
/usr/include/c++/10/ostream:693:5: note: candidates are: 'template<class _CharT, class _Traits> std::basic_ostream<_CharT, _Traits>& std::ends(std::basic_ostream<_CharT, _Traits>&)'
693 | ends(basic_ostream<_CharT, _Traits>& __os)
| ^~~~
highway.cpp:17:12: note: 'std::vector<int> ends'
17 | vector<int>ends;
| ^~~~