QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#386852#5108. Prehistoric ProgramsPetroTarnavskyi#Compile Error//C++201.7kb2024-04-11 20:41:462024-04-11 20:41:47

Judging History

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

  • [2024-04-11 20:41:47]
  • 评测
  • [2024-04-11 20:41:46]
  • 提交

answer

#include <bits/stdc++.h> 

using namespace std;

#define FOR(i, a, b) for(int i = (a); i < (b); i++)
#define RFOR(i, a, b) for(int i = (a) - 1; i >= (b); i--)
#define SZ(a) int(a.size())
#define ALL(a) a.begin(), a.end()
#define PB push_back
#define MP make_pair
#define F first
#define S second

typedef long long LL;
typedef vector<int> VI;
typedef pair<int, int> PII;
typedef double db;


const int N = 47;
PII w[N];
unordered_set<PII> v[N];

const int N2 = 1047;
int a[N2][N2];
bool used[N2][N2];
int k;
int m, n;

bool ok(int x, int y)
{
	return 0 <= x && x < m && 0 <= y && y < n; 
}

void dfs(int x, int y)
{
	used[y][x] = true;
	FOR (i, 0, k)
	{
		if (!v[i].count({y, x}))
		{
			int nx = x - w[i].F;
			int ny = y - w[i].S;
			assert(ok(nx, ny));
			assert(a[ny][nx] != 0);
			if (!used[ny][nx])
			{
				a[ny][nx] = 1;
				dfs(ny, nx);
			}
		}
		else
		{
			int nx = x - w[i].F;
			int ny = y - w[i].S;
			assert(a[ny][nx] != 1);			
			if (ok(nx, ny) && !used[ny][nx])
			{
				a[ny][nx] = 0;
				dfs(ny, nx);
			}
		}
	}
}

int main()
{
	ios::sync_with_stdio(0);
	cin.tie(0);
	
	FOR (i, 0, N2) fill(a[i], a[i] + N2, -1);
	
	cin >> m >> n;
	cin >> k;
	FOR (i, 0, k)
	{
		cin >> w[i].S >> w[i].F;
		int sz;
		cin >> sz;
		FOR (j, 0, sz)
		{
			int x, y;
			cin >> x >> y;
			x--;
			y--;
			a[y][x] = 1
			v[i].insert({y, x});
		}
	}
	FOR (i, 0, n)
	{
		FOR (j, 0, m)
		{
			if (!used[i][j] && a[i][j] != -1)
			{
				dfs(i, j);
			}
		}
	}
	int mxdx = -N2, mndx = N2, mxdy = -N2, mndy = N2;
	FOR (i, 0, k)
	{
		mxdx = max(mxdx, w[i].F);
		mxdx = max(mxdx, w[i].F);
		mxdx = max(mxdx, w[i].S);
		mxdx = max(mxdx, w[i].S);
	}
	
	return 0;
}

詳細信息

answer.code:22:23: error: use of deleted function ‘std::unordered_set<_Value, _Hash, _Pred, _Alloc>::unordered_set() [with _Value = std::pair<int, int>; _Hash = std::hash<std::pair<int, int> >; _Pred = std::equal_to<std::pair<int, int> >; _Alloc = std::allocator<std::pair<int, int> >]’
   22 | unordered_set<PII> v[N];
      |                       ^
In file included from /usr/include/c++/13/unordered_set:41,
                 from /usr/include/x86_64-linux-gnu/c++/13/bits/stdc++.h:189,
                 from answer.code:1:
/usr/include/c++/13/bits/unordered_set.h:142:7: note: ‘std::unordered_set<_Value, _Hash, _Pred, _Alloc>::unordered_set() [with _Value = std::pair<int, int>; _Hash = std::hash<std::pair<int, int> >; _Pred = std::equal_to<std::pair<int, int> >; _Alloc = std::allocator<std::pair<int, int> >]’ is implicitly deleted because the default definition would be ill-formed:
  142 |       unordered_set() = default;
      |       ^~~~~~~~~~~~~
/usr/include/c++/13/bits/unordered_set.h:142:7: error: use of deleted function ‘std::_Hashtable<_Key, _Value, _Alloc, _ExtractKey, _Equal, _Hash, _RangeHash, _Unused, _RehashPolicy, _Traits>::_Hashtable() [with _Key = std::pair<int, int>; _Value = std::pair<int, int>; _Alloc = std::allocator<std::pair<int, int> >; _ExtractKey = std::__detail::_Identity; _Equal = std::equal_to<std::pair<int, int> >; _Hash = std::hash<std::pair<int, int> >; _RangeHash = std::__detail::_Mod_range_hashing; _Unused = std::__detail::_Default_ranged_hash; _RehashPolicy = std::__detail::_Prime_rehash_policy; _Traits = std::__detail::_Hashtable_traits<true, true, true>]’
In file included from /usr/include/c++/13/bits/unordered_map.h:33,
                 from /usr/include/c++/13/unordered_map:41,
                 from /usr/include/c++/13/functional:63,
                 from /usr/include/x86_64-linux-gnu/c++/13/bits/stdc++.h:53:
/usr/include/c++/13/bits/hashtable.h:530:7: note: ‘std::_Hashtable<_Key, _Value, _Alloc, _ExtractKey, _Equal, _Hash, _RangeHash, _Unused, _RehashPolicy, _Traits>::_Hashtable() [with _Key = std::pair<int, int>; _Value = std::pair<int, int>; _Alloc = std::allocator<std::pair<int, int> >; _ExtractKey = std::__detail::_Identity; _Equal = std::equal_to<std::pair<int, int> >; _Hash = std::hash<std::pair<int, int> >; _RangeHash = std::__detail::_Mod_range_hashing; _Unused = std::__detail::_Default_ranged_hash; _RehashPolicy = std::__detail::_Prime_rehash_policy; _Traits = std::__detail::_Hashtable_traits<true, true, true>]’ is implicitly deleted because the default definition would be ill-formed:
  530 |       _Hashtable() = default;
      |       ^~~~~~~~~~
/usr/include/c++/13/bits/hashtable.h:530:7: error: use of deleted function ‘std::__detail::_Hashtable_base<_Key, _Value, _ExtractKey, _Equal, _Hash, _RangeHash, _Unused, _Traits>::_Hashtable_base() [with _Key = std::pair<int, int>; _Value = std::pair<int, int>; _ExtractKey = std::__detail::_Identity; _Equal = std::equal_to<std::pair<int, int> >; _Hash = std::hash<std::pair<int, int> >; _RangeHash = std::__detail::_Mod_range_hashing; _Unused = std::__detail::_Default_ranged_hash; _Traits = std::__detail::_Hashtable_traits<true, true, true>]’
In file included from /usr/include/c++/13/bits/hashtable.h:35:
/usr/include/c++/13/bits/hashtable_policy.h:1710:7: note: ‘std::__detail::_Hashtable_base<_Key, _Value, _ExtractKey, _Equal, _Hash, _RangeHash, _Unused, _Traits>::_Hashtable_base() [with _Key = std::pair<int, int>; _Value = std::pair<int, int>; _ExtractKey = std::__detail::_Identity; _Equal = std::equal_to<std::pair<int, int> >; _Hash = std::hash<std::pair<int, int> >; _RangeHash = std::__detail::_Mod_range_hashing; _Unused = std::__detail::_Default_ranged_hash; _Traits = std::__detail::_Hashtable_traits<true, true, true>]’ is implicitly deleted because the default definition would be ill-formed:
 1710 |       _Hashtable_base() = default;
      |       ^~~~~~~~~~~~~~~
/usr/include/c++/13/bits/hashtable_policy.h:1710:7: error: use of deleted function ‘std::__detail::_Hash_code_base<_Key, _Value, _ExtractKey, _Hash, _RangeHash, _Unused, __cache_hash_code>::_Hash_code_base() [with _Key = std::pair<int, int>; _Value = std::pair<int, int>; _ExtractKey = std::__detail::_Identity; _Hash = std::hash<std::pair<int, int> >; _RangeHash = std::__detail::_Mod_range_hashing; _Unused = std::__detail::_Default_ranged_hash; bool __cache_hash_code = true]’
/usr/include/c++/13/bits/hashtable_policy.h: In instantiation of ‘std::__detail::_Hashtable_ebo_helper<_Nm, _Tp, true>::_Hashtable_ebo_helper() [with int _Nm = 1; _Tp = std::hash<std::pair<int, int> >]’:
/usr/include/c++/13/bits/hashtable_policy.h:1297:7:   required from here
/usr/include/c++/13/bits/hashtable_policy.h:1214:49: error: use of deleted function ‘std::hash<std::pair<int, int> >::hash()’
 1214 |       _Hashtable_ebo_helper() noexcept(noexcept(_Tp())) : _Tp() { }
      |                                                 ^~~~~
In file included from /usr/include/c++/13/string_view:...