QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#687531#9220. Bus AnalysiswangjunruiCompile Error//C++141.3kb2024-10-29 19:31:082024-10-29 19:31:08

Judging History

你现在查看的是最新测评结果

  • [2024-10-29 19:31:08]
  • 评测
  • [2024-10-29 19:31:08]
  • 提交

answer

#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#define int ll
using namespace std;
typedef long long ll;
constexpr int N = 1005, M = 1e4 + 5;
constexpr int mod = 998244353;
int n, a[N];
int power[N];
tuple<int, int, int> p[M];
int mp[83][83][83];
int tot;
int buf[2][M];
signed main()
{
	ios::sync_with_stdio(false);
	cin.tie(0), cout.tie(0);
	cin >> n;
	for (int i = 1; i <= n; ++i)
		cin >> a[i];
	for (int i = 0; i <= 75; ++i)
		for (int j = i + 20; j <= 75; ++j)
			for (int k = j + 20; k <= 75; ++k)
				p[mp[i][j][k] = tot++] = make_tuple(i, j, k);
	auto f = buf[0], g = buf[1];
	f[0] = 1;
	ll ans = 0;
	power[0] = 1;
	for (int i = 1; i <= n; ++i)
		power[i] = power[i - 1] * 2 % mod;
	for (int i = 1; i <= n; ++i)
	{
		swap(f, g);
		memset(f, 0, sizeof(buf[0]));
		for (int j = 0; j < tot; ++j)
		{
			if (!g[j])
				continue;
			int x = max(0, get<0>(p[j]) - a[i] + a[i - 1]), y = max(0, get<1>(p[j]) - a[i] + a[i - 1]), z = max(0, get<2>(p[j]) - a[i] + a[i - 1]);
			y = max(y, x + 20);
			z = max(z, y + 20);
			int r = max(z + 20, x + 75);
			(f[mp[x][y][z]] += g[j]) %= mod;
			if (!x)
			{
				(f[mp[y][z][r]] += g[j]) %= mod;
				(ans += (ll)g[j] * power[n - i]) %= mod;
			}
			else
				(f[mp[x][y][z]] += g[j]) %= mod;
		}
	}
	cout << ans * 2 % mod << '\n';
	return 0;
}

詳細信息

answer.code: In function ‘int main()’:
answer.code:39:36: error: no matching function for call to ‘max(int, std::__tuple_element_t<0, std::tuple<long long int, long long int, long long int> >)’
   39 |                         int x = max(0, get<0>(p[j]) - a[i] + a[i - 1]), y = max(0, get<1>(p[j]) - a[i] + a[i - 1]), z = max(0, get<2>(p[j]) - a[i] + a[i - 1]);
      |                                 ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /usr/include/c++/13/algorithm:60,
                 from /usr/include/x86_64-linux-gnu/c++/13/bits/stdc++.h:51,
                 from answer.code:1:
/usr/include/c++/13/bits/stl_algobase.h:257:5: note: candidate: ‘template<class _Tp> constexpr const _Tp& std::max(const _Tp&, const _Tp&)’
  257 |     max(const _Tp& __a, const _Tp& __b)
      |     ^~~
/usr/include/c++/13/bits/stl_algobase.h:257:5: note:   template argument deduction/substitution failed:
answer.code:39:36: note:   deduced conflicting types for parameter ‘const _Tp’ (‘int’ and ‘std::__tuple_element_t<0, std::tuple<long long int, long long int, long long int> >’ {aka ‘long long int’})
   39 |                         int x = max(0, get<0>(p[j]) - a[i] + a[i - 1]), y = max(0, get<1>(p[j]) - a[i] + a[i - 1]), z = max(0, get<2>(p[j]) - a[i] + a[i - 1]);
      |                                 ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/13/bits/stl_algobase.h:303:5: note: candidate: ‘template<class _Tp, class _Compare> constexpr const _Tp& std::max(const _Tp&, const _Tp&, _Compare)’
  303 |     max(const _Tp& __a, const _Tp& __b, _Compare __comp)
      |     ^~~
/usr/include/c++/13/bits/stl_algobase.h:303:5: note:   template argument deduction/substitution failed:
answer.code:39:36: note:   deduced conflicting types for parameter ‘const _Tp’ (‘int’ and ‘std::__tuple_element_t<0, std::tuple<long long int, long long int, long long int> >’ {aka ‘long long int’})
   39 |                         int x = max(0, get<0>(p[j]) - a[i] + a[i - 1]), y = max(0, get<1>(p[j]) - a[i] + a[i - 1]), z = max(0, get<2>(p[j]) - a[i] + a[i - 1]);
      |                                 ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /usr/include/c++/13/algorithm:61:
/usr/include/c++/13/bits/stl_algo.h:5795:5: note: candidate: ‘template<class _Tp> constexpr _Tp std::max(initializer_list<_Tp>)’
 5795 |     max(initializer_list<_Tp> __l)
      |     ^~~
/usr/include/c++/13/bits/stl_algo.h:5795:5: note:   template argument deduction/substitution failed:
answer.code:39:36: note:   mismatched types ‘std::initializer_list<_Tp>’ and ‘int’
   39 |                         int x = max(0, get<0>(p[j]) - a[i] + a[i - 1]), y = max(0, get<1>(p[j]) - a[i] + a[i - 1]), z = max(0, get<2>(p[j]) - a[i] + a[i - 1]);
      |                                 ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/13/bits/stl_algo.h:5805:5: note: candidate: ‘template<class _Tp, class _Compare> constexpr _Tp std::max(initializer_list<_Tp>, _Compare)’
 5805 |     max(initializer_list<_Tp> __l, _Compare __comp)
      |     ^~~
/usr/include/c++/13/bits/stl_algo.h:5805:5: note:   template argument deduction/substitution failed:
answer.code:39:36: note:   mismatched types ‘std::initializer_list<_Tp>’ and ‘int’
   39 |                         int x = max(0, get<0>(p[j]) - a[i] + a[i - 1]), y = max(0, get<1>(p[j]) - a[i] + a[i - 1]), z = max(0, get<2>(p[j]) - a[i] + a[i - 1]);
      |                                 ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
answer.code:40:25: error: ‘y’ was not declared in this scope
   40 |                         y = max(y, x + 20);
      |                         ^
answer.code:41:25: error: ‘z’ was not declared in this scope
   41 |                         z = max(z, y + 20);
      |                         ^