QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#278113 | #5564. Lots of Land | jzh# | WA | 1ms | 3472kb | C++23 | 1.2kb | 2023-12-07 12:23:14 | 2023-12-07 12:23:15 |
Judging History
answer
#include<bits/stdc++.h>
using namespace std;
using ll = long long;
using db = long double;
struct M{
array<array<db, 2>, 2> A;
M operator * (const M& t) const {
decltype(A) ans = {0,0,0,0};
for(int i = 0 ; i < 2 ; i ++) {
for(int j = 0 ; j < 2 ; j ++) {
for(int k = 0 ; k < 2 ; k ++) {
ans[i][j] += A[i][k] * t.A[k][j];
}
}
}
return M{ans};
}
};
M POW(M a, ll k) {
M ans = {1, 0, 0, 1};
for(; k; k/=2, a = a * a) {
if(k&1) ans = ans * a;
}
return ans;
}
int main() {
ios::sync_with_stdio(false);
cin.tie(nullptr);
cout << fixed << setprecision(10);
int l, w, n; cin >> l >> w >> n;
if(l*w%n!=0) {
cout << "impossible" << endl;
return 0;
}
for(int i = 1 ; i <= n ; i ++) {
if(n%i) continue;
if(l%i==0 and w%(n/i)==0) {
int a = i, b = n/i;
vector<string>g(w, string(l, '0'));
int tot = 0;
for(int i = 0 ; i < w ; i += b) {
for(int j = 0 ; j < l ; j += a) {
for(int x = i ; x < i + b ; x ++) {
for(int y = j ; y < j + a ; y ++) {
g[x][y] = 'A' + tot;
}
}
tot++;
}
}
for(int i = 0 ; i < w ; i ++) cout << g[i] << endl;
return 0;
}
}
return 0;
}
详细
Test #1:
score: 100
Accepted
time: 1ms
memory: 3472kb
input:
4 4 4
output:
ABCD ABCD ABCD ABCD
result:
ok correct
Test #2:
score: -100
Wrong Answer
time: 1ms
memory: 3436kb
input:
6 15 9
output:
AAABBB AAABBB AAABBB CCCDDD CCCDDD CCCDDD EEEFFF EEEFFF EEEFFF GGGHHH GGGHHH GGGHHH IIIJJJ IIIJJJ IIIJJJ
result:
wrong answer incorrect output