5023 | 2023-04-09 22:07:03 | zsombor | Misztikus táblázat | cpp17 | Compilation error |
#include <iostream>
#include <vector>
using namespace std;
using ll = long long;
ll n, s, o, a, MOD = 1e9 + 7, ans = 1;
vector <vector <ll>> dp(2001, vector <int>(2001, 0));
vector <vector <bool>> b(2001, vector <bool>(2001, false));
int main()
{
ios_base::sync_with_stdio(false);
cin.tie(NULL);
cin >> n >> s >> o;
dp[0][0] = 1;
for (int i = 1; i <= n; i++) {
dp[i][0] = (dp[i - 1][0] * i) % MOD;
for (int j = 1; j <= i; j++) {
dp[i][j] = (MOD + dp[i][j - 1] - dp[i - 1][j - 1]) % MOD;
}
}
fill(b[0].begin(), b[0].end(), true);
for (int i = 1; i <= s; i++) {
for (int j = 0; j < o; j++) {
cin >> a;
b[i][a] = true;
}
a = 0;
for (int j = 1; j <= n; j++) if (!b[i][j] && !b[i - 1][j]) a++;
ans *= dp[n - o][a];
ans %= MOD;
}
for (int i = 0; i < n - s; i++) {
ans *= dp[n][n];
ans %= MOD;
}
cout << ans;
}
exit status 1
main.cpp:7:52: error: no matching function for call to 'std::vector<std::vector<long long int> >::vector(int, std::vector<int>)'
7 | vector <vector <ll>> dp(2001, vector <int>(2001, 0));
| ^
In file included from /usr/include/c++/11/vector:67,
from main.cpp:2:
/usr/include/c++/11/bits/stl_vector.h:653:9: note: candidate: 'template<class _InputIterator, class> std::vector<_Tp, _Alloc>::vector(_InputIterator, _InputIterator, const allocator_type&) [with _InputIterator = _InputIterator; <template-parameter-2-2> = <template-parameter-1-2>; _Tp = std::vector<long long int>; _Alloc = std::allocator<std::vector<long long int> >]'
653 | vector(_InputIterator __first, _InputIterator __last,
| ^~~~~~
/usr/include/c++/11/bits/stl_vector.h:653:9: note: template argument deduction/substitution failed:
main.cpp:7:52: note: deduced conflicting types for parameter '_InputIterator' ('int' and 'std::vector<int>')
7 | ...