QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#386880#5108. Prehistoric ProgramsPetroTarnavskyi#Compile Error//C++201.2kb2024-04-11 20:58:182024-04-11 20:58:19

Judging History

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

  • [2024-04-11 20:58:19]
  • 评测
  • [2024-04-11 20:58:18]
  • 提交

answer


int main()
{
	ios::sync_with_stdio(0);
	cin.tie(0);
	
	FOR (i, 0, N2) fill(a[i], a[i] + N2, -1);
	
	cin >> m >> n;
	cin >> k;
	FOR (i, 0, k)
	{
		cin >> w[i].S >> w[i].F;
		int sz;
		cin >> sz;
		FOR (j, 0, sz)
		{
			int x, y;
			cin >> x >> y;
			x--;
			y--;
			a[y][x] = 1;
			msk[y][x] |= 1 << i;
		}
	}
	int mxdx = 0, mndx = 0, mxdy = 0, mndy = 0;
	FOR (i, 0, k)
	{
		mxdx = max(mxdx, w[i].F);
		mndx = min(mndx, w[i].F);
		mxdy = max(mxdy, w[i].S);
		mndy = min(mndy, w[i].S);
	}
	FOR (y, 0, n)
	{
		FOR (x, 0, mxdx)
			if (a[y][x] == -1)
				a[y][x] = 0;
		FOR (x, m + mndx, m)
			if (a[y][x] == -1)
				a[y][x] = 0;
	}
	FOR (x, 0, m)
	{
		FOR (y, 0, mxdy)
			if (a[y][x] == -1)
				a[y][x] = 0;
		FOR (y, n + mndy, n)
			if (a[y][x] == -1)
				a[y][x] = 0;
	}

	FOR (y, 0, n)
	{
		FOR (x, 0, m)
		{
			if (!used[y][x] && a[y][x] != -1)
			{
				dfs(x, y);
			}
		}
	}
	string s = ".#";
	FOR (y, 0, n)
	{
		FOR (x, 0, m)
		{
			if (a[y][x] == -1)
				cout << '.';
			cout << s[a[y][x]];
		}
		cout << '\n';
	}
	cout << '\n';
	FOR (y, 0, n)
	{
		FOR (x, 0, m)
		{
			if (a[y][x] == -1)
				cout << '#';
			cout << s[a[y][x]];
		}
		cout << '\n';
	}
	cout << '\n';
	
	return 0;
}

Details

answer.code: In function ‘int main()’:
answer.code:4:9: error: ‘ios’ has not been declared
    4 |         ios::sync_with_stdio(0);
      |         ^~~
answer.code:5:9: error: ‘cin’ was not declared in this scope
    5 |         cin.tie(0);
      |         ^~~
answer.code:7:14: error: ‘i’ was not declared in this scope
    7 |         FOR (i, 0, N2) fill(a[i], a[i] + N2, -1);
      |              ^
answer.code:7:20: error: ‘N2’ was not declared in this scope
    7 |         FOR (i, 0, N2) fill(a[i], a[i] + N2, -1);
      |                    ^~
answer.code:7:9: error: ‘FOR’ was not declared in this scope
    7 |         FOR (i, 0, N2) fill(a[i], a[i] + N2, -1);
      |         ^~~
answer.code:9:16: error: ‘m’ was not declared in this scope
    9 |         cin >> m >> n;
      |                ^
answer.code:9:21: error: ‘n’ was not declared in this scope
    9 |         cin >> m >> n;
      |                     ^
answer.code:10:16: error: ‘k’ was not declared in this scope
   10 |         cin >> k;
      |                ^
answer.code:34:14: error: ‘y’ was not declared in this scope
   34 |         FOR (y, 0, n)
      |              ^
answer.code:43:14: error: ‘x’ was not declared in this scope
   43 |         FOR (x, 0, m)
      |              ^
answer.code:63:9: error: ‘string’ was not declared in this scope
   63 |         string s = ".#";
      |         ^~~~~~
answer.code:74:9: error: ‘cout’ was not declared in this scope
   74 |         cout << '\n';
      |         ^~~~