QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#450875 | #5564. Lots of Land | Ebiarat# | WA | 1ms | 3636kb | C++20 | 1.7kb | 2024-06-22 19:05:24 | 2024-06-22 19:05:25 |
Judging History
answer
#include <iostream>
#include <string>
#include <set>
#include <map>
#include <algorithm>
#include <iomanip>
#include <vector>
#include <cmath>
#include <queue>
#include <sstream>
#include <ctime>
#include <iterator>
#include <string.h>
#include <stack>
#include <unordered_set>
#include <unordered_map>
#include <bitset>
#include <fstream>
#include <assert.h>
#include <numeric>
#include <complex>
#include <random>
#include <utility>
#define IOS ios_base::sync_with_stdio(0),cin.tie(0), cout.tie(0);
#define FOR(i,a,b) for(int i = (a); i < (b); i++)
#define RFOR(i,a,b) for(int i = (a) - 1; i>=(b);i--)
#define rep(i,n) FOR(i,0,n)
#define PB push_back
#define SZ(a) (int)a.size()
#define ALL(a) a.begin(), a.end()
#define VI vector<int>
#define PII pair<int,int>
#define PLL pair<long long,long long>
#define VL vector<long long >
#define FILL(a, value) memset(a, value, sizeof(a))
const int nax = 2 * (int)1e5 + 147;
using namespace std;
const int MOD = 998244353;
const int INF = 1e9 +47 ;
const long long LINF = (long long)1e18 + 4747;
typedef long long LL;
const double EPS=1e-6;
long long dp[5 * (int)1e5 + 47];
vector<int> vec[5 * (int)1e5 + 47];
long long p[5 * (int)1e5 + 47];
int gcd(int a, int b) {
return b ? gcd(b, a % b) : a;
}
int main() {
int n,m,k;
cin >> n >> m >> k;
if((n * m) % k !=0 ) {
cout << "impossible\n";
return 0;
}
int a = gcd(n,k);
int b = m / a;
int cc = 0 ;
for(int i =0;i < n;i +=a) {
for(int k = 0;k < a;k ++ ) {
for(int j = 0;j < m;j ++ ) {
cout << (char)('A' + (j / b) + cc);
}
cout << '\n';
}
cc+= m / b;
}
}
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 100
Accepted
time: 1ms
memory: 3636kb
input:
4 4 4
output:
ABCD ABCD ABCD ABCD
result:
ok correct
Test #2:
score: -100
Wrong Answer
time: 1ms
memory: 3636kb
input:
6 15 9
output:
AAAAABBBBBCCCCC AAAAABBBBBCCCCC AAAAABBBBBCCCCC DDDDDEEEEEFFFFF DDDDDEEEEEFFFFF DDDDDEEEEEFFFFF
result:
wrong answer Region A does not have the correct size.