QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#293164#4833. Tetra-puzzleucup-team1447#0 16ms134756kbC++144.6kb2023-12-28 22:26:442023-12-28 22:26:45

Judging History

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

  • [2023-12-28 22:26:45]
  • 评测
  • 测评结果:0
  • 用时:16ms
  • 内存:134756kb
  • [2023-12-28 22:26:44]
  • 提交

answer

// This Code was made by Chinese_zjc_.
#include <bits/stdc++.h>
const char s[] = {'I', 'L', 'O', 'T', 'Z'};
const int v[4][2] = {{+1, 0}, {0, +1}, {-1, 0}, {0, -1}};
const int xx[5][4] = {
    {0, 0, 0, 0},
    {0, 0, 0, 1},
    {0, 0, 1, 1},
    {0, 1, 1, 2},
    {0, 1, 1, 2}};
const int yy[5][4] = {
    {0, 1, 2, 3},
    {0, 1, 2, 2},
    {0, 1, 1, 0},
    {0, 0, 1, 0},
    {0, 0, 1, 1}};
int get(char c) { return std::find(s, s + 5, c) - s; }
bool able(int A, int B)
{
    int X = B >> 7 & 7, Y = B >> 4 & 7, Sx = B >> 2 & 3, Sy = B & 3, add = 0;
    if (Sx % 2 == Sy % 2)
        return false;
    for (int i = 0; i != 4; ++i)
    {
        int tx = X + xx[A][i] * v[Sx][0] + yy[A][i] * v[Sy][0], ty = Y + xx[A][i] * v[Sx][1] + yy[A][i] * v[Sy][1];
        if (tx < 0 || tx >= 5 || ty < 0 || ty >= 5)
            return false;
        add |= 1 << (tx * 5 + ty);
    }
    return true;
}
int fill(int A, int B)
{
    int X = B >> 7 & 7, Y = B >> 4 & 7, Sx = B >> 2 & 3, Sy = B & 3, res = 0;
    assert(Sx % 2 != Sy % 2);
    for (int i = 0; i != 4; ++i)
    {
        int tx = X + xx[A][i] * v[Sx][0] + yy[A][i] * v[Sy][0], ty = Y + xx[A][i] * v[Sx][1] + yy[A][i] * v[Sy][1];
        assert(0 <= tx && tx < 5 && 0 <= ty && ty < 5);
        res |= 1 << (tx * 5 + ty);
    }
    return res;
}
int clear(int A)
{
    int del = 0;
    for (int i = 0, j = 0b0000100001000010000100001; i != 5; ++i, j <<= 1)
        if ((A & j) == j)
            del |= j;
    for (int i = 0, j = 0b0000000000000000000011111; i != 5; ++i, j <<= 5)
        if ((A & j) == j)
            del |= j;
    return A ^ del;
}
void print(int A, int B)
{
    for (int i = 0; i != 5; ++i, std::cout << std::endl)
        for (int j = 0; j != 5; ++j)
            std::cout << (B >> (i * 5 + j) & 1 ? (A >> (i * 5 + j) & 1 ? '#' : '*') : '.');
}
std::vector<int> to[5];
int r[1 << 25];
int eval(int x)
{
    if (r[x] >= 0)
        return r[x];
    std::vector<int> p(5);
    for (int i = 0; i != 5; ++i)
        for (auto j : to[i])
            p[i] += !(x & j);
    std::sort(p.begin(), p.end());
    return r[x] = 100000 + p[1] * 4 + p[2] * 3 + p[3] * 2 + p[4] * 2;
}
int tmp;
int trans(int A, int B)
{
    int bes = (1 << 25) - 1;
    for (auto i : to[B])
    {
        if (A & i)
            continue;
        int lst = A | i;
        int nxt = clear(A | i);
        if (eval(bes) < eval(nxt))
            bes = nxt, tmp = lst;
    }
    return bes;
}
std::string who;
int n;
signed main()
{
    std::memset(r, -1, sizeof(r));
    std::ios::sync_with_stdio(false);
    for (int i = 0; i != 5; ++i)
        for (int j = 0; j != 1 << 10; ++j)
            if (able(i, j))
                to[i].push_back(fill(i, j));
    for (int i = 0; i != 5; ++i)
    {
        std::sort(to[i].begin(), to[i].end());
        to[i].erase(std::unique(to[i].begin(), to[i].end()), to[i].end());
    }
    // for (int i = 0; i != 1 << 25; ++i)
    // {
    //     if (clear(i) != i)
    //         continue;
    //     r[i] = eval(i);
    // }
    // std::queue<int> que;
    // que.push(0);
    // while (!que.empty())
    // {
    //     int now = que.front();
    //     que.pop();
    //     std::vector<int> p;
    //     for (int t = 0; t != 5; ++t)
    //     {
    //         int bes = -1, val = -1;
    //         for (auto i : to[t])
    //             if (!(now & i) && r[clear(now | i)] > val)
    //                 bes = clear(now | i), val = r[clear(now | i)];
    //         if (bes != -1)
    //             p.push_back(bes), std::cout << t << std::endl;
    //     }
    //     print(now, now);
    //     assert(p.size() >= 4);
    //     std::sort(p.begin(), p.end(), [&](const int &A, const int &B)
    //               { return r[A] > r[B]; });
    //     for (int i = 0; i != 4; ++i)
    //         que.push(p[i]);
    // }
    // return 0;
    std::cin >> who;
    if (who == "prepare")
    {
        std::cin >> n;
        int cur = 0;
        for (int i = 0; i != n; ++i)
        {
            static char a, b;
            std::cin >> a >> b;
            int A = trans(cur, get(a)), B = trans(cur, get(b));
            if (r[A] > r[B])
                std::cout << a, cur = A;
            else
                std::cout << b, cur = B;
        }
    }
    if (who == "play")
    {
        std::cin >> n;
        int cur = 0;
        for (int i = 0; i != n; ++i)
        {
            static char c;
            std::cin >> c;
            int C = trans(cur, get(c));
            print(cur, tmp);
            cur = C;
        }
    }
    return 0;
}

Details

Tip: Click on the bar to expand more detailed information

Test #1:

score: 100
Accepted
time: 3ms
memory: 134756kb

First Run Input

prepare
6
TO LO ZI LI LT LT

First Run Output

OLIILL

Second Run Input

play
6
O
L
I
I
L
L

Second Run Output

**...
**...
.....
.....
.....
##..*
##***
.....
.....
.....
##..#
.*...
.*...
.*...
.*...
#...#
*....
*....
*....
*....
***.#
*....
.....
.....
.....
###.#
#....
*....
*....
**...

result:

ok good job!

Test #2:

score: 100
Accepted
time: 3ms
memory: 134752kb

First Run Input

prepare
1
ZI

First Run Output

I

Second Run Input

play
1
I

Second Run Output

****.
.....
.....
.....
.....

result:

ok good job!

Test #3:

score: 100
Accepted
time: 4ms
memory: 134708kb

First Run Input

prepare
10
LO TZ ZO OI OL ZL ZO TL OZ LO

First Run Output

LTZILLOTOL

Second Run Input

play
10
L
T
Z
I
L
L
O
T
O
L

Second Run Output

***..
*....
.....
.....
.....
###..
#....
*....
**...
*....
*##..
**...
.*...
.#...
.....
###..
##...
.#...
.#...
.****
#.#..
#....
*....
*....
**###
**#..
*....
*....
.....
.....
###**
#..**
#....
.....
.....
.*...
#**##
#*...
.....
.....
.#...
.....
##...
**...
**...
*#...
***..
##...
##...
##...

result:

ok good job!

Test #4:

score: 100
Accepted
time: 4ms
memory: 134584kb

First Run Input

prepare
29
ZT OT ZL LT ZI LO IZ LT OI ZT ZT OL ZI LT LZ TZ IL ZI OT LZ LT LZ OT OI IO OZ IZ ZL ZL

First Run Output

TTZLILILITTLILLTLZTZTLTIIZZLL

Second Run Input

play
29
T
T
Z
L
I
L
I
L
I
T
T
L
I
L
L
T
L
Z
T
Z
T
L
T
I
I
Z
Z
L
L

Second Run Output

***..
.*...
.....
.....
.....
###..
.#...
.*...
**...
.*...
#*#..
**...
*....
#....
.....
###..
##...
#*...
#*...
**...
..#..
..*..
..*..
..*..
..*..
***..
*....
.....
.....
.....
###..
#.*..
..*..
..*..
..*..
##***
#...*
.....
.....
.....
****.
#...#
.....
.....
.....
####.
#***#
..*..
.....
.....
...

result:

ok good job!

Test #5:

score: 100
Accepted
time: 12ms
memory: 134696kb

First Run Input

prepare
36
TI ZT IT IT OT OZ IL TZ ZO LO LZ ZL OT ZI IL OT OT ZI ZT TZ TI LT LO OL IL OL IZ OZ OL ZL LT IO ZO ZL ZO LT

First Run Output

ITTITOLZOLLLTIIOTITTILOLILIOLLLIOLOL

Second Run Input

play
36
I
T
T
I
T
O
L
Z
O
L
L
L
T
I
I
O
T
I
T
T
I
L
O
L
I
L
I
O
L
L
L
I
O
L
O
L

Second Run Output

****.
.....
.....
.....
.....
####*
...**
....*
.....
.....
.*...
***##
....#
.....
.....
.#...
.....
****#
.....
.....
*#...
**...
*....
.....
.....
##...
##...
#....
**...
**...
*#...
*#...
**...
.#...
.#...
#....
#....
#*...
**...
*....
**...
**...
.#...
.#...
.....
##...
##...
*#...
*#...
**...
...

result:

ok good job!

Test #6:

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

First Run Input

prepare
57
LT OI TL IZ OT TL LT TI LO LT LO LO OL IO LI IT TZ TZ IO ZT TI OT OI TL TL ZT TZ OL OI LI OZ ZI TO LZ IO IO LT OZ TO OZ IZ TZ LT ZO TO TZ OT LT ZO OL IL LO ZT OZ OL IL ZI

First Run Output

LILITLLTLLLLLIIITTITTTILLZZLIIOZTZIITOTOITTOTZTLOLLLZZLLI

Second Run Input

play
57
L
I
L
I
T
L
L
T
L
L
L
L
L
I
I
I
T
T
I
T
T
T
I
L
L
Z
Z
L
I
I
O
Z
T
Z
I
I
T
O
T
O
I
T
T
O
T
Z
T
L
O
L
L
L
Z
Z
L
L
I

Second Run Output

***..
*....
.....
.....
.....
###..
#.*..
..*..
..*..
..*..
##***
#...*
.....
.....
.....
****.
#...#
.....
.....
.....
####.
#***#
..*..
.....
.....
####*
....*
..#**
.....
.....
*....
*...#
**###
.....
.....
#.*..
#***#
.....
.....
.....
#.#**
....*
....*
.....
.....
#.###
....#
....#
....*
..***
...

result:

ok good job!

Test #7:

score: 100
Accepted
time: 3ms
memory: 134752kb

First Run Input

prepare
88
ZL OL OT IT LO ZL OI ZT TO OI OL OL LZ ZT TL TZ IO ZL TZ TO IL LO ZT OL LT ZI TZ IL LT ZL OT TI ZO ZO ZT OZ TL TL LO OI TO OZ LI ZO ZT ZT IO IZ OZ ZO ZI ZO IO IO TI OL IL IT IL TL TL ZL IT IT ZO IO OL IL ZI TO OL IL ZI LZ LT IL LI ZO IL TL IT LI ZI OL TO OZ IZ OZ

First Run Output

LLTILLITTILLZTLZILZTIOTLTITILLTIOZTOLLLITZLZTTIIZZIOIOILIIITTZIIOILIIOLIILLLIOLLIIILOOIO

Second Run Input

play
88
L
L
T
I
L
L
I
T
T
I
L
L
Z
T
L
Z
I
L
Z
T
I
O
T
L
T
I
T
I
L
L
T
I
O
Z
T
O
L
L
L
I
T
Z
L
Z
T
T
I
I
Z
Z
I
O
I
O
I
L
I
I
I
T
T
Z
I
I
O
I
L
I
I
O
L
I
I
L
L
L
I
O
L
L
I
I
I
L
O
O
I
O

Second Run Output

***..
*....
.....
.....
.....
###**
#...*
....*
.....
.....
..*..
#***#
....#
.....
.....
..#..
.....
****#
.....
.....
**#..
*....
*....
.....
.....
###**
#...*
#...*
.....
.....
****.
#...#
#...#
.....
.....
####.
#.*.#
#***#
.....
.....
####.
#.#.#
..*..
.**..
..*..
##.#.
#..*#
...*.
.#.*.
...*.
...

result:

ok good job!

Test #8:

score: 100
Accepted
time: 8ms
memory: 134612kb

First Run Input

prepare
105
LI LI OI TL OZ LZ IL IZ IL TI IL IO OT LT LO ZO LI LZ OI IL ZT IT LZ IZ IZ LI IT LI IO TI ZL OI IT LO TZ OI IL OL IL OT IL OZ LT IO OL OL LO ZO TI LI LI LI ZO ZI LI OL TI TZ LO LT IL LZ IL OL ZT LT IZ IL TZ IT OZ TL ZI IZ IZ TO IT IO TO TI TO TZ ZT IZ LI IL ZI TI TL TZ TO LI LO OL IL IL ...

First Run Output

IIILOLIIIIIIOLLZIZIITTZIILIIIILIILTILLLOIZLILLLOILLIZILOITLLLLILTLZIZTZLIIITTITIOTTILIIILTTILLIITOLLZITIL

Second Run Input

play
105
I
I
I
L
O
L
I
I
I
I
I
I
O
L
L
Z
I
Z
I
I
T
T
Z
I
I
L
I
I
I
I
L
I
I
L
T
I
L
L
L
O
I
Z
L
I
L
L
L
O
I
L
L
I
Z
I
L
O
I
T
L
L
L
L
I
L
T
L
Z
I
Z
T
Z
L
I
I
I
T
T
I
T
I
O
T
T
I
L
I
I
I
L
T
T
I
L
L
I
I
T
O
L
L
Z
I
T
I
L

Second Run Output

****.
.....
.....
.....
.....
####.
...*.
...*.
...*.
...*.
###..
..*..
..*..
..*..
..*..
##***
....*
.....
.....
.....
.....
....#
.....
...**
...**
...**
...*#
...*.
...##
...##
....#
****#
.....
....#
....#
....#
.....
.....
****#
....#
****#
.....
.....
.....
....#
....*
....*
....*
....*
....#
...

result:

ok good job!

Test #9:

score: 100
Accepted
time: 4ms
memory: 134660kb

First Run Input

prepare
204
TZ TL OL TL ZO OT ZO LI TZ IO TI OL LZ TI TO ZT IL OI LT IT OZ TI OT TI ZL ZI ZO TI OI ZI TL LI ZI IO TI ZL LZ OL ZI TZ OI OI IZ LO IL LO IZ ZT ZT OL ZI OZ TL OI TI IT IZ ZL TI OI LZ OI TZ IZ IO OZ ZI TO OT TI TO IO IZ OI TZ LT TZ ZI OL LO LO OZ LO ZL LZ TZ LT TO OL LO LT TZ TL OZ ZO LO ...

First Run Output

TLLLOTZLTIILLITTLILIOTOTZIOTIILIIIILLLITIIZLLLITTLIOTOIIILIOZITIIZIOOIOIZITLZILLLZLLLTLTLLLTLZOLOLTITLOLLTZILTILOIOILOTIILZIITZIILZLZLIIIITLTLLTLILLZILZTZLIILIZOLLILILOIIOTLZITLTIILTIIILITILLIOILLLZLLTLZL

Second Run Input

play
204
T
L
L
L
O
T
Z
L
T
I
I
L
L
I
T
T
L
I
L
I
O
T
O
T
Z
I
O
T
I
I
L
I
I
I
I
L
L
L
I
T
I
I
Z
L
L
L
I
T
T
L
I
O
T
O
I
I
I
L
I
O
Z
I
T
I
I
Z
I
O
O
I
O
I
Z
I
T
L
Z
I
L
L
L
Z
L
L
L
T
L
T
L
L
L
T
L
Z
O
L
O
L
T
I
T
L
O
L
L
T
Z
I
L
T
I
L
O
I
O
I
L
O
T
I
I
L
Z
I
I
T
Z
I
I
L
Z
L
Z
L
I
I
I
I
T
L
T
L
L
T
L
I...

Second Run Output

***..
.*...
.....
.....
.....
###..
.#...
.*...
.*...
**...
#.#..
**...
*....
*....
#....
**#..
*#...
*....
.....
.....
###**
##.**
#....
.....
.....
.***.
##*##
#....
.....
.....
*###.
**...
#*...
.....
.....
####*
##***
##...
.....
.....
.....
...*.
##***
.....
.....
.****
...#.
.....
.....
.....
...

result:

ok good job!

Test #10:

score: 100
Accepted
time: 7ms
memory: 134656kb

First Run Input

prepare
303
ZT ZT IO ZL LT TI LO LZ TI ZT TI ZT LO OZ ZT TL IT TZ ZI IL TL OZ IO OT ZT TI LT ZT ZL ZL IO LZ IZ IZ ZT TZ OT OI LZ IL IZ TL IT ZO TL ZL IZ IZ LO LO ZI TI OT ZT OI IT ZI IL OI TO ZL LI TL LT OI LZ TI TZ OL ZO OZ IL LO ZT ZL IT TO ZI TZ IL IO LO LT IT OL LO ZT OZ OI TI OL OZ ZI IT IO IT ...

First Run Output

TTIZLILLTTITLZZLITILTOITTTTTLLILIITTTILLILTOLZIILLIIOTITILITLLTLILITLOZILTZITITIILTILLTOITLOITITILILTLIZLLTIIIOLZTTLZOILTILZILZTOTIZIOIIIILLIOIITLLLLILILOTILIIIITTOTITLLILILLLLLLILZZLIIIIIOTOLOLZLLZLLTITZLITTOTLLLIOTITIIOLIOITZILZZITTLLLIIILZZIOLIIOLLLTILLLLTIIIIILTTLLTIILILLIIOILOLOTLZIIITIILTILLZTTLT

Second Run Input

play
303
T
T
I
Z
L
I
L
L
T
T
I
T
L
Z
Z
L
I
T
I
L
T
O
I
T
T
T
T
T
L
L
I
L
I
I
T
T
T
I
L
L
I
L
T
O
L
Z
I
I
L
L
I
I
O
T
I
T
I
L
I
T
L
L
T
L
I
L
I
T
L
O
Z
I
L
T
Z
I
T
I
T
I
I
L
T
I
L
L
T
O
I
T
L
O
I
T
I
T
I
L
I
L
T
L
I
Z
L
L
T
I
I
I
O
L
Z
T
T
L
Z
O
I
L
T
I
L
Z
I
L
Z
T
O
T
I
Z
I
O
I
I
I
I
L
L
I
O
I
I
T
L...

Second Run Output

***..
.*...
.....
.....
.....
###..
.#...
.*...
**...
.*...
#.#..
..*..
..*..
#.*..
..*..
#*...
**...
*....
#....
.....
##...
##...
#*...
#*...
**...
****.
.....
.....
.....
.....
####*
....*
...**
.....
.....
.....
*...#
***##
.....
.....
..*..
#***#
.....
.....
.....
*.#..
**...
*....
.....
.....
...

result:

ok good job!

Test #11:

score: 100
Accepted
time: 16ms
memory: 134616kb

First Run Input

prepare
502
LO LI OZ LO IO ZT LO OZ OZ ZI IO OT ZO LZ IZ ZT TL TL LI IL IZ TO IO IL OL OL OL LO ZI OZ OZ ZO OZ IT OZ LZ TZ TO LZ TL ZL IZ LZ ZO ZL IO IL LI LT ZI OZ IZ OI TZ LI ZT IT LO TO ZI LT OT LZ OI LZ OZ LZ IT TO TI OI TO TO OI TZ ZL IO OZ ZO ZL LZ IZ OI TL TO TI LZ ZL ZL OZ TI ZI TL LO ZT LI ...

First Run Output

LIOLITLZOIOTZLZTLLIIITILLLLLIZZOZIOLZTLTZILOLIIILIZIOTITIOTILTLILZLITIITTITLIZOZLIILOTLLLOTILLTIOIOZTTILLLLOLOTLZTLOLTLTLLOTOLLIILIZLLILIILOOZITZZTLLLOLILILTLLILIILILLLLTLTTIOLIOLZLTTTZLLITZZLOOILZOTTZTITTLLLZOZIITITZZLZLLZTTIILIOLTILLTLZZILLIOOIIIITTLLTZLOILIILLLZTITILILLILIIIIITIILIIZIZZILLLIILIOL...

Second Run Input

play
502
L
I
O
L
I
T
L
Z
O
I
O
T
Z
L
Z
T
L
L
I
I
I
T
I
L
L
L
L
L
I
Z
Z
O
Z
I
O
L
Z
T
L
T
Z
I
L
O
L
I
I
I
L
I
Z
I
O
T
I
T
I
O
T
I
L
T
L
I
L
Z
L
I
T
I
I
T
T
I
T
L
I
Z
O
Z
L
I
I
L
O
T
L
L
L
O
T
I
L
L
T
I
O
I
O
Z
T
T
I
L
L
L
L
O
L
O
T
L
Z
T
L
O
L
T
L
T
L
L
O
T
O
L
L
I
I
L
I
Z
L
L
I
L
I
I
L
O
O
Z
I
T
Z
Z...

Second Run Output

***..
*....
.....
.....
.....
###..
#.*..
..*..
..*..
..*..
##.**
#..**
.....
.....
.....
##.##
#..##
...*.
...*.
...**
##..#
#*..#
.*...
.*...
.*..#
#.*.#
#***#
.....
.....
....#
#.#.#
...**
....*
....*
....#
#*#..
**.#.
*....
.....
.....
###..
##.#.
#....
**...
**...
.##..
.#.#.
.****
.#...
.#...
...

result:

ok good job!

Test #12:

score: 100
Accepted
time: 4ms
memory: 134700kb

First Run Input

prepare
801
TL TL TZ LO LO TI ZI LI LZ OT OZ LT OL IL OZ OT OT IO ZL OZ OT ZL LO TO TZ TL OI ZO TI ZI TO IT ZL TZ IZ IT IL ZO IO LT ZI OZ LO TI OI TO LI IL LT LZ LT OZ IL LZ ZO ZT IL ZL TZ OI IZ TL ZI OT TO IL IO OZ IO ZL OT IZ IZ IT IT OI OZ ZL ZT ZT OI IT IZ IL ZL LZ TI IZ IZ IZ ZI LT ZT LZ IO LZ ...

First Run Output

LLTOLIIILTZLOLOTTOLOOZLTTLOOIITILTITIOILIZLIITIILZLOLLOTLLZIILITTLOZILOZIIIIOLZTIIIILLIIIIILTLIZTILLLTLLLOTITIILLILILIIIOTLOLITLLILOLIILLIZIOLLLLTITIIITLTIIIOOTLILIZTIILLLLIIOTIILIITZLLIZOLLTILILIIZLTILLZIOOLILILIITILILLILLTILLILLIIITIITTIZTILOLILIOZILLITTZOLTTOLIIIILIOTIZLOITTIILOIITILITLILITOTLTZT...

Second Run Input

play
801
L
L
T
O
L
I
I
I
L
T
Z
L
O
L
O
T
T
O
L
O
O
Z
L
T
T
L
O
O
I
I
T
I
L
T
I
T
I
O
I
L
I
Z
L
I
I
T
I
I
L
Z
L
O
L
L
O
T
L
L
Z
I
I
L
I
T
T
L
O
Z
I
L
O
Z
I
I
I
I
O
L
Z
T
I
I
I
I
L
L
I
I
I
I
I
L
T
L
I
Z
T
I
L
L
L
T
L
L
L
O
T
I
T
I
I
L
L
I
L
I
L
I
I
I
O
T
L
O
L
I
T
L
L
I
L
O
L
I
I
L
L
I
Z
I
O
L
L
L
L
T...

Second Run Output

***..
*....
.....
.....
.....
###**
#...*
....*
.....
.....
..*..
#***#
....#
.....
.....
..#**
...**
....#
.....
.....
*.###
***##
....#
.....
.....
#.###
.....
****#
.....
.....
#.###
..*..
..*..
..*..
..*..
#..##
...*.
...*.
...*.
...*.
#***#
.*...
.....
.....
.....
.***.
.#*..
.....
.....
.....
...

result:

ok good job!

Test #13:

score: 100
Accepted
time: 16ms
memory: 134664kb

First Run Input

prepare
1000
LT LT TO OL ZI OI IO IL TO IO IT LZ ZL ZL OL OI OL TO IO OL IZ ZO TZ OZ TL LT IZ LO IZ IO IO ZT IO TZ LI ZL ZT LT TL TL IL TI OZ LO TO OI LI LI OL ZI ZI TI IO OL ZT LT ZL ZI TZ TL OT ZL OT TI OL IT ZL IT OT LZ LZ LZ IL OZ LO ZI TZ IT TO TZ OZ ZI IT TZ LZ ZT ZO LT OT TI OZ LI OZ TL LO OT...

First Run Output

LLTOIIOLTOTLLLLILTILIOZOTLILIIITITLLZLLLITOLTILLLIIIILTLZITLTZTILTLITLLZLOLIZTTTOZITLTOLTTOLZTLTLTOIOLILTLILOLIIIILIOTTLZILZIZTITOILLITIOLILLOLOTIOTOLILIIIOIZLLITTILLLLILILLTLTLTLTTILILLLTTTZITTLLITILTIOITILZTIILILTIIILILILILILOZIZLTILOOLOLLITLLLLLTTLIZIOOTTTTOOLLLITLLIILILILTTIIIZLILILTITOLIILLILIO...

Second Run Input

play
1000
L
L
T
O
I
I
O
L
T
O
T
L
L
L
L
I
L
T
I
L
I
O
Z
O
T
L
I
L
I
I
I
T
I
T
L
L
Z
L
L
L
I
T
O
L
T
I
L
L
L
I
I
I
I
L
T
L
Z
I
T
L
T
Z
T
I
L
T
L
I
T
L
L
Z
L
O
L
I
Z
T
T
T
O
Z
I
T
L
T
O
L
T
T
O
L
Z
T
L
T
L
T
O
I
O
L
I
L
T
L
I
L
O
L
I
I
I
I
L
I
O
T
T
L
Z
I
L
Z
I
Z
T
I
T
O
I
L
L
I
T
I
O
L
I
L
L
O
L
O
T
...

Second Run Output

***..
*....
.....
.....
.....
###**
#...*
....*
.....
.....
..*..
#***#
....#
.....
.....
..#**
...**
....#
.....
.....
..###
...##
****#
.....
.....
..###
..*##
..*..
..*..
..*..
**.##
**.##
.....
.....
.....
##*##
##*##
.**..
.....
.....
*....
**...
*##..
.....
.....
#....
##.**
###**
.....
.....
...

result:

ok good job!

Test #14:

score: 100
Accepted
time: 15ms
memory: 134636kb

First Run Input

prepare
1000
LI ZL ZL OZ ZT ZO IO OZ OI ZI IL ZI OT OI TL TI IT IT TO ZO TI LZ IL IZ OL ZT LZ ZL TI IT TZ LZ IZ OZ ZI ZO IL OL TI OI ZT OL IO OL TZ LT IO ZO TL OT TO ZT OZ TO IO LT ZL TI ZL ZL ZL ZL TL TL TO ZI TI OT TZ OI IL OT TI LI ZT OT IO LT OT OZ IO IL OL TI OT TZ LT OI IO ZO TI IT OT ZT OZ LT...

First Run Output

ILLOTOIZIIIITOTIIITOTZLILZZLIITLIZIZLLIITLILTLIOTOTTOTILZTLLLLLLTZITTILTIITTILTOILLITTLIIOTIOTZLOTTLIZLTIITTLOLLZLILITTTITLLZZILIITTTZLOTLLZTIZTIOTIOILITLZLTITZTLILLLIIIITTLILLILLLIILIILTLTITILTTTTIZLZLOZIILLLLZZTLOZLTTLIITTTZITILZILLILLLLTITTLOIOLOTIOITIOITTTIIZOOTIOTTLILLTOITILIIILTLZTLITLTLOTIOIL...

Second Run Input

play
1000
I
L
L
O
T
O
I
Z
I
I
I
I
T
O
T
I
I
I
T
O
T
Z
L
I
L
Z
Z
L
I
I
T
L
I
Z
I
Z
L
L
I
I
T
L
I
L
T
L
I
O
T
O
T
T
O
T
I
L
Z
T
L
L
L
L
L
L
T
Z
I
T
T
I
L
T
I
I
T
T
I
L
T
O
I
L
L
I
T
T
L
I
I
O
T
I
O
T
Z
L
O
T
T
L
I
Z
L
T
I
I
T
T
L
O
L
L
Z
L
I
L
I
T
T
T
I
T
L
L
Z
Z
I
L
I
I
T
T
T
Z
L
O
T
L
L
Z
T
I
Z
T
I
...

Second Run Output

****.
.....
.....
.....
.....
####*
....*
...**
.....
.....
.....
*...#
***##
.....
.....
.....
#...#
.....
**...
**...
..*..
#***#
.....
##...
##...
**#..
**...
.....
##...
##...
###..
##*..
..*..
##*..
##*..
##...
##**.
.**..
##...
##...
#....
#.##.
..#..
#****
#....
#....
#.##.
..#..
.....
#****
...

result:

ok good job!

Test #15:

score: 100
Accepted
time: 12ms
memory: 134616kb

First Run Input

prepare
1000
LI LI TO TO ZL TO OI ZO TO TI TZ IT OL IZ OZ ZO TO ZL LT TI IZ TL IL TO TZ TO LZ ZT OZ ZT OI IO OI LZ LT ZI LI IZ TO OL ZI TI LO ZT TO IZ IO LO ZI IO IT TL LZ TL LO TO OL IO TZ IT TI IT IT OL ZT OL LO LZ ZI ZI ZO ZT IO OL LT TO IL ZL TI LO ZL LO LT IL IT OI OT OZ TO IT LT LZ LI IT OT ZI...

First Run Output

IIOTLTOOTIZILZZZOLLIILLOTTLTZTIIILLILITLITLTTZILIOILLLLOLIZTIIILTLLLIIZZILLOLLILLLLIIIOOTILLIITIITILZTITIIITLILLLZIOLTLZZITTIIOLIIILTIILIOZIOOIILLTTTITLIITITLITTLZZLIIZLLITTLLLTZTLTTTTITILOZIIILLOTIIOLLIITILOLLOOILIIIILLTTLILTLITLLTILLITITOILITZTTTTILZIZIITITLLZLILIILTZLTTTLIZOIIIOILITLITLTILIIIITLI...

Second Run Input

play
1000
I
I
O
T
L
T
O
O
T
I
Z
I
L
Z
Z
Z
O
L
L
I
I
L
L
O
T
T
L
T
Z
T
I
I
I
L
L
I
L
I
T
L
I
T
L
T
T
Z
I
L
I
O
I
L
L
L
L
O
L
I
Z
T
I
I
I
L
T
L
L
L
I
I
Z
Z
I
L
L
O
L
L
I
L
L
L
L
I
I
I
O
O
T
I
L
L
I
I
T
I
I
T
I
L
Z
T
I
T
I
I
I
T
L
I
L
L
L
Z
I
O
L
T
L
Z
Z
I
T
T
I
I
O
L
I
I
I
L
T
I
I
L
I
O
Z
I
O
O
I
I
L
...

Second Run Output

****.
.....
.....
.....
.....
####.
...*.
...*.
...*.
...*.
###**
...**
.....
.....
.....
.*...
***##
.....
.....
.....
.#***
....*
.....
.....
.....
*####
**..#
*....
.....
.....
..**.
##**#
#....
.....
.....
**##.
**...
#....
.....
.....
####.
##...
#*...
**...
.*...
#.##.
#....
#....
#****
.....
...

result:

ok good job!

Test #16:

score: 0
Wrong Answer
time: 7ms
memory: 134596kb

First Run Input

prepare
1000
LZ TZ IT LO LO IL TZ OL LO OZ TZ TL LZ IT LZ OL ZI TO IZ ZI ZT ZT OL IL LI TI IZ LZ LI ZI OL LI IO ZL IL ZI TZ TZ LI IZ LZ ZO ZO ZO OZ TL TZ TO ZI IZ OZ LI IO IL LI TO IT LI OT TI OT IO TO OZ LO IT LT TI LZ TO TL OZ TL OZ TI ZI IT OZ OZ TL LT LT ZL ZI ZT OI LO LT IL IZ IT OI OT ZL IZ ZL...

First Run Output

LTILLLTLLZTLLIZOITZITTLIIIIZLILIILIITTIILOZOOLTTIIZLIIIOTITITITOLILILTTZLOTITZZLLLLITILLLIIIOLILIOTLZZLOIZLIIIOTILLLOLLITILIITIIIIIILIIIIILOTTLOLLLIIZLIILITILTLTZTITTTTIIOTILTZTZIOTTIIITILILLTOIIIIIZLOIILTILLIILILIZTILILZLOOILILZLLOOLIITITTTIOLOZLITIILIZTIILILTIZILITLIZIIIIIOTTLLITIILILTLLILOLZLIZZI...

Second Run Input

play
1000
L
T
I
L
L
L
T
L
L
Z
T
L
L
I
Z
O
I
T
Z
I
T
T
L
I
I
I
I
Z
L
I
L
I
I
L
I
I
T
T
I
I
L
O
Z
O
O
L
T
T
I
I
Z
L
I
I
I
O
T
I
T
I
T
I
T
O
L
I
L
I
L
T
T
Z
L
O
T
I
T
Z
Z
L
L
L
L
I
T
I
L
L
L
I
I
I
O
L
I
L
I
O
T
L
Z
Z
L
O
I
Z
L
I
I
I
O
T
I
L
L
L
O
L
L
I
T
I
L
I
I
T
I
I
I
I
I
I
L
I
I
I
I
I
L
O
T
T
L
O
L
...

Second Run Output

***..
*....
.....
.....
.....
###..
#....
*....
**...
*....
.##..
..*..
..*..
.#*..
..*..
.#...
.....
*....
*#...
**...
.#...
.....
#....
##***
##..*
.#...
.*...
#*...
**...
##..#
.....
.....
#....
#.*..
#***#
.....
.....
#....
#*#..
.***.
.**..
..*..
#.*..
###..
.###.
*#...
**...
#*...
##...
.#.#.
...

result:

wrong answer wrong answer: invalid set [B] on step 408