| # | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
|---|---|---|---|---|---|---|---|
| 1170904 | mateuszwes | Meetings (JOI19_meetings) | C++20 | 컴파일 에러 | 0 ms | 0 KiB |
#include "meetings.h"
#include <bits/stdc++.h>
//#include <ext/pb_ds/assoc_container.hpp>
//#include <ext/pb_ds/tree_policy.hpp>
using namespace std;
//using namespace __gnu_pbds;
#define ll long long
#define ull unsigned ll
#define pb push_back
#define pii pair<int,int>
#define pl pair<ll,ll>
#define F first
#define S second
#define pq priority_queue
#define all(x) x.begin(), x.end()
#define deb(x) cout << #x << " = " << x << '\n';
#define deb2(x,y) cout << #x << " = " << x << ", " << #y << " = " << y << '\n';
constexpr int M = 2007;
constexpr bool debug = 0;
int n;
vector<int> adj[M];
map<ll,int> ans;
queue<int> emp;
ll detup(vector<int> ok){
return ok[0]+ok[1]*M+ok[2]*M*M;
}
int Quer(vector<int> ok){
sort(all(ok));
int sus = map[detup(ok)];
if(sus == 0){
sus = Query(ok[0], ok[1], ok[2])+1;
map[detup(ok)] = sus;
}
return sus-1;
}
void DFS(int s, int p, queue<int> sub){
queue<int> osub, csub;
//if(sub.empty()) break;
while(!sub.empty()){
int coc = sub.front();
sub.pop();
while(!sub.empty()){
int x = sub.front();
sub.pop();
int y = Quer({s, coc, x});
if(y == x){
csub.push(coc);
coc = x;
}
else if(y == s){
osub.push(x);
}
else{
csub.push(x);
}
}
Bridge(s,coc);
DFS(coc, s, csub);
csub = emp;
sub = osub;
osub = emp;
}
}
void Solve(int N){
n = N;
queue<int> tot;
for(int i = 1; i < N; i++) tot.push(i);
DFS(0,0, tot);
}
컴파일 시 표준 에러 (stderr) 메시지
meetings.cpp: In function 'int Quer(std::vector<int>)':
meetings.cpp:34:18: error: missing template arguments before '[' token
34 | int sus = map[detup(ok)];
| ^
meetings.cpp:37:18: error: expected ']' before '(' token
37 | map[detup(ok)] = sus;
| ^
| ]
meetings.cpp:37:26: error: class template argument deduction failed:
37 | map[detup(ok)] = sus;
| ^~~
meetings.cpp:37:26: error: no matching function for call to 'map(int&)'
In file included from /usr/include/c++/11/map:61,
from /usr/include/x86_64-linux-gnu/c++/11/bits/stdc++.h:81,
from meetings.cpp:2:
/usr/include/c++/11/bits/stl_map.h:1424:5: note: candidate: 'template<class _InputIterator, class _Compare, class _Allocator, class, class, class> std::map(_InputIterator, _InputIterator, _Compare, _Allocator)-> std::map<typename std::remove_const<typename std::iterator_traits< <template-parameter-1-1> >::value_type::first_type>::type, typename std::iterator_traits< <template-parameter-1-1> >::value_type::second_type, _Compare, _Allocator>'
1424 | map(_InputIterator, _InputIterator,
| ^~~
/usr/include/c++/11/bits/stl_map.h:1424:5: note: template argument deduction/substitution failed:
meetings.cpp:37:26: note: candidate expects 4 arguments, 1 provided
37 | map[detup(ok)] = sus;
| ^~~
In file included from /usr/include/c++/11/map:61,
from /usr/include/x86_64-linux-gnu/c++/11/bits/stdc++.h:81,
from meetings.cpp:2:
/usr/include/c++/11/bits/stl_map.h:1433:5: note: candidate: 'template<class _Key, class _Tp, class _Compare, class _Allocator, class, class> std::map(std::initializer_list<std::pair<_T1, _T2> >, _Compare, _Allocator)-> std::map<_Key, _Tp, _Compare, _Allocator>'
1433 | map(initializer_list<pair<_Key, _Tp>>,
| ^~~
/usr/include/c++/11/bits/stl_map.h:1433:5: note: template argument deduction/substitution failed:
meetings.cpp:37:26: note: mismatched types 'std::initializer_list<std::pair<_T1, _T2> >' and 'int'
37 | map[detup(ok)] = sus;
| ^~~
In file included from /usr/include/c++/11/map:61,
from /usr/include/x86_64-linux-gnu/c++/11/bits/stdc++.h:81,
from meetings.cpp:2:
/usr/include/c++/11/bits/stl_map.h:1440:5: note: candidate: 'template<class _InputIterator, class _Allocator, class, class> std::map(_InputIterator, _InputIterator, _Allocator)-> std::map<typename std::remove_const<typename std::iterator_traits< <template-parameter-1-1> >::value_type::first_type>::type, typename std::iterator_traits< <template-parameter-1-1> >::value_type::second_type, std::less<typename std::remove_const<typename std::iterator_traits< <template-parameter-1-1> >::value_type::first_type>::type>, _Allocator>'
1440 | map(_InputIterator, _InputIterator, _Allocator)
| ^~~
/usr/include/c++/11/bits/stl_map.h:1440:5: note: template argument deduction/substitution failed:
meetings.cpp:37:26: note: candidate expects 3 arguments, 1 provided
37 | map[detup(ok)] = sus;
| ^~~
In file included from /usr/include/c++/11/map:61,
from /usr/include/x86_64-linux-gnu/c++/11/bits/stdc++.h:81,
from meetings.cpp:2:
/usr/include/c++/11/bits/stl_map.h:1446:5: note: candidate: 'template<class _Key, class _Tp, class _Allocator, class> std::map(std::initializer_list<std::pair<_T1, _T2> >, _Allocator)-> std::map<_Key, _Tp, std::less<_Key>, _Allocator>'
1446 | map(initializer_list<pair<_Key, _Tp>>, _Allocator)
| ^~~
/usr/include/c++/11/bits/stl_map.h:1446:5: note: template argument deduction/substitution failed:
meetings.cpp:37:26: note: mismatched types 'std::initializer_list<std::pair<_T1, _T2> >' and 'int'
37 | map[detup(ok)] = sus;
| ^~~
In file included from /usr/include/c++/11/map:61,
from /usr/include/x86_64-linux-gnu/c++/11/bits/stdc++.h:81,
from meetings.cpp:2:
/usr/include/c++/11/bits/stl_map.h:100:11: note: candidate: 'template<class _Key, class _Tp, class _Compare, class _Alloc> map(std::map<_Key, _Tp, _Compare, _Alloc>)-> std::map<_Key, _Tp, _Compare, _Alloc>'
100 | class map
| ^~~
/usr/include/c++/11/bits/stl_map.h:100:11: note: template argument deduction/substitution failed:
meetings.cpp:37:26: note: mismatched types 'std::map<_Key, _Tp, _Compare, _Alloc>' and 'int'
37 | map[detup(ok)] = sus;
| ^~~
In file included from /usr/include/c++/11/map:61,
from /usr/include/x86_64-linux-gnu/c++/11/bits/stdc++.h:81,
from meetings.cpp:2:
/usr/include/c++/11/bits/stl_map.h:185:7: note: candidate: 'template<class _Key, class _Tp, class _Compare, class _Alloc> map()-> std::map<_Key, _Tp, _Compare, _Alloc>'
185 | map() = default;
| ^~~
/usr/include/c++/11/bits/stl_map.h:185:7: note: template argument deduction/substitution failed:
meetings.cpp:37:26: note: candidate expects 0 arguments, 1 provided
37 | map[detup(ok)] = sus;
| ^~~
In file included from /usr/include/c++/11/map:61,
from /usr/include/x86_64-linux-gnu/c++/11/bits/stdc++.h:81,
from meetings.cpp:2:
/usr/include/c++/11/bits/stl_map.h:207:7: note: candidate: 'template<class _Key, class _Tp, class _Compare, class _Alloc> map(const std::map<_Key, _Tp, _Compare, _Allocator>&)-> std::map<_Key, _Tp, _Compare, _Alloc>'
207 | map(const map&) = default;
| ^~~
/usr/include/c++/11/bits/stl_map.h:207:7: note: template argument deduction/substitution failed:
meetings.cpp:37:26: note: mismatched types 'const std::map<_Key, _Tp, _Compare, _Allocator>' and 'int'
37 | map[detup(ok)] = sus;
| ^~~
In file included from /usr/include/c++/11/map:61,
from /usr/include/x86_64-linux-gnu/c++/11/bits/stdc++.h:81,
from meetings.cpp:2:
/usr/include/c++/11/bits/stl_map.h:215:7: note: candidate: 'template<class _Key, class _Tp, class _Compare, class _Alloc> map(std::map<_Key, _Tp, _Compare, _Allocator>&&)-> std::map<_Key, _Tp, _Compare, _Alloc>'
215 | map(map&&) = default;
| ^~~
/usr/include/c++/11/bits/stl_map.h:215:7: note: template argument deduction/substitution failed:
meetings.cpp:37:26: note: mismatched types 'std::map<_Key, _Tp, _Compare, _Allocator>' and 'int'
37 | map[detup(ok)] = sus;
| ^~~
In file included from /usr/include/c++/11/map:61,
from /usr/include/x86_64-linux-gnu/c++/11/bits/stdc++.h:81,
from meetings.cpp:2:
/usr/include/c++/11/bits/stl_map.h:228:7: note: candidate: 'template<class _Key, class _Tp, class _Compare, class _Alloc> map(std::initializer_list<std::pair<const _Key, _Tp> >, const _Compare&, const _Alloc&)-> std::map<_Key, _Tp, _Compare, _Alloc>'
228 | map(initializer_list<value_type> __l,
| ^~~
/usr/include/c++/11/bits/stl_map.h:228:7: note: template argument deduction/substitution failed:
meetings.cpp:37:26: note: mismatched types 'std::initializer_list<std::pair<const _Key, _Tp> >' and 'int'
37 | map[detup(ok)] = sus;
| ^~~
In file included from /usr/include/c++/11/map:61,
from /usr/include/x86_64-linux-gnu/c++/11/bits/stdc++.h:81,
from meetings.cpp:2:
/usr/include/c++/11/bits/stl_map.h:240:7: note: candidate: 'template<class _Key, class _Tp, class _Compare, class _Alloc> map(const std::map<_Key, _Tp, _Compare, _Allocator>&, const _Alloc&)-> std::map<_Key, _Tp, _Compare, _Alloc>'
240 | map(const map& __m, const allocator_type& __a)
| ^~~
/usr/include/c++/11/bits/stl_map.h:240:7: note: template argument deduction/substitution failed:
meetings.cpp:37:26: note: mismatched types 'const std::map<_Key, _Tp, _Compare, _Allocator>' and 'int'
37 | map[detup(ok)] = sus;
| ^~~
In file included from /usr/include/c++/11/map:61,
from /usr/include/x86_64-linux-gnu/c++/11/bits/stdc++.h:81,
from meetings.cpp:2:
/usr/include/c++/11/bits/stl_map.h:244:7: note: candidate: 'template<class _Key, class _Tp, class _Compare, class _Alloc> map(std::map<_Key, _Tp, _Compare, _Allocator>&&, const _Alloc&)-> std::map<_Key, _Tp, _Compare, _Alloc>'
244 | map(map&& __m, const allocator_type& __a)
| ^~~
/usr/include/c++/11/bits/stl_map.h:244:7: note: template argument deduction/substitution failed:
meetings.cpp:37:26: note: mismatched types 'std::map<_Key, _Tp, _Compare, _Allocator>' and 'int'
37 | map[detup(ok)] = sus;
| ^~~
In file included from /usr/include/c++/11/map:61,
from /usr/include/x86_64-linux-gnu/c++/11/bits/stdc++.h:81,
from meetings.cpp:2:
/usr/include/c++/11/bits/stl_map.h:250:7: note: candidate: 'template<class _Key, class _Tp, class _Compare, class _Alloc> map(std::initializer_list<std::pair<const _Key, _Tp> >, const _Alloc&)-> std::map<_Key, _Tp, _Compare, _Alloc>'
250 | map(initializer_list<value_type> __l, const allocator_type& __a)
| ^~~
/usr/include/c++/11/bits/stl_map.h:250:7: note: template argument deduction/substitution failed:
meetings.cpp:37:26: note: mismatched types 'std::initializer_list<std::pair<const _Key, _Tp> >' and 'int'
37 | map[detup(ok)] = sus;
| ^~~
In file included from /usr/include/c++/11/map:61,
from /usr/include/x86_64-linux-gnu/c++/11/bits/stdc++.h:81,
from meetings.cpp:2:
/usr/include/c++/11/bits/stl_map.h:256:9: note: candidate: 'template<class _Key, class _Tp, class _Compare, class _Alloc, class _InputIterator> map(_InputIterator, _InputIterator, const _Alloc&)-> std::map<_Key, _Tp, _Compare, _Alloc>'
256 | map(_InputIterator __first, _InputIterator __last,
| ^~~
/usr/include/c++/11/bits/stl_map.h:256:9: note: template argument deduction/substitution failed:
meetings.cpp:37:26: note: candidate expects 3 arguments, 1 provided
37 | map[detup(ok)] = sus;
| ^~~
In file included from /usr/include/c++/11/map:61,
from /usr/include/x86_64-linux-gnu/c++/11/bits/stdc++.h:81,
from meetings.cpp:2:
/usr/include/c++/11/bits/stl_map.h:273:9: note: candidate: 'template<class _Key, class _Tp, class _Compare, class _Alloc, class _InputIterator> map(_InputIterator, _InputIterator)-> std::map<_Key, _Tp, _Compare, _Alloc>'
273 | map(_InputIterator __first, _InputIterator __last)
| ^~~
/usr/include/c++/11/bits/stl_map.h:273:9: note: template argument deduction/substitution failed:
meetings.cpp:37:26: note: candidate expects 2 arguments, 1 provided
37 | map[detup(ok)] = sus;
| ^~~
In file included from /usr/include/c++/11/map:61,
from /usr/include/x86_64-linux-gnu/c++/11/bits/stdc++.h:81,
from meetings.cpp:2:
/usr/include/c++/11/bits/stl_map.h:290:9: note: candidate: 'template<class _Key, class _Tp, class _Compare, class _Alloc, class _InputIterator> map(_InputIterator, _InputIterator, const _Compare&, const _Alloc&)-> std::map<_Key, _Tp, _Compare, _Alloc>'
290 | map(_InputIterator __first, _InputIterator __last,
| ^~~
/usr/include/c++/11/bits/stl_map.h:290:9: note: template argument deduction/substitution failed:
meetings.cpp:37:26: note: candidate expects 4 arguments, 1 provided
37 | map[detup(ok)] = sus;
| ^~~
meetings.cpp:37:26: note: explicit deduction guides not considered for copy-initialization