QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#711403#6569. Splitting PairsDjangle162857Compile Error//C++141.4kb2024-11-05 10:35:052024-11-05 10:35:09

Judging History

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

  • [2024-11-05 10:35:09]
  • 评测
  • [2024-11-05 10:35:05]
  • 提交

answer

#define LOCAL
#include <bits/stdc++.h>
#define fir first
#define sec second
#define el '\n'

#ifdef LOCAL
#define FINISH cerr << "FINISH" << endl;
#else
#define FINISH ;
#endif

#ifdef LOCAL
#define debug(x) cerr << setw(4) << #x << " == " << x << endl
#else
#define debug(x)
#endif

#ifdef LOCAL
#define debugv(x)                   \
	cerr << setw(4) << #x << ":: "; \
	for (auto i : x)                \
		cerr << i << " ";           \
	cerr << endl
#else
#define debugv(x)
#endif

using namespace std;
typedef long long ll;
typedef pair<int, int> PII;
ostream& operator<<(ostream& out, PII& x)
{
	out << x.fir << " " << x.sec << endl;
	return out;
}
const int mod = 998244353;
const int inf = 0x3f3f3f3f;
const int N = 200020;
ll lowbit(ll x)
{
	return x & (-x);
}
void solve()
{
	int n;
	cin >> n;
	vector<ll> a(n + 1, 0);
	for (int i = 1; i <= n; i++) {
		cin >> a[i];
	}
	if (n % 2 == 0) {
		int flag = 0;
		for (int i = 1; i <= n; i++) {
			if (a[i] % 2 == 0) {
				flag = 1;
			}
		}
		cout << flag << endl;
	}
	else {
		int mn = inf, flag = 0;
		for (int i = 1; i <= n; i++) {
			mn = min(mn, lowbit(a[i]));
		}
		for (int i = 1; i <= n; i++) {
			a[i] = a[i] / mn;
			if (a[i] % 2 == 0)
				flag = 1;
		}
		cout << flag << endl;
	}
}
int main()
{
	ios::sync_with_stdio(false);
	cin.tie(nullptr);
	cout.tie(nullptr);
	int T = 1;
	cin >> T;
	while (T--) {
		solve();
	}
	return 0;
}

详细

answer.code: In function ‘void solve()’:
answer.code:64:33: error: no matching function for call to ‘min(int&, ll)’
   64 |                         mn = min(mn, lowbit(a[i]));
      |                              ~~~^~~~~~~~~~~~~~~~~~
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:2:
/usr/include/c++/13/bits/stl_algobase.h:233:5: note: candidate: ‘template<class _Tp> constexpr const _Tp& std::min(const _Tp&, const _Tp&)’
  233 |     min(const _Tp& __a, const _Tp& __b)
      |     ^~~
/usr/include/c++/13/bits/stl_algobase.h:233:5: note:   template argument deduction/substitution failed:
answer.code:64:33: note:   deduced conflicting types for parameter ‘const _Tp’ (‘int’ and ‘ll’ {aka ‘long long int’})
   64 |                         mn = min(mn, lowbit(a[i]));
      |                              ~~~^~~~~~~~~~~~~~~~~~
/usr/include/c++/13/bits/stl_algobase.h:281:5: note: candidate: ‘template<class _Tp, class _Compare> constexpr const _Tp& std::min(const _Tp&, const _Tp&, _Compare)’
  281 |     min(const _Tp& __a, const _Tp& __b, _Compare __comp)
      |     ^~~
/usr/include/c++/13/bits/stl_algobase.h:281:5: note:   template argument deduction/substitution failed:
answer.code:64:33: note:   deduced conflicting types for parameter ‘const _Tp’ (‘int’ and ‘ll’ {aka ‘long long int’})
   64 |                         mn = min(mn, lowbit(a[i]));
      |                              ~~~^~~~~~~~~~~~~~~~~~
In file included from /usr/include/c++/13/algorithm:61:
/usr/include/c++/13/bits/stl_algo.h:5775:5: note: candidate: ‘template<class _Tp> constexpr _Tp std::min(initializer_list<_Tp>)’
 5775 |     min(initializer_list<_Tp> __l)
      |     ^~~
/usr/include/c++/13/bits/stl_algo.h:5775:5: note:   template argument deduction/substitution failed:
answer.code:64:33: note:   mismatched types ‘std::initializer_list<_Tp>’ and ‘int’
   64 |                         mn = min(mn, lowbit(a[i]));
      |                              ~~~^~~~~~~~~~~~~~~~~~
/usr/include/c++/13/bits/stl_algo.h:5785:5: note: candidate: ‘template<class _Tp, class _Compare> constexpr _Tp std::min(initializer_list<_Tp>, _Compare)’
 5785 |     min(initializer_list<_Tp> __l, _Compare __comp)
      |     ^~~
/usr/include/c++/13/bits/stl_algo.h:5785:5: note:   template argument deduction/substitution failed:
answer.code:64:33: note:   mismatched types ‘std::initializer_list<_Tp>’ and ‘int’
   64 |                         mn = min(mn, lowbit(a[i]));
      |                              ~~~^~~~~~~~~~~~~~~~~~