QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#225353#7521. Find the GapPetroTarnavskyi#WA 0ms3544kbC++171.6kb2023-10-24 15:48:462023-10-24 15:48:47

Judging History

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

  • [2023-10-24 15:48:47]
  • 评测
  • 测评结果:WA
  • 用时:0ms
  • 内存:3544kb
  • [2023-10-24 15:48: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;


map<int, int> cnt[2];

void erase(int t, int x)
{
	cnt[t][x]--;
	if (cnt[t][x] == 0)
		cnt[t].erase(x);
}
	

int main()
{
	ios::sync_with_stdio(0);
	cin.tie(0);
	cout << fixed << setprecision(15);
	
	return 0;

	int q;
	cin >> q;
	int last = 0;
	set<pair<int, PII>> s;
	FOR (i, 0, q)
	{
		int t;
		cin >> t;
		if (t == 1)
		{
			int x, y, W;
			cin >> x >> y >> W;
			x ^= last;
			y ^= last;
			W ^= last;
			s.insert({W, {x, y}});
			cnt[0][x]++;
			cnt[1][y]++;
			if (cnt[0][x] == 4)
			{
				for (auto [w, p] : s)
				{
					if (p.F == x)
					{
						erase(0, p.F);
						erase(1, p.S);
						s.erase({w, p});
						break;
					}
				}
			}
			if (cnt[1][y] == 4)
			{
				for (auto [w, p] : s)
				{
					if (p.S == y)
					{
						erase(0, p.F);
						erase(1, p.S);
						s.erase({w, p});
						break;
					}
				}
			}
			if (SZ(s) > 14)
			{
				auto p = s.begin()->S;
				erase(0, p.F);
				erase(1, p.S);
				s.erase(s.begin());
			}
		}
		else
		{
			int x, y;
			cin >> x >> y;
			x ^= last;
			y ^= last;
			int ans = 0;
			for (auto [w, p] : s)
			{
				if (p.F != x && p.S != y)
					ans = max(ans, w);
			}
			cout << ans << '\n';
			last = ans;
		}
	}
	
	return 0;
}

詳細信息

Test #1:

score: 0
Wrong Answer
time: 0ms
memory: 3544kb

input:

8
1 1 1
1 1 2
1 2 1
1 2 2
2 1 1
2 1 2
2 2 1
2 2 2

output:


result:

wrong output format Unexpected end of file - double expected