| # | Time | Username | Problem | Language | Result | Execution time | Memory |
|---|---|---|---|---|---|---|---|
| 1284512 | lizi14 | Souvenirs (IOI25_souvenirs) | C++20 | Compilation error | 0 ms | 0 KiB |
#include "souvenirs.h"
#include <utility>
#include <vector>
#include <bits/stdc++.h>
using namespace std;
#define int long long
#define f first
#define ss second
void buy_souvenirs(int N, long long P0) {
pair<vector<int>, long long> res = transaction(P0-1);
int a=res.ss;
int ans=P0-1-a;
res=transaction(ans);
return;
}
Compilation message (stderr)
souvenirs.cpp: In function 'void buy_souvenirs(long long int, long long int)':
souvenirs.cpp:10:55: error: conversion from 'pair<vector<int>,[...]>' to non-scalar type 'pair<vector<long long int>,[...]>' requested
10 | pair<vector<int>, long long> res = transaction(P0-1);
| ~~~~~~~~~~~^~~~~~
souvenirs.cpp:13:28: error: no match for 'operator=' (operand types are 'std::pair<std::vector<long long int>, long long int>' and 'std::pair<std::vector<int>, long long int>')
13 | res=transaction(ans);
| ^
In file included from /usr/include/c++/13/utility:69,
from souvenirs.h:1,
from souvenirs.cpp:1:
/usr/include/c++/13/bits/stl_pair.h:439:9: note: candidate: 'template<class _U1, class _U2> constexpr std::pair<_T1, _T2>& std::pair<_T1, _T2>::operator=(const std::pair<_U1, _U2>&) requires _S_assignable<const _U1&, const _U2&>() [with _U2 = _U1; _T1 = std::vector<long long int>; _T2 = long long int]'
439 | operator=(const pair<_U1, _U2>& __p)
| ^~~~~~~~
/usr/include/c++/13/bits/stl_pair.h:439:9: note: template argument deduction/substitution failed:
/usr/include/c++/13/bits/stl_pair.h:439:9: note: constraints not satisfied
/usr/include/c++/13/bits/stl_pair.h: In substitution of 'template<class _U1, class _U2> constexpr std::pair<std::vector<long long int>, long long int>& std::pair<std::vector<long long int>, long long int>::operator=(const std::pair<_T1, _T2>&) requires _S_assignable<const _U1&, const _U2&>() [with _U1 = std::vector<long long int>; _U2 = long long int]':
souvenirs.cpp:13:23: required from here
/usr/include/c++/13/bits/stl_pair.h:439:2: required by the constraints of 'template<class _T1, class _T2> template<class _U1, class _U2> constexpr std::pair<_T1, _T2>& std::pair<_T1, _T2>::operator=(const std::pair<_U1, _U2>&) requires _S_assignable<const _U1&, const _U2&>()'
/usr/include/c++/13/bits/stl_pair.h:441:56: note: the expression '_S_assignable<const _U1&, const _U2&>() [with _T1 = std::vector<long long int, std::allocator<long long int> >; _T2 = long long int; _U1 = std::vector<int, std::allocator<int> >; _U2 = long long int]' evaluated to 'false'
441 | requires (_S_assignable<const _U1&, const _U2&>())
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~
/usr/include/c++/13/bits/stl_pair.h:451:9: note: candidate: 'template<class _U1, class _U2> constexpr std::pair<_T1, _T2>& std::pair<_T1, _T2>::operator=(std::pair<_U1, _U2>&&) requires _S_assignable<_U1, _U2>() [with _U2 = _U1; _T1 = std::vector<long long int>; _T2 = long long int]'
451 | operator=(pair<_U1, _U2>&& __p)
| ^~~~~~~~
/usr/include/c++/13/bits/stl_pair.h:451:9: note: template argument deduction/substitution failed:
/usr/include/c++/13/bits/stl_pair.h:451:9: note: constraints not satisfied
/usr/include/c++/13/bits/stl_pair.h: In substitution of 'template<class _U1, class _U2> constexpr std::pair<std::vector<long long int>, long long int>& std::pair<std::vector<long long int>, long long int>::operator=(std::pair<_T1, _T2>&&) requires _S_assignable<_U1, _U2>() [with _U1 = std::vector<long long int>; _U2 = long long int]':
souvenirs.cpp:13:23: required from here
/usr/include/c++/13/bits/stl_pair.h:451:2: required by the constraints of 'template<class _T1, class _T2> template<class _U1, class _U2> constexpr std::pair<_T1, _T2>& std::pair<_T1, _T2>::operator=(std::pair<_U1, _U2>&&) requires _S_assignable<_U1, _U2>()'
/usr/include/c++/13/bits/stl_pair.h:453:42: note: the expression '_S_assignable<_U1, _U2>() [with _T1 = std::vector<long long int, std::allocator<long long int> >; _T2 = long long int; _U1 = std::vector<int, std::allocator<int> >; _U2 = long long int]' evaluated to 'false'
453 | requires (_S_assignable<_U1, _U2>())
| ~~~~~~~~~~~~~~~~~~~~~~~~^~~
/usr/include/c++/13/bits/stl_pair.h:416:7: note: candidate: 'constexpr std::pair<_T1, _T2>& std::pair<_T1, _T2>::operator=(const std::pair<_T1, _T2>&) requires _S_assignable<const _T1&, const _T2&>() [with _T1 = std::vector<long long int>; _T2 = long long int]'
416 | operator=(const pair& __p)
| ^~~~~~~~
/usr/include/c++/13/bits/stl_pair.h:416:29: note: no known conversion for argument 1 from 'std::pair<std::vector<int>, long long int>' to 'const std::pair<std::vector<long long int>, long long int>&'
416 | operator=(const pair& __p)
| ~~~~~~~~~~~~^~~
/usr/include/c++/13/bits/stl_pair.h:427:7: note: candidate: 'constexpr std::pair<_T1, _T2>& std::pair<_T1, _T2>::operator=(std::pair<_T1, _T2>&&) requires _S_assignable<_T1, _T2>() [with _T1 = std::vector<long long int>; _T2 = long long int]'
427 | operator=(pair&& __p)
| ^~~~~~~~
/usr/include/c++/13/bits/stl_pair.h:427:24: note: no known conversion for argument 1 from 'std::pair<std::vector<int>, long long int>' to 'std::pair<std::vector<long long int>, long long int>&&'
427 | operator=(pair&& __p)
| ~~~~~~~^~~