Problem railway
User goose
Submission Time 2026-09-26 15:38:29
Score 0
Max Time N/A
Max Memory N/A

Compile Error

railway.cpp:7:17: error: wrong number of template arguments (1, should be at least 2)
7 | map<pair<int,int>> mem;
| ^~
In file included from /usr/include/c++/9/map:61,
from /usr/include/x86_64-linux-gnu/c++/9/bits/stdc++.h:81,
from railway.cpp:1:
/usr/include/c++/9/bits/stl_map.h:100:11: note: provided for ‘template<class _Key, class _Tp, class _Compare, class _Alloc> class std::map’
100 | class map
| ^~~
railway.cpp: In function ‘long long int lca(long long int, long long int)’:
railway.cpp:22:15: error: invalid types ‘int[<brace-enclosed initializer list>]’ for array subscript
22 | if (mem[{x,y}] != 0) {
| ^
railway.cpp:23:19: error: invalid types ‘int[<brace-enclosed initializer list>]’ for array subscript
23 | return mem[{x,y}];
| ^
railway.cpp:41:18: error: invalid types