QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#710971#8981. Kangaroo PuzzlexhytomAC ✓2ms4084kbC++233.4kb2024-11-04 23:30:402024-11-05 18:08:00

Judging History

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

  • [2024-11-05 18:08:00]
  • 自动重测本题所有获得100分的提交记录
  • 测评结果:AC
  • 用时:2ms
  • 内存:4084kb
  • [2024-11-05 18:07:55]
  • hack成功,自动添加数据
  • (/hack/1130)
  • [2024-11-04 23:30:44]
  • 评测
  • 测评结果:100
  • 用时:1ms
  • 内存:3924kb
  • [2024-11-04 23:30:40]
  • 提交

answer

/*
 
_/      _/    _/      _/    _/      _/   _/_/_/_/_/     _/_/       _/      _/ 
 _/    _/     _/      _/     _/    _/        _/       _/    _/     _/      _/            
  _/  _/      _/      _/      _/  _/         _/      _/      _/    _/_/  _/_/         
   _/_/       _/_/_/_/_/        _/           _/      _/      _/    _/  _/  _/          
  _/  _/      _/      _/        _/           _/      _/      _/    _/      _/          
 _/    _/     _/      _/        _/           _/       _/    _/     _/      _/          
_/      _/    _/      _/        _/           _/         _/_/       _/      _/       
 
*/
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
using i64 = long long;
#define rep(i,a,n) for(int i=a;i<n;i++)
#define per(i,a,n) for(int i=n-1;i>=a;i--)
#define fastio ios::sync_with_stdio(false);cin.tie(0);cout.tie(0);
#define multi int _;cin>>_;while(_--)
#define int long long
#define pb push_back
#define eb emplace_back
ll gcd(ll a,ll b){ return b?gcd(b,a%b):a;}
mt19937_64 mrand(chrono::steady_clock().now().time_since_epoch().count());
int rnd(int l,int r){ return mrand() % (r - l + 1) + l;}
#ifdef localfreopen
#define debug(x) cerr << #x << " = " << (x) << endl;
void test() {cerr << "\n";}
template<typename T, typename... Args> 
void test(T x, Args... args) {cerr << x << " ";test(args...);}
#else
#define debug //
#define test //
#endif
const ll MOD = 998244353;
// const ll MOD = 1e9+7;
ll ksm(ll x,ll y){ll ans=1;x%=MOD;while(y){if(y&1)ans=ans*x%MOD;x=x*x%MOD,y/=2;}return ans;}

const int P1 = 972152273, base1 = 809;
const int P2 = 905563261, base2 = 919;
const ll N = 200005;
//head



signed main()
{  
#ifdef localfreopen
    // freopen("1.in","r",stdin);
#endif
    fastio
    std::cout << std::fixed << std::setprecision(10);
    int n, m;
    std::cin >> n >> m;

    std::vector is(n + 1, std::vector<int> (m + 2));
    for (int i = 1; i <= n; i++) {
        std::string s;
        std::cin >> s;
        for (int j = 0; j < m; j++) {
            is[i][j + 1] = s[j] - '0';
        }
    }

    std::string ans;

    std::vector<std::pair<int, int>> D = {{0, 1}, {0, -1}, {1, 0}, {-1, 0}};
    std::vector<char> target = {'R', 'L', 'D', 'U'};
    auto dfs = [&](auto self, int x, int y, int fx, int fy, int rx, int ry, std::string s)->void{
        int cnt = 0;
        for (int k = 0; k < 4; k++) {
            auto [dx, dy] = D[k];
            int nx = x + dx, ny = y + dy;
            if (nx < 1 || nx > n || ny < 1 || ny > m || is[nx][ny] == 0 || (nx == fx && ny == fy)) continue;
            cnt++;
            self(self, nx, ny, x, y, rx, ry, s + target[k]);
        }
        if (cnt == 0) {
            ans += s;
        }
    };


    for (int i = 1; i <= n; i++) {
        for (int j = 1; j <= m; j++) {
            if (is[i][j] == 1) {
                int cnt = 0;
                for (auto [dx, dy] : D) {
                    int nx = i + dx, ny = j + dy;
                    if (nx >= 1 && nx <= n && ny >= 1 && ny <= m && is[nx][ny] == 1) {
                        cnt++;
                    }
                }
                if (cnt == 1) {
                    dfs(dfs, i, j, 0, 0, i, j, "");                    
                }
            }
        }
    }
    while (ans.size() > 50000) ans.pop_back();
    while (ans.size() < 50000) ans += "LRDU"[rnd(0, 3)];
    std::cout << ans << "\n";


    return 0;
}

这程序好像有点Bug,我给组数据试试?

Details

Tip: Click on the bar to expand more detailed information

Test #1:

score: 100
Accepted
time: 1ms
memory: 3900kb

input:

4 4
1111
1001
1001
1110

output:

UULLLDDDRRLLUUURRRDDRRLLULRUURLURRDLULDDLULDDLRLURUDLDUDURRRURLRURDUDUDUDURRRUDLULDLLUUUULRRRLUUDULDLLULLULLLDDLRDURRRDRDDLLLRLUUURRDRDDLDDRUDDUULDURDRDRUDRLULLULRRDDDDDLUUURDUULLLRRUUDULDDRRRRDDULRDRLLRDUUURLRUDUDRURDUUURDDRRLUURUUDLDULLUDLUURDRLLLDRLUDURRDRRDDDUUDDRDUDRLDRRRLDRDLLRLLURDDLDDRRULURU...

result:

ok AC

Test #2:

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

input:

2 15
111111111111111
101010101010101

output:

URRRRRRRRRRRRRRDURRRRRRRRRRRRDURRRRRRRRRRDURRRRRRRRDURRRRRRDURRRRDURRDURRRRRRRRRRRRDURRRRRRRRRRDURRRRRRRRDURRRRRRDURRRRDURRDULLDURRRRRRRRRRDURRRRRRRRDURRRRRRDURRRRDURRDULLLLDULLDURRRRRRRRDURRRRRRDURRRRDURRDULLLLLLDULLLLDULLDURRRRRRDURRRRDURRDULLLLLLLLDULLLLLLDULLLLDULLDURRRRDURRDULLLLLLLLLLDULLLLLLL...

result:

ok AC

Test #3:

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

input:

1 2
11

output:

RLRURRLLUURLDDURRLLURULLRURUUDULURLLDLDRDLLDLRRDRDRLLRUDLRRLRDDRRUDULDLRRURUUUUUUUDLDURLDLUDRRRRRURUULLRLLRRLRDLULUURRRDDRRDLRDDLDRLLRRRDDRLRRLLDURLDDRLDRUDLURRULDDLLLUURDURRRRRLLRUDDLLDRRLDUDUDDDRRLDULDRUUUUDDLDLDURDRUDRRRUUUDLLLLRRRRDDDRDRDRRUULLRRUUULUUDUULULURDLULDLDRRDDDULDDRDUDRURLLDDLDLLRDRLU...

result:

ok AC

Test #4:

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

input:

20 20
00000000000000000000
00000000000000000000
00000000000000000000
00000000000000010000
00000000000000010100
00000000000000111110
11001100000001101001
01110100111001000111
10011111101111001101
11110100110101001001
01000000001101011101
00000000000011010000
01000000000110010000
11100000001010110000
...

output:

DDRRRDDRRUDDRDDDLDLDDLLLULLDLLLLLDLLLUDDLDLDDLLLULLDLLLLLDLLDDDLDLDDLLLULLDLLLLLULLULDDLDLDDLLLULLDLLLDDDLDLDDLLLULLDLLLUULDDLDLDDLLLULLDDRDDLDLDDLLDDLDDLDLDDDDDLDLDDLDLDDDDDLDDDRDDLDLDDDDDLDDDDLLDLLLDDLDLDDDDDLDDDDLLDLLUDDLDLDDDDDLDDDDLLDLDDDRRDDLDLDDDDDLDDDDLLDLDDDLLLULLULULULLDDDRRDDLDLDDDDDLDDDD...

result:

ok AC

Test #5:

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

input:

20 20
10101010000000111100
11111110000000100111
00101000000000000101
11101100000000001011
01000101100000001101
01001110111010111011
00111011001011101010
00101001111001001111
11001011000111011010
01010110000000110100
11110010000101011100
10011111101101110011
10101000100111000110
11100111111100111011
...

output:

DRRRRRRUDRRRRDDRDDRDRDRRRUULLULDRRRRDDRDDRDRDDLDLDRRRRDDRDDRDRDDLDDDRRDDRRRDRDRDRRRRRURDRRRRDDRDDRDRDDLDDDRRDDRRRDRDRDRRRRRUUURDRRRRDDRDDRDRDDLDDDRRDDRRRDRDRDRRRRRUUUULDRRRRDDRDDRDRDDLDDDRRDDRRRDRDRDRRRRRUUUUURDRRRRDDRDDRDRDDLDDDRRDDRRRDRDRDRRRUUULLDDRRRRDDRDDRDRDDLDDDRRDDRRRDRDRDRRDDRRRRDDRDDRDRDDL...

result:

ok AC

Test #6:

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

input:

20 20
11101111101011101010
10110000101100111111
11011111100101001010
10010010110111110111
01101001101101010101
11001111010101011001
01110101110010001111
11010100001110011001
01010111101011100111
10111100100100111101
11001011111101010100
10111010010011010011
10100110111110111110
11101011010101101000
...

output:

RRRRDDLLLLLDRRRRDDLLLLLULULLDDRRRRRDDLLLLLULULLDDDRRRRDDLLDRRRRDDDRRRRRDDDDLDLLLURRRRDDDDLDLLDDDRRRDDRRRURRRRDDDDLDLLDDDRRRDDRDDRRRURURRRRDDDDLDLLDDDRRRDDRDDRRDDDRRRRRRDDDDLDLLDDDRRRDDRDDRRDDDLLRRRRDDDDLDLLDDDRRRDDRDDRRDDDDDRRDRRDRRRRRDDDDLDLLDDDRRRDDRDDRRDDDDDRRDRRURRRRDDLRRRRDDDDLDLLDDDRRRDDRDDRRD...

result:

ok AC

Test #7:

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

input:

10 10
1010100000
1111110000
0001010000
0101000000
1111100000
1001000000
1110000000
1011000000
0001100000
0000110000

output:

DRRRRRDDRRRRUDRRRDDDRDRRRDDDLLLDDRRDRDRDRDRRRDDDLLLDDDDRRRDDDLLUDRRRDDDDDRRUDRRRDDRRUDRDDDRDRDDDLLLDDRRDRDRDRDRDDDLLLDDDDRDDDLLUDRDDDDDLLUDRDDLLLLUDLLUDLDDDRDLDDDLLLDDRRDRDRDRDLDDDLLLDDDDLDDDLLUDLDDDDULLLLLUULLLUULLDDDRULLDDDLLLDDRRDRDRDRULLDDDLLLDDDULLDDDLLUULLDDDDULUDRRRDRRDDRRUUURRDDRRUUURUDRRUUU...

result:

ok AC

Test #8:

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

input:

12 12
000000011101
000011110111
000001010001
000011000011
000010000000
000010000000
000000000000
000000000000
000000000000
000000000000
000000000000
000000000000

output:

DLLULLDLLLDLLULLDLLDDLDDDLLULLDDDDDLRRRDRRRURRDRRDDLRRRURRDRRURDDLDDULLLULLDDLDDUURRDRRDDLUURRDRRURUULLULLDLLLRUULLULLDLLDDLDDRUULLULLDDRUUUUURUURRDUURUURRURRDRRDDLUURUURRURRDRRUUURUULDULUURRUDDLRLRRUDDURRLRDDLUULRDURDDLLUDULLDLURLDRLDRDRDLUUDLDLUUDLDLUUURDLLULLURURLULDURRDURRDUDURRURDRRDDLRRRRLDDUU...

result:

ok AC

Test #9:

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

input:

20 20
00000000000000000000
00000000000000000000
00000000000000000000
00000000000000000000
00000000100000000000
00000011110000000000
00000001010000000000
00000000000000000000
00000000000000000000
00000000000000000000
00000000000000000000
00000000000000000000
00000000000000000000
00000000000000000000
...

output:

DRDDLLDLDRRRDRRURDURRDURUULULLLULLDULURULULDDDURRDLRRDRLDRRRLUUUULLRRLLDRDLLURUUUUDURDDRRLRULRDRDLDUDRRLUDDDURLDLURDLLRRUURDUUDLLRUDDRRRRDURDRDDLLLULRRRLLULULDRULLLRURDRDUULURLUDDLDDDLDRRUDDRLDUDRUUUDDLLULDDDULLLUURDULDUUDDLLLLLULLRULLUULRUULRLRDDLRULLURDLLUDDLUDURUDRUURRLRLRDURRUDDUULUDLUDLRLLUUUDL...

result:

ok AC

Test #10:

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

input:

20 20
00000000000111111111
00000000000010010100
10000000000001110111
10000000110010010100
11000011010011010001
01000010010101011111
01110111110111110000
11011101011100100011
01000000110000111110
11000000000000101010
01110100100001101101
11011111111000010111
10000010101001111010
11000011000111010010
...

output:

RRRRRRRRRRRRRRDDRRRRRRRRDDDRRRRDDLLRRRRDDDDDRRRRURRRRDDDDDDLLLLDLLDLRRRRDDDDDDLLLLDLLULLLLDLLULLDLRRRRDDDDDDLLLLDLLULLLLDLLULLDDDLRRRRDDDDDDLLLLDLLULLLLDLLULLDDDDRRDRRRRRRRDRRRRDDDDDDLLLLDLLULLLLDLLULLDDDDRRDRRRRRDRRRRDDDDDDLLLLDLLULLLLDLLULLDDDDRRDRRRRRURRRRDDDDDDLLLLDLLULLLLDLLULLDDDDRRDRRRDDRRRRR...

result:

ok AC

Test #11:

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

input:

2 1
1
1

output:

DURRDRDRDURRRUULDULLRDLLDLLUUDRULRDLUDLLDRLRLLDURLLRRRRRDLLRUURRLLDRLULURUDDDLRDRRRULURDLDULLURRLRUURRLRUURDLLUUUDLRUUURUDURULLDRLLRDUDULRLLLDRRLULLLLLRLLRURDLLRDLLDLULDLDLRLDUDRRDLLRDLRLULLDLDLLRULLLDRUDRUUUULDURRRUUULRDDUUULRRDRLRDDRRRLUDLRRURUUURDRRUUUURLLRRDLLLLDRUURRLDUULDUUDRUDURRLLUUUDURRRRUL...

result:

ok AC

Test #12:

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

input:

20 20
11111111111111111111
10000000000000000000
11111111111111111111
00000000000000000001
11111111111111111111
10000000000000000000
11111111111111111111
00000000000000000001
11111111111111111111
10000000000000000000
11111111111111111111
00000000000000000001
11111111111111111111
10000000000000000000
...

output:

LLLLLLLLLLLLLLLLLLLDDRRRRRRRRRRRRRRRRRRRDDLLLLLLLLLLLLLLLLLLLDDRRRRRRRRRRRRRRRRRRRDDLLLLLLLLLLLLLLLLLLLDDRRRRRRRRRRRRRRRRRRRDDLLLLLLLLLLLLLLLLLLLDDRRRRRRRRRRRRRRRRRRRDDLLLLLLLLLLLLLLLLLLLDDDRRURRDRRURRDRRURRDRRURRDRRRLLLLLLLLLLLLLLLLLLLDDRRRRRRRRRRRRRRRRRRRDDLLLLLLLLLLLLLLLLLLLDDRRRRRRRRRRRRRRRRRRRD...

result:

ok AC

Test #13:

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

input:

20 20
11111011111011111011
00101100101100101101
10110110110110110111
10011011011011011001
11101101101101101101
10110110110110110110
11011011011011011011
01101101101101101101
10110110110110110111
10011011011011011001
11101101101101101101
10110110110110110110
11011011011011011011
01101101101101101101
...

output:

RRRRDRDRDRDRDRDRDRDRDRDRDRDRDRDRRDRRRRDRDRDRDRDRDRDRDRDRDRDRDRDRDRRUULULULULULULULULULULULUURRDRDRDRDRDRDRDRDRRDDRRRRDRDRDRDRDRDRDRDRDRDRDRDRDRDRRUULULULULULULULULULULULUURRDRDRDRDRDRDRDRDRRUULULULULULUURRDRDRRDDRRRRDRDRDRDRDRDRDRDRDRDRDRDRDRDRRUULULULULULULULULULULULUURRDRDRDRDRDRDRDRDRRUULULULULUL...

result:

ok AC

Test #14:

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

input:

20 20
11101110111110111110
10011011001011001011
11101101101101101101
10110110110110110110
11011011011011011011
01101101101101101101
10110110110110110111
10011011011011011001
11101101101101101101
10110110110110110110
11011011011011011011
01101101101101101101
10110110110110110111
10011011011011011001
...

output:

LLDDRRDRDRDRDRDRDRDRDRDRDRDRDRDRDRDRDRRDLLDDRRDRDRDRDRDRDRDRDRDRDRDRDRDRDRDRDRRUULULULULULULULULULULULULULULULULLLDDRRDRDRDRDRDRDRDRDRDRDRDRDRDRDRDRDRRUULULULULULULULULULULULULULULULUURRDRDRDRDRDRDRDRDRDRDRDRDRRDDLLDDRRDRDRDRDRDRDRDRDRDRDRDRDRDRDRDRDRRUULULULULULULULULULULULULULULULUURRDRDRDRDRDRDRD...

result:

ok AC

Test #15:

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

input:

20 20
11111111111111111111
10000000000000000000
11111111111111111111
00000000000000000001
11111111111111111111
10000000000000000000
11111111111111111111
00000000000000000001
11111111111111111111
10000000000000000000
11111111111111111111
00000000000000000001
11111111111111111111
10000000000000000000
...

output:

LLLLLLLLLLLLLLLLLLLDDRRRRRRRRRRRRRRRRRRRDDLLLLLLLLLLLLLLLLLLLDDRRRRRRRRRRRRRRRRRRRDDLLLLLLLLLLLLLLLLLLLDDRRRRRRRRRRRRRRRRRRRDDLLLLLLLLLLLLLLLLLLLDDRRRRRRRRRRRRRRRRRRRDDLLLLLLLLLLLLLLLLLLLDDRRRRRRRRRRRRRRRRRRRDLLLLLLLLLLLLLLLLLLLDDRRRRRRRRRRRRRRRRRRRDDLLLLLLLLLLLLLLLLLLLDDRRRRRRRRRRRRRRRRRRRDDLLLLLLL...

result:

ok AC

Test #16:

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

input:

20 20
00111100111100111101
11101011101011100001
10100110100110100111
01101101101101101101
11011011011011011011
10110110110110110110
11101101101101101101
10011011011011011001
10110110110110110111
01101101101101101101
11011011011011011011
10110110110110110110
11101101101101101101
10011011011011011001
...

output:

LLLDLLDLLLDDDLDLDDRRURURURURURRDDLDLDLDLDLDLDLDLDDRRURURURURURURURURURURURRDDLDLDLDLDLDLDLDLDLDLDLDLDLDLDDRRURURURURURURURURURURURURURURURURRDDLDLDLDLDLDLDLDLDLDLDLDLDLDLDDRRURURURURURURURURURURURRDDLDLDLDLDLDLDLDLDDRRURURURURURRDDLDLDDRRULLLDDDLDLDDRRURURURURURRDDLDLDLDLDLDLDLDLDDRRURURURURURURURUR...

result:

ok AC

Test #17:

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

input:

20 20
01000111000111000111
11101101101101101101
10110110110110110110
11011011011011011011
01101101101101101101
00110110110110110111
01011011011011011010
11101101101101101100
10110110110110110110
11011011011011011011
01101101101101101101
00110110110110110111
01011011011011011010
11101101101101101100
...

output:

DRDRDRDRDRDRDRDRDRDRDRDRDRDRDRDRDRRUULULULULULULULULULULULULULULULDRDRDRDRDRDRDRDRDRDRDRDRDRDRDRDRDRRUULULULULULULULULULULULULULULUURRDRDRDRDRDRDRDRDRDRDRDRRUULULULULULULULULULDRDRDRDRDRDRDRDRDRDRDRDRDRDRDRDRDRRUULULULULULULULULULULULULULULUURRDRDRDRDRDRDRDRDRDRDRDRRUULULULULULULULULUURRDRDRDRDRDRRU...

result:

ok AC

Test #18:

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

input:

20 20
10111110111110111101
11101001101001101001
10011011011011011001
10110110110110110111
01101101101101101101
11011011011011011011
10110110110110110110
11101101101101101101
10011011011011011001
10110110110110110111
01101101101101101101
11011011011011011011
10110110110110110110
11101101101101101101
...

output:

DRRURRRRDRRURRDDLDLDLDLDDRRURURURURURURURRRRDRRURRDDLDLDLDLDDRRURURURURURURURRDDLDLDLDLDLDLDLDLDLDLDDRRURURURURURURURURURURURURURRRDRRURRDDLDLDLDLDDRRURURURURURURURRDDLDLDLDLDLDLDLDLDLDLDDRRURURURURURURURURURURURURURRDDLDLDLDLDLDLDLDLDLDLDLDLDLDLDLDLDDRRURURURURURURURURURURURURURURURURRDDLDLDLDLDLDL...

result:

ok AC

Test #19:

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

input:

20 20
10111110111110111110
10001011001011001011
11101101101101101101
10110110110110110110
11011011011011011011
01101101101101101101
10110110110110110111
10011011011011011001
11101101101101101101
10110110110110110110
11011011011011011011
01101101101101101101
10110110110110110111
10011011011011011001
...

output:

DDRRDRDRDRDRDRDRDRDRDRDRDRDRDRDRDRDRRUULULULULULULULULULULULULULULULUURRDRDRDRDRDRDRDRDRDRDRDRDRRDDDDRRDRDRDRDRDRDRDRDRDRDRDRDRDRDRDRDRRUULULULULULULULULULULULULULULULUURRDRDRDRDRDRDRDRDRDRDRDRDRRUULULULULULULULULULUURRDRDRDRDRDRDRRDDDDRRDRDRDRDRDRDRDRDRDRDRDRDRDRDRDRDRRUULULULULULULULULULULULULULUL...

result:

ok AC

Test #20:

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

input:

20 20
10011111011111011111
11100101100101100101
10110110110110110110
11011011011011011011
01101101101101101101
10110110110110110111
10011011011011011001
11101101101101101101
10110110110110110110
11011011011011011011
01101101101101101101
10110110110110110111
10011011011011011001
11101101101101101101
...

output:

DRRDRDRDRDRDRDRDRDRDRDRDRDRDRDRDRDRRDDDRRDRDRDRDRDRDRDRDRDRDRDRDRDRDRDRDRRUULULULULULULULULULULULULULULUURRDRDRDRDRDRDRDRDRDRDRDRRDDDRRDRDRDRDRDRDRDRDRDRDRDRDRDRDRDRDRRUULULULULULULULULULULULULULULUURRDRDRDRDRDRDRDRDRDRDRDRRUULULULULULULULULUURRDRDRDRDRDRRDDDRRDRDRDRDRDRDRDRDRDRDRDRDRDRDRDRDRRUULULU...

result:

ok AC

Test #21:

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

input:

20 20
11111011111011111011
00101100101100101101
10110110110110110111
10011011011011011001
11101101101101101101
10110110110110110110
11011011011011011011
01101101101101101101
10110110110110110111
10011011011011011001
11101101101101101101
10110110110110110110
11011011011011011011
01101101101101101101
...

output:

RRRRDRDRDRDRDRDRDRDRDRDRDRDRDRDRRUULULULULULULULULULULULUURRDRDRDRDRDRDRDRDRRDDRRRRDRDRDRDRDRDRDRDRDRDRDRDRDRDRRUULULULULULULULULULULULUURRDRDRDRDRDRDRDRDRRUULULULULULUURRDRDRRDDRRRRDRDRDRDRDRDRDRDRDRDRDRDRDRDRRUULULULULULULULULULULULUURRDRDRDRDRDRDRDRDRRUULULULULULUURRDRDRRUULRRRRDRDRDRDRDRDRDRDRDR...

result:

ok AC

Test #22:

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

input:

20 20
11111111111111111111
10000000000000000000
11111111111111111111
00000000000000000001
11111111111111111111
10000000000000000000
11111111111111111111
00000000000000000001
11111111111111111111
10000000000000000000
11111111111111111111
00000000000000000001
11111111111111111111
10000000000000000000
...

output:

LLLLLLLLLLLLLLLLLLLDDRRRRRRRRRRRRRRRRRRRDDLLLLLLLLLLLLLLLLLLLDDRRRRRRRRRRRRRRRRRRRDDLLLLLLLLLLLLLLLLLLLDDRRRRRRRRRRRRRRRRRRRDDLLLLLLLLLLLLLLLLLLLDDRRRRRRRRRRRRRRRRRRRDDLLLLLLLLLLLLLLLLLLLDDDRRURRDRRURRDRRURRDRRURRRDRRULLLLLLLLLLLLLLLLLLLDDRRRRRRRRRRRRRRRRRRRDDLLLLLLLLLLLLLLLLLLLDDRRRRRRRRRRRRRRRRRRR...

result:

ok AC

Test #23:

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

input:

20 20
00011100011100011100
00010110010110010110
00011011011011011011
11101101101101101101
10110110110110110110
11011011011011011011
01101101101101101101
00110110110110110111
00011011011011011000
11101101101101101100
10110110110110110110
11011011011011011011
01101101101101101101
00110110110110110111
...

output:

ULULULLDDRDRDRDRDDLLULULULULULULULLDDRDRDRDRDRDRDRDRDRDRDDLLULULULULULULULULULULULULULLDDRDRDRDRDRDRDRDRDRDRDRDRDRDRDRDRDDLLULULULULULULULULULULULULULULULULLDDRDRDRDRDRDRDRDRDRDRDRDRDRDDLLULULULULULULULULULULLDDRDRDRDRDRDRDRDDLLULULULULLDDRDRDULULUURRDRDRDRDRRUULULULULULULULUURRDRDRDRDRDRDRDRDRDRDRR...

result:

ok AC

Test #24:

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

input:

20 20
11111011111011111011
00101100101100101101
10110110110110110111
10011011011011011001
11101101101101101101
10110110110110110110
11011011011011011011
01101101101101101101
10110110110110110111
10011011011011011001
11101101101101101101
10110110110110110110
11011011011011011011
01101101101101101101
...

output:

RRRRDRDRDRDRDRDRDRDRDRDRDRDRDRDRRDDRRRRDRDRDRDRDRDRDRDRDRDRDRDRDRDRRUULULULULULULULULULULULUURRDRDRDRDRDRDRDRDRRDDRRRRDRDRDRDRDRDRDRDRDRDRDRDRDRDRRUULULULULULULULULULULULUURRDRDRDRDRDRDRDRDRRUULULULULULUURRDRDRRDDRRRRDRDRDRDRDRDRDRDRDRDRDRDRDRDRRUULULULULULULULULULULULUURRDRDRDRDRDRDRDRDRRUULULULULU...

result:

ok AC

Test #25:

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

input:

20 20
01101111011111011111
11011010010010010010
10110110110110110110
11101101101101101101
10011011011011011001
10110110110110110111
01101101101101101101
11011011011011011011
10110110110110110110
11101101101101101101
10011011011011011001
00110110110110110111
11101101101101101101
10011011011011011011
...

output:

LDLDDRRURURURRRLDLDDRRURURURRDDLDLDLDLDLDLDDRRURURURURURURURUURRRRLDLDDRRURURURRDDLDLDLDLDLDLDDRRURURURURURURURUURRRDDLDLDLDLDLDLDLDLDLDLDLLDDDRRURURURURURURURURURURURURURUURRRRLDLDDRRURURURRDDLDLDLDLDLDLDDRRURURURURURURURUURRRDDLDLDLDLDLDLDLDLDLDLDLLDDDRRURURURURURURURURURURURURURUURRRDDLDLDLDLDLDL...

result:

ok AC

Test #26:

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

input:

20 20
10101010101010101010
10111111111111111111
11000000000000000001
10111111111111111111
10100000000000000000
10111111111111111111
11000000000000000001
10111111111111111111
10100000000000000000
10111111111111111111
11000000000000000001
10111111111111111111
10100000000000000000
10111111111111111111
...

output:

DDRDDDDDDRDDDDDDDDDDRDDDDDDDDDDDDDDRDDDDDDDDDDDDDDDDDDDRRRRRRRRRRRRRRRRRRRUULLLLLLLLLLLLLLLLLUURRRRRRRRRRRRRRRRRUULLLLLLLLLLLLLLLLLUURRRRRRRRRRRRRRRRRUULLLLLLLLLLLLLLLLLUURRRRRRRRRRRRRRRRRUULLLLLLLLLLLLLLLLLUURRRRRRRRRRRRRRRRRUULLLLLLLLLLLLLLLLLUDDDDDDDDDDDDDDDDDDDRRRRRRRRRRRRRRRRRRRUULLLLLLLLLLLLLL...

result:

ok AC

Test #27:

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

input:

20 20
11011111011111011111
10110100110100110101
11101101101101101101
10011011011011011010
10110110110110110111
01101101101101101101
11011011011011011011
10110110110110110110
11101101101101101101
10011011011011011001
10110110110110110111
01101101101101101101
11011011011011011011
10110110110110110110
...

output:

LDDRRURURRRRLDDRRURURRDDLDLDLDLDLDDRRURURURURURURURURRRRLDDRRURURRDDLDLDLDLDLDDRRURURURURURURURURRDDLDLDLDLDLDLDLDLDLDLDLDDRRURURURURURURURURURURURURURURRRRDDLDDRRURURRDDLDLDLDLDLDDRRURURURURURURURURRDDLDLDLDLDLDLDLDLDLDLDLDDRRURURURURURURURURURURURURURURRDDLDLDLDLDLDLDLDLDLDLDLDLDLDLDLDLDLLDDRRURUR...

result:

ok AC

Test #28:

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

input:

20 20
01101111101111101110
11011010011010011010
10110110110110110110
11101101101101101101
10011011011011011001
10110110110110110111
01101101101101101101
11011011011011011011
10110110110110110110
11101101101101101101
10011011011011011001
10110110110110110111
01101101101101101101
11011011011011011011
...

output:

LDLDDRRURURURRRRLDLDDRRURURURRDDLDLDLDLDLDLDDRRURURURURURURURURURRRRLDLDDRRURURURRDDLDLDLDLDLDLDDRRURURURURURURURURURRDDLDLDLDLDLDLDLDLDLDLDLDLDDRRURURURURURURURURURURURURURURURRDDLDLDLDLDLDLDLDLDLDLDLDLDLDLDLDLDDRRURURURURURURURURURURURURURURRDDLDLDLDLDLDLDLDLDLDLDLDDRRURURURURURURURURRDDLDLDLDLDLD...

result:

ok AC

Test #29:

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

input:

20 20
01111101111101110111
11010011010011010101
10110110110110110101
01101101101101101101
11011011011011011011
10110110110110110110
11101101101101101101
10011011011011011001
10110110110110110111
01101101101101101101
11011011011011011011
10110110110110110110
11101101101101101101
10011011011011011001
...

output:

LLLLDLDLLDDLDLDLDDRRURURURURURURRRRLLDDLDLDLDDRRURURURURURURRDDLDLDLDLDLDLDLDLDLDDRRURURURURURURURURURURURURRDDLDLDLDLDLDLDLDLDLDLDLDLDLDLDLDDDRRRLLDDLDLDLDDRRURURURURURURRDDLDLDLDLDLDLDLDLDLDDRRURURURURURURURURURURURURRDDLDLDLDLDLDLDLDLDLDLDLDLDLDLDLDDDRRUURURURURURURURURURURURURURURURUUURRDDDDLDLD...

result:

ok AC

Test #30:

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

input:

20 20
11011111011111011111
10110100110100110100
11101101101101101101
10011011011011011001
10110110110110110111
01101101101101101101
11011011011011011011
10110110110110110110
11101101101101101101
10011011011011011001
10110110110110110111
01101101101101101101
11011011011011011011
10110110110110110110
...

output:

LDDRRURURRRRLDDRRURURRDDLDLDLDLDLDDRRURURURURURURURURRRRLDDRRURURRDDLDLDLDLDLDDRRURURURURURURURURRDDLDLDLDLDLDLDLDLDLDLDLDDRRURURURURURURURURURURURURURURRRRLDDRRURURRDDLDLDLDLDLDDRRURURURURURURURURRDDLDLDLDLDLDLDLDLDLDLDLDDRRURURURURURURURURURURURURURURRDDLDLDLDLDLDLDLDLDLDLDLDLDLDLDLDLDDRRURURURURU...

result:

ok AC

Test #31:

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

input:

20 20
11110001110001110001
01011001011011011001
01101101101101101111
00110110110110110100
00011011011011011000
11101101101101101100
10110110110110110110
11011011011011011011
01101101101101101101
00110110110110110111
00011011011011011010
11101101101101101100
10110110110110110110
11011011011011011011
...

output:

RRRDRDRDRDRDRDRDRDRDRDRDRDRDRDRDRRDRRRDRDRDRDRDRDRDRDRDRDRDRDRDRDRDRRUULULULULULULULULULULULULUURRDRDRDRDRDRDRDRDRDRRUULULULULULULULRRRDRDRDRDRDRDRDRDRDRDRDRDRDRDRDRRUULULULULULULULULULULULULUURRDRDRDRDRDRDRDRDRDRRUULULULULULULUURRDRDRRRUURRRDRDRDRDRDRDRDRDRDRDRDRDRDRDRDRRUULULULULULULULULULULULULUU...

result:

ok AC

Test #32:

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

input:

20 20
11111110011110111110
00001011101011001011
11101100101101101100
10110110110110110111
11011011011011011010
01101101101101101111
10110110110110110101
10011011011011011011
11101101101101101100
10110110110110110111
11011011011011011010
01101101101101101111
10110110110110110010
10011011011011011011
...

output:

RRRRRRDRRDDRDRDRDRDRDRDRDRDRRRRRRRRRDRRDDRDRDRDRDRDRDRDRDRRDDRRRRRRRDRRDDRDRDRDRDRDRDRDRDRRUURRRRRRRDRRDDRDRDRDRDRDRDRDRDRRUULULULULULULULULUURRDRDRDRDRDRRRDDLRRRRRRDRRDDRDRDRDRDRDRDRDRDRRUULULULULULULULULUURRDRDRDRDRDRRUURRRRRRRDRRDDRDRDRDRDRDRDRDRDRRUULULULULULULULULUURRDRDRDRDRDRRUULULUURRDRRRRRR...

result:

ok AC

Test #33:

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

input:

20 20
11011111011111011111
10110100110100110100
11101101101101101101
10011011011011011001
10110110110110110111
01101101101101101101
11011011011011011011
10110110110110110110
11101101101101101101
10011011011011011001
10110110110110110111
01101101101101101101
11011011011011011011
10110110110110110110
...

output:

LDDRRURURRRRLDDRRURURRDDLDLDLDLDLDDRRURURURURURURURURRRRLDDRRURURRDDLDLDLDLDLDDRRURURURURURURURURRDDLDLDLDLDLDLDLDLDLDLDLDDRRURURURURURURURURURURURURURURRRRLDDRRURURRDDLDLDLDLDLDDRRURURURURURURURURRDDLDLDLDLDLDLDLDLDLDLDLDDRRURURURURURURURURURURURURURURRDDLDLDLDLDLDLDLDLDLDLDLDLDLDLDLDLDDRRURURURURU...

result:

ok AC

Test #34:

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

input:

20 20
10111110111110111110
10001011001011001011
11101101101101101101
10110110110110110110
11011011011011011011
01101101101101101101
10110110110110110111
10011011011011011001
11101101101101101101
10110110110110110110
11011011011011011011
01101101101101101101
10110110110110110111
10011011011011011001
...

output:

DDRRDRDRDRDRDRDRDRDRDRDRDRDRDRDRDRDRRDDDRRDRDRDRDRDRDRDRDRDRDRDRDRDRDRDRDRRUULULULULULULULULULULULULULULULUURRDRDRDRDRDRDRDRDRDRDRDRDRRDDDDRRDRDRDRDRDRDRDRDRDRDRDRDRDRDRDRDRRUULULULULULULULULULULULULULULULUURRDRDRDRDRDRDRDRDRDRDRDRDRRUULULULULULULULULULUURRDRDRDRDRDRDRRDDDDRRDRDRDRDRDRDRDRDRDRDRDRDR...

result:

ok AC

Test #35:

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

input:

20 20
11011100011100011101
10110110110110110111
11101101101101101101
01011011011011011010
00110110110110110111
01101101101101101101
11011011011011011011
10110110110110110110
11101101101101101100
10011011011011011010
10110110110110110111
01101101101101101101
11011011011011011011
10110110110110110110
...

output:

LDDRRURURRDRLDDRRURURRDDLDLDLDLDLDDRRURURURURURURURURRDRLDDRRURURRDDLDLDLDLDLDDRRURURURURURURURURRDDLDLDLDLDLDLDLDLDLDLDLDDRRURURURURURURURURURURURURURURRDRRDLDDRRURURRDDLDLDLDLDLDDRRURURURURURURURURRDDLDLDLDLDLDLDLDLDLDLDLDDRRURURURURURURURURURURURURURURRDRRULDDRRURURRDDLDLDLDLDLDDRRURURURURURURURU...

result:

ok AC

Test #36:

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

input:

20 20
11111111111111111111
10101010010101010101
10000000000000000000
11111111111111111111
00000000000000000001
11111111111111111111
10000000000000000000
11111111111111111111
00000000000000000001
11111111111111111111
10000000000000000000
11111111111111111111
00000000000000000001
11111111111111111111
...

output:

URRRRRRRRRRRRRRRRRDURRRRRRRRRRRRRRRDURRRRRRRRRRRRRDURRRRRRRRRRRDURRRRRRRRRDURRRRRRRDURRRRDURRDULLDDDRRRRRRRRRRRRRRRRRRRDDLLLLLLLLLLLLLLLLLLLDDRRRRRRRRRRRRRRRRRRRDDLLLLLLLLLLLLLLLLLLLDDRRRRRRRRRRRRRRRRRRRDDLLLLLLLLLLLLLLLLLLLDDRRRRRRRRRRRRRRRRRRRDDLLLLLLLLLLLLLLLLLLLDDRRRRRRRRRRRRRRRRRRRURRRRRRRRRRRR...

result:

ok AC

Test #37:

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

input:

20 20
10011111011111011111
11100101100101100101
10110110110110110110
11011011011011011011
01101101101101101101
10110110110110110111
10011011011011011001
11101101101101101101
10110110110110110110
11011011011011011011
01101101101101101101
10110110110110110111
10011011011011011001
11101101101101101101
...

output:

DRRDRDRDRDRDRDRDRDRDRDRDRDRDRDRDRDRRDDDRRDRDRDRDRDRDRDRDRDRDRDRDRDRDRDRDRRUULULULULULULULULULULULULULULUURRDRDRDRDRDRDRDRDRDRDRDRRDDDRRDRDRDRDRDRDRDRDRDRDRDRDRDRDRDRDRRUULULULULULULULULULULULULULULUURRDRDRDRDRDRDRDRDRDRDRDRRUULULULULULULULULUURRDRDRDRDRDRRDDDRRDRDRDRDRDRDRDRDRDRDRDRDRDRDRDRDRRUULULU...

result:

ok AC

Test #38:

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

input:

20 20
11000111110111110111
01001101001101001101
11011011011011011011
10110110110110110110
11101101101101101101
10011011011011011001
10110110110110110111
01101101101101101101
11011011011011011011
10110110110110110110
11101101101101101101
10011011011011011001
10110110110110110111
01101101101101101101
...

output:

RDDLDDRRURURURURRRRRDDLDDRRURURURURRDDLDLDLDLDLDLDLDDRRURURURURURURURURURURRRRRDDLDDRRURURURURRDDLDLDLDLDLDLDLDDRRURURURURURURURURURURRDDLDLDLDLDLDLDLDLDLDLDLDLDLDDRRURURURURURURURURURURURURURURURURRDDLDLDLDLDLDLDLDLDLDLDLDLDLDLDLDLDLLLDRDDLDDRRURURURURRDDLDLDLDLDLDLDLDDRRURURURURURURURURURURRDDLDLD...

result:

ok AC

Test #39:

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

input:

20 20
10111110111110111011
11101001101001101010
10011011011011011010
10110110110110110111
01101101101101101101
11011011011011011011
10110110110110110110
11101101101101101100
10011011011011011010
10110110110110110111
01101101101101101101
11011011011011011011
10110110110110110110
11101101101101101100
...

output:

DRRURRRRDRRURRDDLDLDLDLDDRRURURURURURURURRRRDRRURRDDLDLDLDLDDRRURURURURURURURRDDLDLDLDLDLDLDLDLDLDLDDRRURURURURURURURURURURURURURRDDLDLDLDLDLDLDLDLDLDLDLDLDLDLDLDLDDRRURURURURURURURURURURURURURURURURRDDLDLDLDLDLDLDLDLDLDLDLDLDLDLDRRURRDDLDLDLDLDDRRURURURURURURURRDDLDLDLDLDLDLDLDLDLDLDDRRURURURURURUR...

result:

ok AC

Test #40:

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

input:

20 20
11111011111011111011
00101100101100101101
10110110110110110111
10011011011011011001
11101101101101101101
10110110110110110110
11011011011011011011
01101101101101101101
10110110110110110111
10011011011011011001
11101101101101101101
10110110110110110110
11011011011011011011
01101101101101101101
...

output:

RRRRDRDRDRDRDRDRDRDRDRDRDRDRDRDRRDDRRRRDRDRDRDRDRDRDRDRDRDRDRDRDRDRRUULULULULULULULULULULULUURRDRDRDRDRDRDRDRDRRDDRRRRDRDRDRDRDRDRDRDRDRDRDRDRDRDRRUULULULULULULULULULULULUURRDRDRDRDRDRDRDRDRRUULULULULULUURRDRDRRDDRRRRDRDRDRDRDRDRDRDRDRDRDRDRDRDRRUULULULULULULULULULULULUURRDRDRDRDRDRDRDRDRRUULULULULU...

result:

ok AC

Test #41:

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

input:

20 20
11111101111101110111
10010011010011011001
10110110110110110111
01101101101101101101
11011011011011011011
10110110110110110110
11101101101101101101
10011011011011011001
10110110110110110111
01101101101101101101
11011011011011011001
10110110110110110111
11101101101101101100
10011011011011011010
...

output:

LLLLLDDLLDDLDLDLDDRRURURURURURURRRRLLDDLDLDLDDRRURURURURURURRDDLDLDLDLDLDLDLDLDLDDRRURURURURURURURURURURURURRDRLLDDLDLDLDDRRURURURURURURRDDLDLDLDLDLDLDLDLDLDDRRURURURURURURURURURURURURRDDLDLDLDLDLDLDLDLDLDLDLDLDLDLDLDDRRURURURURURURURURURURURURURURURURRDDLDLDLDLDLDLDLDLDLDLDLDLDLDLDDRRURURURURURURUR...

result:

ok AC

Test #42:

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

input:

20 20
00111110111110111110
01101001101001100011
11011011011011011110
10110110110110110001
01101101101101101111
11011011011011011001
10110110110110110111
11101101101101101100
10011011011011011001
10110110110110110111
01101101101101101101
11011011011011011011
10110110110110110110
11101101101101101101
...

output:

LLLLDLDLDLLDDLDLDLDLDDRRURURURURURURURRRRLLDDLDLDLDLDDRRURURURURURURURRDDLDLDLDLDLDLDLDLDLDLDDRRURURURURURURURURURURURURURRRRDRLLDDLDLDLDLDDRRURURURURURURURRDDLDLDLDLDLDLDLDLDLDLDDRRURURURURURURURURURURURURURRRRDDLLLDLDLDLDLDLDLDLDLDLDLDLDLDLDLLDDDRRURURURURURURURURURURURURURURURRRDDLLDLDLDLDLDLDLDL...

result:

ok AC

Test #43:

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

input:

20 20
11111011111011111011
00101100101100101101
10110110110110110111
10011011011011011001
11101101101101101101
10110110110110110110
11011011011011011011
01101101101101101101
10110110110110110111
10011011011011011001
11101101101101101101
10110110110110110110
11011011011011011011
01101101101101101101
...

output:

RRRRDRDRDRDRDRDRDRDRDRDRDRDRDRDRRDDRRRRDRDRDRDRDRDRDRDRDRDRDRDRDRDRRUULULULULULULULULULULULUURRDRDRDRDRDRDRDRDRRDDRRRRDRDRDRDRDRDRDRDRDRDRDRDRDRDRRUULULULULULULULULULULULUURRDRDRDRDRDRDRDRDRRUULULULULULUURRDRDRRDDRRRRDRDRDRDRDRDRDRDRDRDRDRDRDRDRRUULULULULULULULULULULULUURRDRDRDRDRDRDRDRDRRUULULULULU...

result:

ok AC

Test #44:

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

input:

20 20
00001110001110001110
00001011001011001011
11101101101101101101
10110110110110110110
11011011011011011011
01101101101101101101
00110110110110110111
00011011011011011000
11101101101101101100
10110110110110110110
11011011011011011011
01101101101101101101
00110110110110110111
00011011011011011000
...

output:

ULULLDDRDRDRDDLLULULULULULULLDDRDRDRDRDRDRDRDRDRDDLLULULULULULULULULULULULULLDDRDRDRDRDRDRDRDRDRDRDRDRDRDRDRDDLLULULULULULULULULULULULULULULULULLDDRDRDRDRDRDRDRDRDRDRDRDRDRDRDDLLULULULULULULULULULULULLDDRDRDRDRDRDRDRDRDDLLULULULULULLDDRDRDRDULULULUURRDRDRDRDRDRRUULULULULULULULULUURRDRDRDRDRDRDRDRDRD...

result:

ok AC

Test #45:

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

input:

20 20
11111101111101111101
10010110010110010111
01011011011011011001
11101101101101101101
10110110110110110110
11011011011011011011
01101101101101101101
10110110110110110111
10011011011011011001
11101101101101101101
10110110110110110110
11011011011011011011
01101101101101101101
10110110110110110111
...

output:

RRRRDRDRDRDRDRDRDRRDDRRRRDRDRDRDRDRDRDRRUULULULULUURRDRRDDRRRRDRDRDRDRDRDRDRRUULULULULUURRDRRURRRRDRDRDRDRDRDRDRRUULULULULUULLRRDDRDRDRDRDRDRDRDRDRDRDDLLULULULULULULULULULULULULULLLLLDRRDDRDRDRDRDRDRDRDRDRDRDDLLULULULULULULULULULULULULULLDDRDRDRDRDRDRDRDRDRDRDRDRDRDRDRDRDDLLULULULULULULULULULULULULU...

result:

ok AC

Test #46:

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

input:

20 20
11100011100011101100
10110110110110110110
11011011011011011011
01101101101101101101
10110110110110110111
10011011011011011010
11101101101101101100
10110110110110110110
11011011011011011011
01101101101101101101
10110110110110110111
10011011011011011010
11101101101101101100
10110110110110110110
...

output:

RDRDRDDLLULULULULLDLRDRDRDDLLULULULULLDDRDRDRDRDRDRDRDDLLULULULULULULULULULULLDLRDRDRDDLLULULULULLDDRDRDRDRDRDRDRDDLLULULULULULULULULULULLDDRDRDRDRDRDRDRDRDRDRDRDRDRDDLLULULULULULULULULULULULULULULULULLDDRDRDRDRDRDRDRDRDRDRDRDRDRDRDRDRDDLLULULULULULULULULULULULULULLDDRDRDRDRDRDRDRDRDRDRRDRDRDDLLULUL...

result:

ok AC

Test #47:

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

input:

20 20
11111000111000111011
00101101101101101110
10110110110110110011
10011011011011011010
11101101101101101100
10110110110110110110
11011011011011011011
01101101101101101101
10110110110110110111
10011011011011011010
11101101101101101100
10110110110110110110
11011011011011011011
01101101101101101101
...

output:

RRRRDRDRDRDRDRDRDRDRDRDRDRDRDRDRRUULULULULULULULULULULULULRRRRDRDRDRDRDRDRDRDRDRDRDRDRDRDRRUULULULULULULULULULULULUURRDRDRDRDRDRDRDRDRRUULULULULULULRRRRDRDRDRDRDRDRDRDRDRDRDRDRDRDRRUULULULULULULULULULULULUURRDRDRDRDRDRDRDRDRRUULULULULULUURRDRRDRRRRRDRDRDRDRDRDRDRDRDRDRDRDRDRDRRUULULULULULULULULULULU...

result:

ok AC

Test #48:

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

input:

20 20
11101110111011101111
10111011101110111001
10010101010101010101
11101110111011101110
10111011101110111011
01010101010101010010
11101110111011101110
10111011101110111011
10010101010101010101
11101110111011101110
10111011101110111011
01010101010101010010
11101110111011101110
10111011101110111011
...

output:

URURRDRRURRDRRURRDRRURRRDDURURRDRRURRDRRURRDRDURURRDRRURRDRDURURRDRDULULLDDDRRDRRURRDRRURRDRRURRDRRURRDRULULLDDDRRDRRURRDRRURRDRRURRDRRURRDDDLLDLLULLDLLULLDLLULLDLLULLDDDRRDRRURRDRRURRDRRURRDRRURRDRULULLDDDRRDRRURRDRRURRDRRURRDRRURRDDDLLDLLULLDLLULLDLLULLDLLULLDDDRRDRRURRDRRURRDRRURRDRRURRDDDLLDLLUL...

result:

ok AC

Test #49:

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

input:

20 20
11101110111011101110
10111011101110111011
10010101010101010101
11101110111011101110
10111011101110111011
01010101010101010010
11101110111011101110
10111011101110111011
10010101010101010101
11101110111011101110
10111011101110111011
01010101010101010010
11101110111011101110
10111011101110111011
...

output:

URURRDRRURRDRRURRDRRURRDRDURURRDRRURRDRRURRDRDURURRDRRURRDRDURURRDRDULULLDDDRRDRRURRDRRURRDRRURRDRRURRDRULULLDDDRRDRRURRDRRURRDRRURRDRRURRDDDLLDLLULLDLLULLDLLULLDLLULLDDDRRDRRURRDRRURRDRRURRDRRURRDRULULLDDDRRDRRURRDRRURRDRRURRDRRURRDDDLLDLLULLDLLULLDLLULLDLLULLDDDRRDRRURRDRRURRDRRURRDRRURRDDDLLDLLUL...

result:

ok AC

Test #50:

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

input:

20 20
11101111011011101111
10110101110010110010
11011011011011011011
01101101101101101101
10110110110110110111
10011011011011011010
11101101101101101101
10110110110110110111
11011011011011011001
01101101101101101101
10110110110110110111
11011011011011011001
01101101101101101101
10110110110110110110
...

output:

RRRDRRDRDRDRDRDRDRDRDRDRRDDRRRDRRDRDRDRDRDRDRDRDRDRRUUULLULULULULULUURRDRDRDRDRRUULUURRRRDRRDRDRDRDRDRDRDRDRDRRUUULLULULULULULUURRDRDRDRDRRUULUULLRRRDRRDRDRDRDRDRDRDRDRDRRUUULLULULULULULUURRDRDRDRDRDRRRDRRDRDRDRDRDRDRDRDRDRRUUUURRRDRRURRRRDDLRRRDDDRDRDRDRDRDRDRDRDRDRDRDRDDLLULULULULULULULULULULULULU...

result:

ok AC

Test #51:

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

input:

20 20
01000111011111011111
11101101100101100101
10110110110110110110
11011011011011011011
01101101101101101101
00110110110110110111
01011011011011011010
11101101101101101100
10110110110110110110
11011011011011011011
01101101101101101101
00110110110110110111
01011011011011011010
11101101101101101100
...

output:

DRDRDRDRDRDRDRDRDRDRDRDRDRDRDRDRDRRUULULULULULULULULULULULULULULULDRDRDRDRDRDRDRDRDRDRDRDRDRDRDRDRDRRUULULULULULULULULULULULULULULUURRDRDRDRDRDRDRDRDRDRDRDRRUULULULULULULULULUURRDRDRDRDRDRRUULULUURRDDRDRDRDRDRDRDRDRDRDRDRDRDRDRDRDRDRRUULULULULULULULULULULULULULULUURRDRDRDRDRDRDRDRDRDRDRDRRUULULULULU...

result:

ok AC

Test #52:

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

input:

20 20
11111011111011111011
00101100101100101101
10110110110110110111
10011011011011011001
11101101101101101101
10110110110110110110
11011011011011011011
01101101101101101101
00110110110110110111
10011011011011011001
11101101101101101101
10110110110110110110
11011011011011011011
01101101101101101101
...

output:

RRRRDRDRDRDRDRDRDRDRDRDRDRDRDRDRRDDRRRRDRDRDRDRDRDRDRDRDRDRDRDRDRDRRUULULULULULULULULULULULUURRDRDRDRDRDRDRDRDRRDDRRRRDRDRDRDRDRDRDRDRDRDRDRDRDRDRRUULULULULULULULULULULULUURRDRDRDRDRDRDRDRDRRUULULULULULUURRDRDRRDDRRRRDRDRDRDRDRDRDRDRDRDRDRDRDRDRRUULULULULULULULULULULULUURRDRDRDRDRDRDRDRDRRUULULULULU...

result:

ok AC

Test #53:

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

input:

20 20
10111011111011111001
10101100101100101101
10110110110110110111
10011011011011011001
11101101101101101101
10110110110110110110
11011011011011011011
01101101101101101101
10110110110110110111
10011011011011011001
11101101101101101101
10110110110110110110
10011011011011011011
11101101101101101101
...

output:

DDDDRRDRDRDRDRDRDRDRDRDRDRDRDRDRDRDRRRDDDDRRDRDRDRDRDRDRDRDRDRDRDRDRDRDRDRRUULULULULULULULULULULULULULULULULUURRDRDRDRDRDRDRDRDRDRDRDRDRDRDRRDDDDDDRRDRDRDRDRDRDRDRDRDRDRDRDRDRDRDRRUULULULULULULULULULULULULULULULULUURRDRDRDRDRDRDRDRDRDRDRDRDRDRDRRUULULULULULULULULULULULUURRDRDRDRDRDRDRDRDRRDDDDDDRRDR...

result:

ok AC

Test #54:

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

input:

20 20
01111101111101111100
10010110010110010110
10011011011011011011
11101101101101101101
10110110110110110110
11011011011011011011
01101101101101101101
10110110110110110111
10011011011011011001
11101101101101101101
10110110110110110110
11011011011011011011
01101101101101101101
10110110110110110111
...

output:

RRRRDRDRDRDRDRDRDRDRDRDRDRDRDRRDDRRRRDRDRDRDRDRDRDRDRDRDRDRDRDRRUULULULULULULULULULULUURRDRDRDRDRDRDRDRRDDRRRRDRDRDRDRDRDRDRDRDRDRDRDRDRRUULULULULULULULULULULUURRDRDRDRDRDRDRDRRUULULULULUURRDRDRDRRRRDRDRDRDRDRDRDRDRDRDRDRDRDRRUULULULULULULULULULULUURRDRDRDRDRDRDRDRRUULULULULUULLRRRRDRDRDRDRDRDRDRDRD...

result:

ok AC

Test #55:

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

input:

20 20
01110001110001110000
11010011010011010000
10110110110110110111
01101101101101101101
11011011011011011011
10110110110110110110
11101101101101101100
00011011011011011000
00110110110110110111
01101101101101101101
11011011011011011011
10110110110110110110
11101101101101101100
00011011011011011000
...

output:

URURRDDLDLDLDDRRURURURURURURRDDLDLDLDLDLDLDLDLDLDDRRURURURURURURURURURURURURRDDLDLDLDLDLDLDLDLDLDLDLDLDLDLDLDDDRRUURURURURURURURURURURURURURURURURRDDLDLDLDLDLDLDLDLDLDLDLDLDLDLDDRRURURURURURURURURURURURRDDLDLDLDLDLDLDLDLDDRRURURURURURRDDLDLDDRRUDLLUURURUULLDLDLDLDLDLLUURURURURURURURURUULLDLDLDLDLDLD...

result:

ok AC

Extra Test:

score: 0
Extra Test Passed