QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#344650#2476. Pizzo CollectorsPetroTarnavskyi#Compile Error//C++20966b2024-03-04 20:52:072024-03-04 20:52:07

Judging History

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

  • [2024-03-04 20:52:07]
  • 评测
  • [2024-03-04 20:52:07]
  • 提交

answer

void solve(int l, int r, int L, int R)
{
	if (l == r || L == R)
		return;
	if (L + 1 == R)
	{
		FOR (i, l, r) f[i] = L;
		return;
	}
	int M = (L + R) / 2;
	
	int m = l;
	if(L <= r)
	{
		RFOR(i, M + 1, l)
		{
			int a = e[i].F;
			int b = e[i].S;
			if(d.find(a) == d.find(b))
				break;
		
			m = i;
			d.unite(a, b);
		}
		FOR(i, m, M + 1)
		{
			d.rollBack();
		}
		m = min(m, r);
	}
	else
	{
		int pos = L;
		FOR(i, L, M + 1)
		{
			int a = e[i].F;
			int b = e[i].S;
			if(d.find(a) == d.find(b))
				break;
			pos = i;
			d.unite(a, b);
		}
		if(pos != M)
		{				
			RFOR(i, pos + 1, L)
			{
				d.rollBack();
			}
			m = r;
		}
		else
		{
			RFOR(i, r, l)
			{
				int a = e[i].F;
				int b = e[i].S;
				if(d.find(a) == d.find(b))
					break;
				m = i;
				d.unite(a, b);
			}
			
			FOR(i, m, r)
			{
				d.rollBack();
			}
		}
	}
	
	
	
	
	
	solve(l, m, L, M);
	solve(m, r, M, R);
}

详细

answer.code: In function ‘void solve(int, int, int, int)’:
answer.code:7:22: error: ‘i’ was not declared in this scope
    7 |                 FOR (i, l, r) f[i] = L;
      |                      ^
answer.code:7:17: error: ‘FOR’ was not declared in this scope
    7 |                 FOR (i, l, r) f[i] = L;
      |                 ^~~
answer.code:15:22: error: ‘i’ was not declared in this scope
   15 |                 RFOR(i, M + 1, l)
      |                      ^
answer.code:15:17: error: ‘RFOR’ was not declared in this scope
   15 |                 RFOR(i, M + 1, l)
      |                 ^~~~
answer.code:25:17: error: ‘FOR’ was not declared in this scope
   25 |                 FOR(i, m, M + 1)
      |                 ^~~
answer.code:29:21: error: ‘min’ was not declared in this scope
   29 |                 m = min(m, r);
      |                     ^~~
answer.code:34:21: error: ‘i’ was not declared in this scope
   34 |                 FOR(i, L, M + 1)
      |                     ^
answer.code:34:17: error: ‘FOR’ was not declared in this scope
   34 |                 FOR(i, L, M + 1)
      |                 ^~~
answer.code:45:25: error: ‘RFOR’ was not declared in this scope
   45 |                         RFOR(i, pos + 1, L)
      |                         ^~~~
answer.code:53:25: error: ‘RFOR’ was not declared in this scope
   53 |                         RFOR(i, r, l)
      |                         ^~~~