QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#450875#5564. Lots of LandEbiarat#WA 1ms3636kbC++201.7kb2024-06-22 19:05:242024-06-22 19:05:25

Judging History

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

  • [2024-06-22 19:05:25]
  • 评测
  • 测评结果:WA
  • 用时:1ms
  • 内存:3636kb
  • [2024-06-22 19:05:24]
  • 提交

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.