QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#580462#8935. Puzzle: Easy as ScrabbleForever_Young#WA 50ms5092kbC++177.0kb2024-09-21 21:59:052024-09-21 21:59:06

Judging History

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

  • [2024-09-21 21:59:06]
  • 评测
  • 测评结果:WA
  • 用时:50ms
  • 内存:5092kb
  • [2024-09-21 21:59:05]
  • 提交

answer

#include<vector>
#include<set>
#include<map>
#include<queue>
#include<string>
#include<algorithm>
#include<iostream>
#include<bitset>
#include<functional>
#include<chrono>
#include<numeric>
#include<cstdio>
#include<cstring>
#include<cstdlib>
#include<cassert>
#include<cmath>
#include<iomanip>
#include<random>
#include<ctime>
#include<complex>
#include<type_traits>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace std;
using namespace __gnu_pbds;
typedef tree<int, null_type, less<int>, rb_tree_tag, tree_order_statistics_node_update> ordered_set;
typedef long long LL;
typedef double D;
#define all(v) (v).begin(), (v).end()
mt19937 gene(chrono::system_clock::now().time_since_epoch().count());
typedef complex<double> Complex;
typedef pair<int, int> pii;
#define fi first
#define se second
#define ins insert
#define pb push_back
inline char GET_CHAR(){
    const int maxn = 131072;
    static char buf[maxn],*p1=buf,*p2=buf;
    return p1==p2&&(p2=(p1=buf)+fread(buf,1,maxn,stdin),p1==p2)?EOF:*p1++;
}
inline int getInt() {
    int res(0);
    char c = getchar();
    while(c < '0') c = getchar();
    while(c >= '0') {
        res = res * 10 + (c - '0');
        c = getchar();
    }
    return res;
}
inline LL fastpo(LL x, LL n, LL mod) {
    LL res(1);
    while(n) {
        if(n & 1) {
            res = res * (LL)x % mod;
        }
        x = x * (LL) x % mod;
        n /= 2;
    }
    return res;
}
template<LL mod> struct Num {
    LL a;
    Num operator + (const Num & b) { return Num{(a + b.a) % mod}; }
    Num operator - (const Num & b) { return Num{(a - b.a + mod) % mod}; }
    Num operator * (const Num & b) { return Num{a * b.a % mod}; }
    Num operator / (const Num & b) { return Num{a * fastpo(b.a, mod - 2, mod) % mod}; }
    void operator += (const Num & b) {if((a += b.a) >= mod) a -= mod;}
    void operator -= (const Num & b) {if((a -= b.a) < 0) a += mod;}
    void operator *= (const Num & b) { a = a * b.a % mod; }
    void operator /= (const Num & b) { a = a * fastpo(b.a, mod - 2, mod) % mod; }
    void operator = (const Num & b) { a = b.a; }
    void operator = (const LL & b) { a = b; }
};
template<LL mod> ostream & operator << (ostream & os, const Num<mod> & a) {
    os << a.a;
    return os;
}
LL gcd(LL a, LL b) { return b ? gcd(b, a % b) : a; }
inline string itoa(LL x, int width = 0) {
    string res;
    if(x == 0) res.push_back('0');
    while(x) {
        res.push_back('0' + x % 10);
        x /= 10;
    }
    while((int)res.size() < width) res.push_back('0');
    reverse(res.begin(), res.end());
    return res;
}
const int _B = 131072;
char buf[_B];
int _bl = 0;
inline void flush() {
    fwrite(buf, 1, _bl, stdout);
    _bl = 0;
}
__inline void _putchar(char c) {
    if(_bl == _B) flush();
    buf[_bl++] = c;
}
inline void print(LL x, char c) {
    static char tmp[20];
    int l = 0;
    if(!x) tmp[l++] = '0';
    else {
        while(x) {
            tmp[l++] = x % 10 + '0';
            x /= 10;
        }
    }
    for(int i = l - 1; i >= 0; i--) _putchar(tmp[i]);
    _putchar(c);
}
typedef double C;
struct P {
    C x, y;
    void scan() {
        double _x, _y;
        scanf("%lf%lf", &_x, &_y);
        x = _x; y = _y;
    }
    void print() {
        cout << '(' << x << ' ' << y << ')' << endl;
    }
    P operator + (const P & b) const { return P{x + b.x, y + b.y}; }
    P operator - (const P & b) const { return P{x - b.x, y - b.y}; }
    C operator * (const P & b) const { return x * b.y - y * b.x; }
    C operator % (const P & b) const { return x * b.x + y * b.y; }
};
P operator * (const C & x, const P & b) { return P{x * b.x, x * b.y}; }
const int N = 1111;
const int LOG = 20;
const int mod = 1e9 + 7;
const int inf = 1e9 + 7;
int n, m;
int dx[4] = {1, 0, -1, 0};
int dy[4] = {0, 1, 0, -1};
int rela[N];
int getr(int x) {
    int p = x;
    while(rela[p] != p) p = rela[p];
    int p1 = p; p = x;
    while(rela[p] != p) {
        int p2 = rela[p];
        rela[p] = p1;
        p = p2;
    }
    return p1;
}
char a[N][N];
int main() {
    int n, m;
    scanf("%d%d", &n, &m);
    for (int i = 0; i <= n + 1; i++) {
        scanf("%s", a[i]);
    }
    for (int d = 0; d < 2; d++) {
        for (int e = 0; e < 2; e++) {
            
            vector<char> cr(n + 1), cc(m + 1);
            for (int i = 1; i <= n; i++) {
                cr[i] = a[i][0];
            }
            for (int j = 1; j <= m; j++) {
                cc[j] = a[0][j];
            }
            for (int i = 1; i <= n; i++) {
                for (int j = 1; j <= m; j++) {
                    if (a[i][j] == 'x') {
                        continue;
                    }
                    if (cr[i] != '.' && cc[j] != '.') {
                        if (cr[i] == cc[j]) {
                            a[i][j] = cr[i];
                            cr[i] = cc[j] = '.';
                        } else {
                            a[i][j] = 'x';
                        }
                    } else if(cr[i] != '.') {
                        a[i][j] = cr[i];
                        cr[i] = '.';
                    } else if(cc[j] != '.') {
                        a[i][j] = cc[j];
                        cc[j] = '.';
                    } else {

                    }
                }
            }

            for (int i = 0; i <= n + 1; i++) {
                for (int j = 0; j * 2 <= m + 1; j++) {
                    swap(a[i][j], a[i][m + 1 - j]);
                }
            }
        }
        for (int i = 0; i <= m + 1; i++) {
            for (int j = 0; j * 2 <= n + 1; j++) {
                swap(a[j][i], a[n + 1 - j][i]);
            }
        }
    }
    bool flag = true;
    for (int i = 1; i <= n; i++) {
        char bg = '.', ed = '.';
        for (int j = 1; j <= m; j++) {
            if (a[i][j] >= 'A' && a[i][j] <= 'Z') {
                if (bg == '.') {
                    bg = a[i][j];
                }
                ed = a[i][j];
            } else {
                a[i][j] = 'x';
            }
        }
        flag &= a[i][0] == '.' || a[i][0] == bg;
        flag &= a[i][m + 1] == '.' || a[i][m + 1] == ed;
    }
    for (int i = 1; i <= m; i++) {
        char bg = '.', ed = '.';
        for (int j = 1; j <= n; j++) {
            if (a[j][i] >= 'A' && a[j][i] <= 'Z') {
                if (bg == '.') {
                    bg = a[j][i];
                }
                ed = a[j][i];
            } else {
                a[j][i] = '.';
            }
        }
        flag &= a[0][i] == '.' || a[0][i] == bg;
        flag &= a[n + 1][i] == '.' || a[n + 1][i] == ed;
    }
    if (flag) {
        printf("YES\n");
        for (int i = 1; i <= n; i++) {
            for (int j = 1; j <= m; j++) {
                printf("%c", a[i][j]);
            }
            printf("\n");
        }
    } else {
        printf("NO\n");
    }
}

Details

Tip: Click on the bar to expand more detailed information

Test #1:

score: 100
Accepted
time: 0ms
memory: 3872kb

input:

5 5
.CBA...
....x..
..x...C
A.....B
B..x..A
C......
.......

output:

YES
CBA..
....C
A...B
B...A
C....

result:

ok Correct.

Test #2:

score: 0
Accepted
time: 0ms
memory: 3784kb

input:

1 2
....
Nx..
..O.

output:

NO

result:

ok Correct.

Test #3:

score: 0
Accepted
time: 0ms
memory: 3792kb

input:

5 5
.U.N.X.
U....xX
Ox....X
M...xxN
Vx....S
Ix.x..X
..IBHX.

output:

YES
U.NX.
.O..X
M.N..
.VB.S
.I.HX

result:

ok Correct.

Test #4:

score: 0
Accepted
time: 0ms
memory: 4008kb

input:

10 10
.BAZEMIEKUJ.
A..........K
B..x.x.x..x.
K.........xT
A.x..x.....J
Hx....x....B
Q..x....x.xW
S...x......W
S...x.xxx..Z
...x......xZ
I..x..x.x.xR
.QKO.ID..RW.

output:

YES
.AZEMIEK..
B.......U.
K.......T.
A........J
.H.......B
Q.......W.
S........W
S.O.....Z.
QK...D..Z.
...II...R.

result:

ok Correct.

Test #5:

score: 0
Accepted
time: 0ms
memory: 3988kb

input:

5 10
.PTWIVVISPY.
T...x.x....Y
Xx.x.xx..x.K
P.x.xx.....K
S..........A
E.........xS
.SPEASDCYSA.

output:

YES
.TW.V.ISPY
.X.I.....K
P....V...K
SP.......A
..EASDCYS.

result:

ok Correct.

Test #6:

score: 0
Accepted
time: 0ms
memory: 3748kb

input:

10 5
.HVYN..
Y.x...C
V..x..B
H...x.Z
....xxN
....x.P
B.x...G
Fx.x..D
Txx..xK
E..x.xR
Sx....B
.EPSBD.

output:

YES
..YNC
.V..B
H...Z
..N..
....P
B...G
.F..D
..TK.
EP.R.
..SB.

result:

ok Correct.

Test #7:

score: 0
Accepted
time: 1ms
memory: 3824kb

input:

50 50
.YDOGQIDENEUMONVSGZNMNHLEZCXIRMK.OOCKJOKXXZDUFEMPXS.
Y.x...x.x.x..x..........x.......x......x.....x....xX
N.........x.....x.....x....x.x.xxxxx.x...x.........E
U.....x.....x....x......x.....x........x..........xS
...x......x........x..x.....x.x.x........x.x.x.....S
Q.....x.x..x..........x....x....

output:

YES
Y.OGQ.D.N.UM.NVSGZNMNHL.ZCXIRMK.OOCKJO.XXZDU.EMPX.
ND...I.E....O..........E..............K.....F...E.
U........E......................................S.
.................................................S
Q................................................L
F...........................................

result:

ok Correct.

Test #8:

score: 0
Accepted
time: 1ms
memory: 4096kb

input:

100 100
.NUXAMX.LNWZKRRKZIRNZVDJF.XRB.VEFQXHTGLGIKZYSRPPF.YGVTOSQCADEG.KYKH.NWWO.XDXJW.G.RBHABFLWHFVUNOLBHMKN.
U..x...x...x....xx........x.....x.....xxx..x..........x..x...x..xx..x..x..x............x.....x.....x.N
C...x.......x.............x....x.x.x..x........x..x.xx..x..xx.................x..........

output:

YES
.U.AMX.LNW.KRRK..RNZVDJF..RB.VE.QXHTG...KZ.SRPPF.YGVT.SQ.ADE..K..H..WW..X.XJW.G.RBHABF.WHFVU.OLBHM.N
.CX.......Z....ZI..............F......GI..Y..........O..C...G..YK..N..O..D..................N.....KO
.O...................................L...........................................................

result:

ok Correct.

Test #9:

score: 0
Accepted
time: 11ms
memory: 4412kb

input:

500 500
..FHFDLGFGHREQBGILNRAGJ.ERZSAFGLQ.ESEBI.ELKM.RENLNFQSPT.TXUEIKHHOQWABSELMOPGTFGTXGYMTSU.N.O.AX.OGNSWTFSLUIMTUX.RUCECKZCXOJNPTFVAJUJTF.LHXURYIQIJCVWDBVZ.ZXFRAT.XIPXTDCSLHJHSZCW.RMNUGPIHYUQYUYAY.NHCBU.JPMLG.DDXAJWKNZJVKNAWAJZAHW.FCBEVATZ.YZ.HQ..QPLFARSHNP..EDPIKLYLF.FIFXEXR.XSUORAP.CZPMJXPUS.W...

output:

YES
...FDL...HREQ..ILNRA...ERZSA.GL...SE.I..LK...ENLNFQS.T.TX.E.K.HOQWA.SE.M.PGTFG.XGY..SU...O.AX.OGNS.TFSLUIM.UX...CEC..CXOJNPT.VA..JTF.LHXURYIQI.CVWDB.Z..XFR.T..IPXTD..LHJHSZCW.RMNUGPIHYUQY.YA..N.CB..JPM.G.DD.AJW.NZJ...AWAJZAHW.FCB...T..YZ.HQ..Q.LFA.S.NP..EDPI.LYLF..IFXEX...SUO.AP.CZP.JXPUS.W.D.WU...

result:

ok Correct.

Test #10:

score: 0
Accepted
time: 44ms
memory: 4952kb

input:

1000 1000
.SKFDQ.AV.GPTHMF.PL.YOQRQOXDOF.XVZ.H.MYOJIYT.QZNJQI.ZZMAJ.OAWBJBRXFW.CLEPPKGGAWGTVBKOBL.GPCO.ML.DBL.A.RJ..GF.EHK.CDXLLTCBCL.CGYJBMUSPIN.QELGYW.JE..CFVQF.LVYLFHYJ.MY.FZ.RU.ODLAYTWIZQOQZXBW.BVD.RFPLHLEHAU.G.PLFWFUKA.RSG..AVU.SA.PWRGJYO.OXD..S.Z.LIIADT.YXH..NHWXY.R.YFLS.URIJGPPURZPPVHJFLMKTDT...

output:

YES
S.FDQ.AV.GPTHMF.P..YOQRQOXD.F.XV.....YO.IYT.QZ.JQI.ZZMAJ.OAWBJBRX...C.EPP.GGAWGT.B..BL.GPCO.ML.D.L.A.R...GF.E.K.CDXLLT.BCL.CGYJB.USPIN..EL..W.J...CFVQ..LV.LFHYJ.MY.FZ.R..ODLAYTWIZQO.ZX.W...D.R..LHLE.A..G.PLFWFUKA.R.G..A...SA..WRGJ...OXD....Z.L.I.DT.Y.H..N.WXY.R.Y.LS..RI.G.PU.ZP.V..FLMKT.TWI.ZKHZ...

result:

ok Correct.

Test #11:

score: 0
Accepted
time: 1ms
memory: 3776kb

input:

1 1000
.K.CCS...LC.....Y..J...E.W.B..Q..KQ...Q...L..U.XSWX..NB..K.OLF...Y.A....HG....RRQO..Y...J.LOS...IN..C......H......X.....B.B.PQRT....VB.........P...E....MF.E...RH.XADCQN.D.KT.W..XNI..PH.Q.L.H..G...ZJR.V.I.......O......J.X..N..QS......UN....HLS..Z..N....X.YH.W..E.Z..JHSAV......YXT.P..TX.WT.SHE....

output:

YES
K.CCS...LC.Y.W.Y..J...E.W.B..Q..KQ..EQD..LT.U.XSWX..NB..K.OLF...Y.A....HG.BH.RRQO..Y..PJ.LOSU..IN..C......H......X.....B.B.PQRT...QVB...V..K..P...E....MF.E...RH.XADCQN.D.KT.W..XNI..PH.Q.L.H..G..ZZJR.V.I.......O.....DJ.X..NC.QS......UN....HLS.TZ..N....X.YH.W..EBZZ.JHSAV......YXT.P..TX.WT.SHE...YG...

result:

ok Correct.

Test #12:

score: 0
Accepted
time: 1ms
memory: 3876kb

input:

2 1000
.D..JPYBD.H..F.I.NTFC.VJKS..Q.PBW..XLW.ZS..ATCTMPPKRK.V.NN.MPE.SPN.QODI.H...OR.V..INXOZMGF.KIS.GANJ.WV.YLALHHXO..M.TMTJ..XYP.N.BUENZCUA.I.XJO.Q.NVG.B.TXNI.TVLY.N.CWE.ZEO.ANYRZ.W.PQI.LORBYIYJIK.JZ.PENB.HPJPTIIGVOMF.RPZ..WFM.IS..H..U.ZEX.DXZU.YHM.UOMPOHV.HW..SZ.RHWXW.SZH.....R.X.R.L.JRYLL.CE.IE...

output:

YES
..JJPYBD.H..F.I.N.FC.VJKS..Q.PBW..XLW.ZS..ATCTMPPKRK.V.NN.MP..SPN..ODI.H....R.V..INXOZMGF.KIS.GANJ.WV.YLALHHXO.....MTJ...Y..N.BUENZCUA.I.XJO.Q.N.G.B....I.TVLY.N.CWE.ZEO.ANYRZ.WBPQI.LORBYIY..K.JZ.PENB.HPJPTI.GVOMF.RPZ..W.M.IS....QU.Z.X.D.ZU.Y.M.UO.POHV.HW..SZ..HWXW.SZ......R...R.L.J.YLL.CE.IEZDX....

result:

ok Correct.

Test #13:

score: 0
Accepted
time: 0ms
memory: 5044kb

input:

1000 1
.N.
N.N
G.G
...
...
.x.
U.U
...
.x.
P.P
K.K
..O
.x.
.x.
Y.Y
...
.x.
..D
.x.
...
J.J
Q.Q
E.E
.x.
A..
W..
.x.
H.H
D.D
...
...
E.E
..H
..A
.x.
...
C.C
..E
O.O
...
..Z
J.J
...
..Y
P.P
W.W
X.X
G.G
...
...
...
...
L.L
F.F
B.B
.x.
K.K
R.R
U.U
F.F
.x.
...
...
...
B.B
...
L.L
.x.
E.E
N.N
Z.Z
...
Z.Z
W...

output:

YES
N
G
.
.
.
U
.
.
P
K
O
.
.
Y
.
.
D
.
.
J
Q
E
.
A
W
.
H
D
.
.
E
H
A
.
.
C
E
O
.
Z
J
.
Y
P
W
X
G
.
.
.
.
L
F
B
.
K
R
U
F
.
.
.
.
B
.
L
.
E
N
Z
.
Z
W
.
.
.
I
V
P
.
.
J
K
D
X
Y
.
.
.
S
.
X
.
.
J
F
O
S
N
.
D
.
.
E
U
.
.
T
C
D
M
.
.
.
T
.
.
.
.
.
F
.
.
Y
E
K
.
.
.
.
T
.
.
.
.
G
T
.
A
.
H
R
X
.
.
.
.
U
...

result:

ok Correct.

Test #14:

score: 0
Accepted
time: 1ms
memory: 5084kb

input:

1000 2
.HE.
.xx.
....
H..E
..x.
Z..N
U.xU
..x.
Rx.R
A..A
D..L
J..T
..x.
A.xA
Ax.A
...V
.x..
F..F
.x..
U..Q
Bx.B
F..X
E..E
...G
B..V
..x.
.x..
..x.
E.xE
...I
..x.
...W
Tx.T
.x..
Tx.T
H..H
K..K
M..I
..xK
V..I
.x.Y
...V
....
A..M
B.xB
Hx.H
A.xA
...K
...X
O...
J..X
S..U
X..M
F.xF
..x.
M..I
D.xD
Y.xY
Hx....

output:

YES
..
HE
HE
..
ZN
U.
..
.R
AA
DL
JT
..
A.
.A
.V
..
FF
..
UQ
.B
FX
EE
.G
BV
..
..
..
E.
.I
..
.W
.T
..
.T
HH
KK
MI
K.
VI
.Y
.V
..
AM
B.
.H
A.
.K
.X
O.
JX
SU
XM
F.
..
MI
D.
Y.
.H
XF
SX
AK
.R
B.
..
..
KE
NN
Z.
..
BI
PV
ZD
.D
.G
..
RR
V.
.O
EE
..
C.
.J
SP
..
GG
JI
..
.P
DH
..
QQ
..
V.
ZL
W.
QC
P.
KK
.O...

result:

ok Correct.

Test #15:

score: 0
Accepted
time: 0ms
memory: 3796kb

input:

1 1
.M.
M.M
.M.

output:

YES
M

result:

ok Correct.

Test #16:

score: 0
Accepted
time: 0ms
memory: 3988kb

input:

2 2
.FG.
F..G
D..D
.DG.

output:

YES
FG
D.

result:

ok Correct.

Test #17:

score: 0
Accepted
time: 45ms
memory: 5092kb

input:

1000 1000
.SALZWWWEFVNIEX.ZDPPWJHROFIITXR.CSOKTMFFUGSA.UW.X.QYXWNAC.YCVHOGAHGZQAJWINRU.Z..CCFQKASZXMPWSQGILOT.N.PKGZ.JWPZ.ALPWSOFCMWABPW.ZAFSQQUASJHPIAMITPJEAJLKMGVGDOHFFNYKKXFHUIPFYDPQ.RWKD.PWLTQPZGPMYPQHOAGOHIDQMFGJU.MLXPCUK.ES.KZHPRLBGCTGYHPVYMX.DFAZODQ.QXANEJTISMUGV.LIGKZDSNOC.NDWM.N.JYHJIWCBQ.L...

output:

YES
..LZW..EFV.IEX.ZDPPW.HROF.ITXR..SOKT.FFU.S..UW.X.QY.WNAC.YCVHOGAHGZQ.JW.NRU.Z...CF..A..XMPW.Q...OT.N.PKGZ..WPZ.ALP.SOFCMWABPW.ZAFSQQ.ASJHPI.M.TPJ.A.LKMGVG.OHFFNYK.XFHU.PF.DPQ...KD..WLT.PZGP...Q.OA.O.ID.MFGJU..LX...K.ES.KZHPR..GCTGYHPV..X..FA.O.Q.QXANE...S.UG....GKZDS..C.NDW..N..YHJIW.B..LIU.N.NI...

result:

ok Correct.

Test #18:

score: 0
Accepted
time: 50ms
memory: 4820kb

input:

1000 1000
..EYLAGAENPDPZMGY.K.MSRTZBHDENS..YJRW.IWCLBIQQICT.ODBUMXFPO.UDPELUBMQSLZ.EHIVABC.ME.NQQI..QEHTIIFGJQWZSLDNDKGWA.UGMR.CJ.RPAQYJUAIIFQAMRAWECAAFHV.GUGIXROGEYDUX.FUUP.JKSYZITIHMSCKEQQKU.SFAXDPIPSHHYGGYLLEHUHZYRKYBKNAAOAWZHPRKHIQRZJXO.LMJUHDR.AWTBOEEJIHRH.XBUDQHGHKSL.SKW.SZZNIZAF..PK.NVOIMECDI...

output:

YES
.......................ZB.DE.S..Y.RW.IW.L.IQ..CT.O.BUMX....UD.ELUB.QSL..E..VABC.ME.N..I...EHT..F...W.S.D..KGW..UG.R.C...PAQYJUAIIFQA.R....AAFHV.GUG..ROG..DUX...U..J.S....IHMSCKE...U...AXDP...HH.G..L.E.UHZY.KY.K.AAOA..HPR.HI.RZJ...LMJUH....WT..E.JI.RH..BU..HGHK.L.S...SZZ.I..F........IME..IKXFG.J....

result:

ok Correct.

Test #19:

score: 0
Accepted
time: 44ms
memory: 4888kb

input:

1000 1000
.YOTYESJGMDJYFO.GICQVC.PBBNUUXFEIX.OJ.DBWOESWK.TEI.DITEQKIKC.QOTZBX..UB..SW.ODDBU.ZDILJKQYEM.CXOWRNAX.RYRPM.VMVYI.PBYXXUDDAFQUMAI..UFRHYOQA.PUWEP.AHEMMHMRCEZRFJQRWKLVXA.HXPHIMHV.SEHGFEJB.WRT.EYCWPI.CTERLDCPFUXKOWGIVNJKKOPUZRZI..NCHBODRTVKZRNHGTOQTYAKSEBA.TEX..EFIVBSBFOAJ.M.PXGTMHN.PRAPFIDD...

output:

YES
..............X.IC......BN......X..J...W.ESWK.......TEQ.I...QOT..X..UB..S...D..U..D.L..QYEM..XOWRNA..RY..M.V..Y..P...X......U.A...UFRH...A.PU.E..AHE.M....EZR.J.RWK.VX..HX.H.M....E.GF.JB..RT.E.C.PI.C.E.L.CP..X..W.I.N..KO..ZRZI..N....DR.V.Z.N.GTOQ.Y..SE.A.T.X..E..VB.BFO.J.M.PX..MH..PRAPF..DH.O.G.T...

result:

ok Correct.

Test #20:

score: 0
Accepted
time: 37ms
memory: 4880kb

input:

1000 1000
.HXXXGGPVDEYBGKDYLMRYKPIY.B..BQBPSH.DHV.RNWZKUYVSVELVLW.IAZZSBAGJSPHY..LFURSTQY.BTDPZ.GQCCNHBHJNUBDRQRGESN.TIGYPZVZ..MAWLKSUBOR.OJ.FEYPDJBAI.WV.EYBPRKNB.V.NY.QESGNGLNTUF.EY.EOIUPSETRWU.AWLP.DCBRZ.IDJIZW.UEJYDHPYOJPH.QJJAR.EOYFQKOSXUK.LNXOHJNINT.NVJFEGZOMSJQT.XHISZWU.Z.GYGELPGGDVTFAGA.TSYDN...

output:

YES
.....................P......BQ..S..........KUY......L.......B..............T......P.....C..B.J........................WL..........F.......I........R.NB.........G.G.............P.........L..D......DJ.Z........P...P..Q......O...................T.........M.....X.......Z...G.L.GGD....G..........M......

result:

ok Correct.

Test #21:

score: 0
Accepted
time: 33ms
memory: 4864kb

input:

1000 1000
.CCFMBZB.AUU.H.ZXYVAIMTA.D.JJIPERQWJVCTTAKSARUVYRPOPQMNFTNMPUBAZLCD.NXITOLEGFETDCOOBBGTL.U.IDCGBOOWFZ.VAWT.BXDK.YXRPTAVKNVAEMTDFY.UEUJCXSVZTYVJIN.ZOXGSTHSGUJWPTSLSUKFZDICKCPNTF.TTVUZUWAWFIPJ.HSXCJWRLDXZPXSHYLE..VZDEXCIGCFVBJBRNLAZDYXYGBDSRJUKRLVGREJGHMBFFK.SQSFXVDXBOULXPVHXPXKDZADDQA.JJCLE...

output:

YES
.................................................................................................W.........................................Y..........................................................D.............................................................X......................................

result:

ok Correct.

Test #22:

score: -100
Wrong Answer
time: 9ms
memory: 4880kb

input:

1000 1000
.YYJG..U..V.ZKZL.MR.Y.BFP.RK.Y...Y.P...LZ.HB.FECA.O...DDWYTFMKZZ.RZ..AJD....ND.P.B...MPYOAU.DYJX..Y.UEUN..IVDN.C..WXXF...FRP...A..NP.B.O.Z.D..LFC.F..TR.G..M..ULQ..VPC..X.DHPY..UGO.F.P.BM.R..HXJ..STSJMS.Q.AZMF.EF..OXMSV.BAG..ADIR.FD.QDJN.DM...NKI...IYMNE.CP...J...G.KSX..B.J.HLYJC.PMBBJG.F.....

output:

NO

result:

wrong answer Jury has answer but participant has not.