QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#100486 | #5556. Diabolic Doofenshmirtz | PetroTarnavskyi# | TL | 0ms | 0kb | C++17 | 1.1kb | 2023-04-26 16:12:59 | 2023-04-26 16:13:04 |
Judging History
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