This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include <cstdio>
#include <iostream>
#include <fstream>
#include <deque>
#include <algorithm>
#include <utility>
#include <vector>
#include <cmath>
#include <queue>
#include <string>
using namespace std;
#define in cin
#define out cout
#define PII pair<int, int>
#define pi 3.14159265358979323846
#define REP(i, v) for(int i=0; i<v; i++)
#define REPEQ(i, s, e) for(int i=s; i<=e; i++)
#define REPRV(i, s, e) for(int i=s; i>=e; i--)
#define all(v) v.begin(), v.end()
#define long long int int64
#define BIG(a, b) ( (a>b?a:b) )
char str[] = "abcdz_";
string A("##### ..#.. #...# ##### #####");
string B("##### #...# #.#.# ....# #####");
string C("##### ###.. ###.# ###.. #####");
string D("##### ##### ##### ..### #.###");
string Z("##### ....# ###.# ###.. #####");
string U("..... ..... ..... ..... .....");
char MP[3111][3111];
vector< string > v;
int f(int x, int y)
{
REP(vi, v.size())
{
int c = 0;
int flag = true;
REPEQ(i, x, x+4)
{
REPEQ(j, y, y+4)
{
if(v[vi][c] != MP[i][j]) flag = false;
c++;
}
c++;
}
if(flag) out << str[vi];
}
}
int main()
{
//freopen("in.txt", "r+", stdin);
ios::sync_with_stdio(false);
v.push_back(A);
v.push_back(B);
v.push_back(C);
v.push_back(D);
v.push_back(Z);
v.push_back(U);
int r, c; in >> r >> c;
REP(i, 6*r-1)
{
REP(j, 6*c-1)
{
in >> MP[i][j];
}
}
REPRV(i, c-1, 0)
{
REP(j, r)
{
f(j*6, i*6);
} out << endl;
}
return 0;
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |