QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#100486#5556. Diabolic DoofenshmirtzPetroTarnavskyi#TL 0ms0kbC++171.1kb2023-04-26 16:12:592023-04-26 16:13:04

Judging History

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

  • [2023-08-10 23:21:45]
  • System Update: QOJ starts to keep a history of the judgings of all the submissions.
  • [2023-04-26 16:13:04]
  • 评测
  • 测评结果:TL
  • 用时:0ms
  • 内存:0kb
  • [2023-04-26 16:12:59]
  • 提交

answer

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

#define SZ(a) (int)a.size()
#define ALL(a) a.begin(), a.end()
#define FOR(i, a, b) for (int i = (a); i<(b); ++i)
#define RFOR(i, b, a) for (int i = (b)-1; i>=(a); --i)
#define MP make_pair
#define PB push_back
#define F first
#define S second

typedef long long LL;
typedef pair<int, int> PII;
typedef vector<int> VI;

int main()
{
	ios::sync_with_stdio(false);
	cin.tie(0);
	int l, w, n;
	cin >> l >> w >> n;
	vector<vector<char>> v(l, vector<char>(w));
	char c = 'A';
	FOR(d1, 0, n + 1)
	{
		FOR(d2, 0, n + 1)
		{
			if (d1 * d2 == n && l % d1 == 0 && w % d2 == 0)
			{
				cerr << d1 << ' ' << d2 << '\n';
				int x = l / d1;
				int y = w / d2;
				FOR(i, 0, d1)
				{
					FOR(j, 0, d2)
					{
						FOR(ii, 0, l / d1)
						{
							FOR(jj, 0, w / d2)
							{
								v[i * x + ii][j * y + jj] = c;
							}
						}
						c++;
					}
				}
				FOR(i, 0, l)
				{
					FOR(j, 0, w)
					{
						cout << v[i][j];
					}
					cout << '\n';
				}
				return 0;
			}
		}
	}
	cout << "impossible\n";
	return 0;
}

Details

Tip: Click on the bar to expand more detailed information

Test #1:

score: 0
Time Limit Exceeded

input:


output:


result: