QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#177264 | #6882. 8-bit Zoom | PPP# | AC ✓ | 1ms | 3892kb | C++17 | 1.6kb | 2023-09-12 19:27:04 | 2023-09-12 19:27:04 |
Judging History
answer
#ifdef DEBUG
//#define _GLIBCXX_DEBUG
#endif
//#pragma GCC optimize("O3")
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double ld;
const ll mod = 1000000007;
//const ll mod = 998244353;
#define X first
#define Y second
ll pew(ll a, ll b)
{
ll res = 1;
while (b>0)
{
if (b&1) res = res*a%mod;
b >>= 1;
a = a*a%mod;
}
return res;
}
void solve()
{
int n, P;
cin >> n >> P;
int Q = 100;
vector<string> s(n);
for (int i=0;i<n;i++) cin >> s[i];
ll G = __gcd(P,Q);
P /= G;
Q /= G;
if (n%Q!=0)
{
cout << "error\n";
return;
}
for (int i=0;i<n;i++)
{
for (int j=0;j<n;j++)
{
if (i+1<n and (i+1)%Q!=0)
{
if (s[i][j]!=s[i+1][j])
{
cout << "error\n";
return;
}
}
if (j+1<n and (j+1)%Q!=0)
{
if (s[i][j]!=s[i][j+1])
{
cout << "error\n";
return;
}
}
}
}
int N = n*P/Q;
for (int i=0;i<N;i++)
{
for (int j=0;j<N;j++)
{
cout << s[i*Q/P][j*Q/P];
}
cout << "\n";
}
}
int main() {
ios_base::sync_with_stdio(false);
cin.tie(nullptr);
//#ifdef DEBUG
//freopen("input.txt", "r", stdin);
//#endif
int T = 1;
cin >> T;
while (T--) solve();
return 0;
}
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 100
Accepted
time: 1ms
memory: 3892kb
input:
10 23 100 zmzemhuhooodxcxsaetjwyw uppvsannoobdabjkabjhzqo uqfcuxgelccyvvpfpoybspw rnzgaaigwgmbqmghkfrmqmg tmniwhcolzscuwyyclvnzep pxlmsueaquqtaicjrxkmuow xebkeryqxbmsgvfnrwphmuh nnhzzzzciqqybkgwskgtrwt mjnpodnnttvmnaavzjuuyza dbfhimxsupkcetqrucbnkvd ppjcgvtfpubxnvdjlehxebo mlqfylqyiipenlebeporltz ni...
output:
zmzemhuhooodxcxsaetjwyw uppvsannoobdabjkabjhzqo uqfcuxgelccyvvpfpoybspw rnzgaaigwgmbqmghkfrmqmg tmniwhcolzscuwyyclvnzep pxlmsueaquqtaicjrxkmuow xebkeryqxbmsgvfnrwphmuh nnhzzzzciqqybkgwskgtrwt mjnpodnnttvmnaavzjuuyza dbfhimxsupkcetqrucbnkvd ppjcgvtfpubxnvdjlehxebo mlqfylqyiipenlebeporltz nimgrloouctf...
result:
ok 297 lines