QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#482734#3657. Fantasy DraftHerofis#WA 0ms3836kbC++201.7kb2024-07-17 21:02:562024-07-17 21:02:57

Judging History

This is the latest submission verdict.

  • [2024-07-17 21:02:57]
  • Judged
  • Verdict: WA
  • Time: 0ms
  • Memory: 3836kb
  • [2024-07-17 21:02:56]
  • Submitted

answer

#include<bits/stdc++.h>
using namespace std;

typedef long long ll;
const int help = 61;
int wanted[help];
int taken[help];
int willo[help];
int main()
{
	int n, k;
	cin >> n >> k;
	map<int, vector<string>>managerList;
	map<int, vector<string>>ans;
	map<string, bool> vis;
	for (int i = 1;i<=n; i++)
	{
		cin >> wanted[i];
		for (int j = 0; j < wanted[i]; j++) {
			string s;
			cin >> s;
			managerList[i].push_back(s);
			ans[i] = {};
		}
	}
	int p; cin >> p;
	//vector<string> players;
	for (int i = 0; i < p; i++)
	{
		string s;
		cin >> s;
		vis[s] = false;
	}
	
	for (int l = 0; l < k; l++)
	{
		for (int i = 1; i <= n; i++)
		{
			for (int j = 0; j < managerList[i].size(); j++)
			{
				if (!vis[managerList[i][j]])
				{
					ans[i].push_back(managerList[i][j]);
					vis[managerList[i][j]] = true;
					wanted[i]--;
					willo[i]++;
					break;
				}
				}
		}
	}
	for (int i = 1; i <= n; i++)
	{
		for (int j = 0; j < ans[i].size(); j++) 
		{
			cout << ans[i][j]<<" ";
		}
		if (willo[i] == k)
		{
			continue;
		}
		if (wanted[i]) 
		{
			if (willo[i] == k)
			{
				continue;
			}
			for (int j = 0; j < wanted[i]; j++) 
			{
				for (auto l : vis) 
				{
					if (l.second == false)
					{
						cout << l.first << " ";
						vis[l.first] = true;
						willo[i]++;
						break;
					}
					
				}
			}
		}
		else 
		{
			for (int j = 0; j < k; j++)
			{
				if (willo[i] == k)
				{
					continue;
				}
				for (auto l : vis)
				{
					if (willo[i] == k)
					{
						continue;
					}
					if (l.second == false)
					{
						cout << l.first << " ";
						willo[i]++;
						vis[l.first] = true;
					}
				}
			}
		}
		cout << endl;
	}

}

Details

Tip: Click on the bar to expand more detailed information

Test #1:

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

input:

2 2
0
0
6
Shoresy
Jonesy
Reilly
Sholtzy
Fisky
Yorkie

output:

Fisky Jonesy 
Reilly Sholtzy 

result:

wrong answer 1st lines differ - expected: 'Shoresy Reilly', found: 'Fisky Jonesy '