QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#313301#8142. ElevatorPetroTarnavskyi#WA 1ms3524kbC++20909b2024-01-24 17:19:322024-01-24 17:19:32

Judging History

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

  • [2024-01-24 17:19:32]
  • 评测
  • 测评结果:WA
  • 用时:1ms
  • 内存:3524kb
  • [2024-01-24 17:19:32]
  • 提交

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;

void solve()
{
	int n, k;
	cin >> n >> k;
	set<int> s;
	FOR (i, 0, n)
	{
		int a;
		cin >> a;
		s.insert(a);
	}
	FOR (t, 0, 2)
	{
		int j = k;
		int p = t;
		while (j)
		{
			if (!s.count(p))
			{
				s.insert(p);
				j--;
			}
			p += 2;
		}
	}
	int ans = 0;
	while (s.count(ans))
		ans++;
	cout << (ans & 1 ? "Bob\n" : "Alice\n");
}

int main()
{
	ios::sync_with_stdio(0);
	cin.tie(0);
	
	int t;
	cin >> t;
	while (t--)
	{
		solve();
	}
	
	return 0;
}


Details

Tip: Click on the bar to expand more detailed information

Test #1:

score: 0
Wrong Answer
time: 1ms
memory: 3524kb

input:

6 20
3 8 12 6 9 9

output:

Bob
Alice
Alice
Alice
Alice
Alice

result:

wrong answer 1st lines differ - expected: '0', found: 'Bob'