QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#368783#8516. LED MatrixPetroTarnavskyi#Compile Error//C++201.1kb2024-03-27 16:23:232024-03-27 16:23:26

Judging History

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

  • [2024-03-27 16:23:26]
  • 评测
  • [2024-03-27 16:23:23]
  • 提交

answer

struct Graph
{
	int szL, szR;
	vector<VI> g;
	VI mateForR, mateForL, usedL;
	
	void init(int L, int R)
	{
		szL = L, szR = R;
		g.resize(szL);
		mateForL.resize(szL);
		usedL.resize(szL);
		
		mateForR.resize(szR);
	}
	
	void addEdge(int from, int to)
	{
		assert(0 <= from && from <= szL);
		assert(0 <= to && to <= szR);
		g[from].PB(to);
	}
	
	int iter;
	bool kuhn(int v)
	{
		if (usedL[v] == iter) return false;
		usedL[v] = iter;
		shuffle(ALL(g[v]), rng);
		for (int to : g[v])
		{
			if (mateForR[to] == -1)
			{
				mateForR[to] = v;
				mateForL[v] = to;
				return true;
			}
		}
		for (int to : g[v])
		{
			if (kuhn(mateForR[to]))
			{
				mateForR[to] = v;
				mateForL[v] = to;
				return true;
			}
		}
		return false;
	}
	
	int doKuhn()
	{
		fill(ALL(mateForR), -1);
		fill(ALL(mateForL), -1);
		fill(ALL(usedL), -1);
		
		int res = 0;
		iter = 0;
		
		while(true)
		{
			iter++;
			
			bool ok = false;
			FOR (v, 0, szL)
			{
				if (mateForL[v] == -1)
				{
					if (kuhn(v))
					{
						ok = true;
						res++;
					}
				}
			}
			if (!ok) break;
		}
		return res;
	}
};

Details

answer.code:4:16: error: ‘VI’ was not declared in this scope
    4 |         vector<VI> g;
      |                ^~
answer.code:4:16: error: ‘VI’ was not declared in this scope
answer.code:4:16: error: ‘VI’ was not declared in this scope
answer.code:4:16: error: ‘VI’ was not declared in this scope
answer.code:4:16: error: ‘VI’ was not declared in this scope
answer.code:4:16: error: ‘VI’ was not declared in this scope
answer.code:4:16: error: ‘VI’ was not declared in this scope
answer.code:4:16: error: ‘VI’ was not declared in this scope
answer.code:4:16: error: ‘VI’ was not declared in this scope
answer.code:4:16: error: ‘VI’ was not declared in this scope
answer.code:4:9: error: ‘vector’ does not name a type
    4 |         vector<VI> g;
      |         ^~~~~~
answer.code:5:9: error: ‘VI’ does not name a type
    5 |         VI mateForR, mateForL, usedL;
      |         ^~
answer.code: In member function ‘void Graph::init(int, int)’:
answer.code:10:17: error: ‘g’ was not declared in this scope
   10 |                 g.resize(szL);
      |                 ^
answer.code:11:17: error: ‘mateForL’ was not declared in this scope
   11 |                 mateForL.resize(szL);
      |                 ^~~~~~~~
answer.code:12:17: error: ‘usedL’ was not declared in this scope
   12 |                 usedL.resize(szL);
      |                 ^~~~~
answer.code:14:17: error: ‘mateForR’ was not declared in this scope
   14 |                 mateForR.resize(szR);
      |                 ^~~~~~~~
answer.code: In member function ‘void Graph::addEdge(int, int)’:
answer.code:19:17: error: ‘assert’ was not declared in this scope
   19 |                 assert(0 <= from && from <= szL);
      |                 ^~~~~~
answer.code:1:1: note: ‘assert’ is defined in header ‘<cassert>’; did you forget to ‘#include <cassert>’?
  +++ |+#include <cassert>
    1 | struct Graph
answer.code:21:17: error: ‘g’ was not declared in this scope
   21 |                 g[from].PB(to);
      |                 ^
answer.code: In member function ‘bool Graph::kuhn(int)’:
answer.code:27:21: error: ‘usedL’ was not declared in this scope
   27 |                 if (usedL[v] == iter) return false;
      |                     ^~~~~
answer.code:28:17: error: ‘usedL’ was not declared in this scope
   28 |                 usedL[v] = iter;
      |                 ^~~~~
answer.code:29:29: error: ‘g’ was not declared in this scope
   29 |                 shuffle(ALL(g[v]), rng);
      |                             ^
answer.code:29:25: error: ‘ALL’ was not declared in this scope
   29 |                 shuffle(ALL(g[v]), rng);
      |                         ^~~
answer.code:29:36: error: ‘rng’ was not declared in this scope
   29 |                 shuffle(ALL(g[v]), rng);
      |                                    ^~~
answer.code:29:17: error: ‘shuffle’ was not declared in this scope
   29 |                 shuffle(ALL(g[v]), rng);
      |                 ^~~~~~~
answer.code:32:29: error: ‘mateForR’ was not declared in this scope
   32 |                         if (mateForR[to] == -1)
      |                             ^~~~~~~~
answer.code:35:33: error: ‘mateForL’ was not declared in this scope
   35 |                                 mateForL[v] = to;
      |                                 ^~~~~~~~
answer.code:41:34: error: ‘mateForR’ was not declared in this scope
   41 |                         if (kuhn(mateForR[to]))
      |                                  ^~~~~~~~
answer.code:44:33: error: ‘mateForL’ was not declared in this scope
   44 |                                 mateForL[v] = to;
      |                                 ^~~~~~~~
answer.code: In member function ‘int Graph::doKuhn()’:
answer.code:53:26: error: ‘mateForR’ was not declared in this scope
   53 |                 fill(ALL(mateForR), -1);
      |                          ^~~~~~~~
answer.code:53:22: error: ‘ALL’ was not declared in this scope
   53 |                 fill(ALL(mateForR), -1);
      |                      ^~~
answer.code:53:17: error: ‘fill’ was not declared in this scope
   53 |                 fill(ALL(mateForR), -1);
      |                 ^~~~
answer.code:54:26: error: ‘mateForL’ was not declared in this scope
   54 |                 fill(ALL(mateForL), -1);
      |                          ^~~~~~~~
answer.code:55:26: error: ‘usedL’ was not declared in this scope
   55 |                 fill(ALL(usedL), -1);
      |                          ^~~~~
answer.code:65:30: error: ‘v’ was not declared in this scope
   65 |                         FOR (v, 0, szL)
      |                              ^
answer.code:65:25: error: ‘FOR’ was not declared in this scope
   65 |                         FOR (v, 0, szL)
      |                         ^~~