QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#34770#4251. Gamewilly108#Compile Error//C++201.9kb2022-06-12 07:07:222024-05-26 00:56:03

Judging History

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

  • [2024-05-26 00:56:03]
  • 评测
  • [2023-08-10 23:21:45]
  • System Update: QOJ starts to keep a history of the judgings of all the submissions.
  • [2022-06-12 07:07:22]
  • 提交

answer


#include "game.h"
//apio 2022 game

//misaka will carry me to master
#include <iostream>
#include <cstdio>
#include <cstring>
#include <cmath>
#include <utility>
#include <cassert>
#include <algorithm>
#include <vector>
#include <functional>
#include <numeric>
#include <set>
#include <map>
#include <bitset>

#define ll long long
#define lb long double
#define sz(vec) ((int)(vec.size()))
#define all(x) x.begin(), x.end()
#define pb push_back
#define mp make_pair
#define kill(x, s) {int COND = x; if(COND){ cout << s << "\n"; return ; }}

const lb eps = 1e-9;
const ll mod = 1e9 + 7, ll_max = 1e18;
//const ll mod = (1 << (23)) * 119 +1, ll_max = 1e18;
const int MX = 3e4+10, int_max = 0x3f3f3f3f;

struct {
  template<class T>
  operator T() {
    T x; std::cin >> x; return x;
  }
} in;

using namespace std;

const int KK = 1e3+10;
int n, k;
bitset<KK> reach[MX];
bitset<MX> qq;

//hi is the largest node that can reach u
//lo is the smallest node u can reach
//if hi[u] >= lo[u] there is a cycle

void init(int _n, int _k){
	n = _n, k = _k;
	for(int i = k-2; i>=0; i--){
		reach[i][i+1] = 1;
		reach[i] |= reach[i+1];
	}
}

int add_teleporter(int a, int b){
	if(a == b && a < k) return 1;
	if(a < k && b < k && b < a) return 1;
	reach[a][b] = 1;
	reach[a] |= reach[b];
	for(int i = 0; i<n; i++){
		if(reach[i][a]){
			reach[i] |= reach[b];
			reach[i][b] = 1;
		}
	}
	qq.reset();
	for(int i = 0; i<k; i++){
		qq[i] = 1;
		if((qq&reach[i]).count()) return 1;
	}
	return 0;
}

/**
void solve(){
	int n = in, m = in, k = in;
	init(n, k);
	for(int i = 1; i<=m; i++){
		int a = in, b = in;
		if(add_teleporter(a, b)) exit(0);
		cerr << i << "\n";
	}
}

int main(){
  cin.tie(0) -> sync_with_stdio(0);

  int T = 1;
  //cin >> T;
  for(int i = 1; i<=T; i++){
		solve();
	}
  return 0;
}

**/



Details

answer.code: In function ‘int add_teleporter(int, int)’:
answer.code:73:23: error: no match for ‘operator&’ (operand types are ‘std::bitset<30010>’ and ‘std::bitset<1010>’)
   73 |                 if((qq&reach[i]).count()) return 1;
      |                     ~~^~~~~~~~~
      |                     |         |
      |                     |         bitset<1010>
      |                     bitset<30010>
In file included from answer.code:18:
/usr/include/c++/13/bitset:1553:5: note: candidate: ‘template<long unsigned int _Nb> std::bitset<_Nb> std::operator&(const bitset<_Nb>&, const bitset<_Nb>&)’
 1553 |     operator&(const bitset<_Nb>& __x, const bitset<_Nb>& __y) _GLIBCXX_NOEXCEPT
      |     ^~~~~~~~
/usr/include/c++/13/bitset:1553:5: note:   template argument deduction/substitution failed:
answer.code:73:31: note:   deduced conflicting values for non-type parameter ‘_Nb’ (‘30010’ and ‘1010’)
   73 |                 if((qq&reach[i]).count()) return 1;
      |                               ^
In file included from /usr/include/c++/13/bits/memory_resource.h:38,
                 from /usr/include/c++/13/string:58,
                 from /usr/include/c++/13/bits/locale_classes.h:40,
                 from /usr/include/c++/13/bits/ios_base.h:41,
                 from /usr/include/c++/13/ios:44,
                 from /usr/include/c++/13/ostream:40,
                 from /usr/include/c++/13/iostream:41,
                 from answer.code:6:
/usr/include/c++/13/cstddef:140:3: note: candidate: ‘constexpr std::byte std::operator&(byte, byte)’
  140 |   operator&(byte __l, byte __r) noexcept
      |   ^~~~~~~~
/usr/include/c++/13/cstddef:140:18: note:   no known conversion for argument 1 from ‘std::bitset<30010>’ to ‘std::byte’
  140 |   operator&(byte __l, byte __r) noexcept
      |             ~~~~~^~~
/usr/include/c++/13/bits/ios_base.h:83:3: note: candidate: ‘constexpr std::_Ios_Fmtflags std::operator&(_Ios_Fmtflags, _Ios_Fmtflags)’
   83 |   operator&(_Ios_Fmtflags __a, _Ios_Fmtflags __b)
      |   ^~~~~~~~
/usr/include/c++/13/bits/ios_base.h:83:27: note:   no known conversion for argument 1 from ‘std::bitset<30010>’ to ‘std::_Ios_Fmtflags’
   83 |   operator&(_Ios_Fmtflags __a, _Ios_Fmtflags __b)
      |             ~~~~~~~~~~~~~~^~~
/usr/include/c++/13/bits/ios_base.h:126:3: note: candidate: ‘constexpr std::_Ios_Openmode std::operator&(_Ios_Openmode, _Ios_Openmode)’
  126 |   operator&(_Ios_Openmode __a, _Ios_Openmode __b)
      |   ^~~~~~~~
/usr/include/c++/13/bits/ios_base.h:126:27: note:   no known conversion for argument 1 from ‘std::bitset<30010>’ to ‘std::_Ios_Openmode’
  126 |   operator&(_Ios_Openmode __a, _Ios_Openmode __b)
      |             ~~~~~~~~~~~~~~^~~
/usr/include/c++/13/bits/ios_base.h:166:3: note: candidate: ‘constexpr std::_Ios_Iostate std::operator&(_Ios_Iostate, _Ios_Iostate)’
  166 |   operator&(_Ios_Iostate __a, _Ios_Iostate __b)
      |   ^~~~~~~~
/usr/include/c++/13/bits/ios_base.h:166:26: note:   no known conversion for argument 1 from ‘std::bitset<30010>’ to ‘std::_Ios_Iostate’
  166 |   operator&(_Ios_Iostate __a, _Ios_Iostate __b)
      |             ~~~~~~~~~~~~~^~~