QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#252267 | #7751. Palindrome Path | ucup-team1447# | AC ✓ | 301ms | 199132kb | C++14 | 12.1kb | 2023-11-15 17:28:06 | 2023-11-15 17:28:07 |
Judging History
answer
// Problem: B. Doremy's Connecting Plan
// Contest: Codeforces - Codeforces Round 906 (Div. 1)
// URL: https://codeforces.com/contest/1889/problem/B
// Memory Limit: 256 MB
// Time Limit: 1000 ms
//
// Powered by CP Editor (https://cpeditor.org)
// dottle bot
#ifndef ONLINE_JUDGE
#define DEBUG
#endif
#include <stdio.h>
#include <string.h>
#include <algorithm>
#include <queue>
#include <vector>
#include <time.h>
#include <map>
#include <assert.h>
#include <math.h>
#include <set>
#define nln puts("")
#define od(x) printf("%d",x)
#define odb(x) printf("%d ",x)
#define odl(x) printf("%d\n",x)
#define odp(x,y) printf("%d %d\n",x,y)
#define ol(x) puts("")
#define old(x) printf("%lld",x)
#define oldb(x) printf("%lld ",x)
#define oldl(x) printf("%lld\n",x)
#define oldp(x,y) printf("%lld %lld\n",x,y)
#define rg(x) for(int i=1;i<=(x);i++){
#define rg_(i,x) for(int i=1;i<=(x);i++){
#define fe(u) for(int i=h[u];i;i=e[i].nxt){int v=e[i].v;
#define gr }
#define rrg(x) for(int i=0;i<(x);i++){
#define rdln(a) a[i]=read();
#define rdln0(a,x) rrg(x) rdln(a) gr
#define rdln1(a,x) rg(x) rdln(a) gr
// #define int long long
const int mod=998244353;
#ifdef int
#define inf 0x3f3f3f3f3f3f3f3fll
#else
#define inf 0x3f3f3f3f
#endif
inline int min(int a,int b){return a>b?b:a;}
inline int max(int a,int b){return a<b?b:a;}
#define cmlSEGMIN
#define cmlSEGMAX
#define cmlSEGSUM
class SegTreeAl{
#ifdef cmlSEGMIN
int minn[1000005<<2];
#endif
#ifdef cmlSEGMAX
int maxn[1000005<<2];
#endif
#ifdef cmlSEGSUM
int sum[1000005<<2];
#endif
int tag[1000005<<2];
#ifdef cmlSEGSUM
void pushdown(int o,int l,int r)
#else
void pushdown(int o)
#endif
{
int&t=tag[o];
#ifdef cmlSEGMIN
minn[o<<1]+=t;
minn[o<<1|1]+=t;
#endif
#ifdef cmlSEGMAX
maxn[o<<1]+=t;
maxn[o<<1|1]+=t;
#endif
#ifdef cmlSEGSUM
int m=l+r>>1;
sum[o<<1]+=t*(m-l+1);
sum[o<<1|1]+=t*(r-m);
#endif
tag[o<<1]+=t;
tag[o<<1|1]+=t;
t=0;
}
void add(int o,int l,int r,int L,int R,int v)
{
if(L<=l&&r<=R)
{
#ifdef cmlSEGMAX
maxn[o]+=v;
#endif
#ifdef cmlSEGMIN
minn[o]+=v;
#endif
#ifdef cmlSEGSUM
sum[o]+=v*(r-l+1);
#endif
tag[o]+=v;
return;
}
int m=l+r>>1;
#ifdef cmlSEGSUM
pushdown(o,l,r);
#else
pushdown(o);
#endif
if(L<=m)add(o<<1,l,m,L,R,v);
if(m<R)add(o<<1|1,m+1,r,L,R,v);
#ifdef cmlSEGMAX
maxn[o]=max(maxn[o<<1],maxn[o<<1|1]);
#endif
#ifdef cmlSEGMIN
minn[o]=min(minn[o<<1],minn[o<<1|1]);
#endif
#ifdef cmlSEGSUM
sum[o]=sum[o<<1]+sum[o<<1|1];
#endif
}
#ifdef cmlSEGMIN
int qmin(int o,int l,int r,int L,int R)
{
if(L<=l&&r<=R)
{
return minn[o];
}
int m=l+r>>1,res=inf;
#ifdef cmlSEGSUM
pushdown(o,l,r);
#else
pushdown(o);
#endif
if(L<=m)res=min(res,qmin(o<<1,l,m,L,R));
if(m<R)res=min(res,qmin(o<<1|1,m+1,r,L,R));
#ifdef cmlSEGMAX
maxn[o]=max(maxn[o<<1],maxn[o<<1|1]);
#endif
#ifdef cmlSEGMIN
minn[o]=min(minn[o<<1],minn[o<<1|1]);
#endif
#ifdef cmlSEGSUM
sum[o]=sum[o<<1]+sum[o<<1|1];
#endif
return res;
}
#endif
#ifdef cmlSEGMAX
int qmax(int o,int l,int r,int L,int R)
{
if(L<=l&&r<=R)
{
return maxn[o];
}
int m=l+r>>1,res=-inf;
#ifdef cmlSEGSUM
pushdown(o,l,r);
#else
pushdown(o);
#endif
if(L<=m)res=max(res,qmax(o<<1,l,m,L,R));
if(m<R)res=max(res,qmax(o<<1|1,m+1,r,L,R));
#ifdef cmlSEGMAX
maxn[o]=max(maxn[o<<1],maxn[o<<1|1]);
#endif
#ifdef cmlSEGMIN
minn[o]=min(minn[o<<1],minn[o<<1|1]);
#endif
#ifdef cmlSEGSUM
sum[o]=sum[o<<1]+sum[o<<1|1];
#endif
return res;
}
#endif
#ifdef cmlSEGSUM
int qsum(int o,int l,int r,int L,int R)
{
if(L<=l&&r<=R)
{
return sum[o];
}
int m=l+r>>1,res=0;
#ifdef cmlSEGSUM
pushdown(o,l,r);
#else
pushdown(o);
#endif
if(L<=m)res+=qsum(o<<1,l,m,L,R);
if(m<R)res+=qsum(o<<1|1,m+1,r,L,R);
#ifdef cmlSEGMAX
maxn[o]=max(maxn[o<<1],maxn[o<<1|1]);
#endif
#ifdef cmlSEGMIN
minn[o]=min(minn[o<<1],minn[o<<1|1]);
#endif
#ifdef cmlSEGSUM
sum[o]=sum[o<<1]+sum[o<<1|1];
#endif
return res;
}
#endif
};
#define newe(n) struct Edge{int v,w,nxt;}e[2*n+5];\
typedef int arr[n+5];\
arr h;\
int cnt=1;\
inline void addedge(int u,int v,int w){e[cnt]=(Edge){v,w,h[u]};h[u]=cnt++;}\
struct node{\
int u,d;\
bool operator<(const node&b)const{return d>b.d;}\
};\
void dij(int s,int *d,int N)\
{\
memset(d,0x3f,sizeof(int)*(N+3));\
d[s]=0;std::priority_queue<node>q;q.push((node){s,0});\
while(!q.empty())\
{\
int u=q.top().u,D=q.top().d;q.pop();if(D!=d[u])continue;\
for(int i=h[u];i;i=e[i].nxt){int v=e[i].v,w=e[i].w;\
if(d[u]+w<d[v])d[v]=d[u]+w,q.push((node){v,d[v]});\
}\
}\
}
#define mgs int fa[1<<22],sz[1<<22];\
inline int f(int x){return x==fa[x]?x:fa[x]=f(fa[x]);}\
inline int uf(int x,int y)\
{\
int fx=f(x),fy=f(y);\
if(fx==fy)return 0;\
if(sz[fx]>sz[fy])fx^=fy^=fx^=fy;\
fa[fx]=fy,sz[fy]+=sz[fx];\
return 1;\
}
inline int read()
{
int num=0,f=1;char c=getchar();
while(c<48||c>57){if(c=='-')f=-1;c=getchar();}
while(c>47&&c<58)num=num*10+(c^48),c=getchar();
return num*f;
}
inline int re1d()
{
char c=getchar();
while(c<48||c>49)c=getchar();
return c&1;
}
#ifdef cmlBIT
struct BIT{int a[1<<20|1],n;
void add(int x,int p){while(x<=n)a[x]+=p,x+=x&-x;}
int operator[](int x){int res=0;while(x)res+=a[x],x-=x&-x;return res;}
int operator()(int l,int r){return (*this)[r]-(*this)[l-1];}};
#endif
int rnv[1000005];
// #define COMB
#ifdef COMB
#ifndef int
#define int long long
#endif
int fac[1000005],inv[1000005];
#endif
void initprog()
{
#ifdef COMB
fac[0]=inv[0]=inv[1]=1;
rg(1000000)fac[i]=fac[i-1]*i%mod;gr
rg(1000000)if(i>1)inv[i]=inv[mod%i]*(mod-mod/i)%mod;gr
rg(1000000)rnv[i]=inv[i];gr
rg(1000000)inv[i]=inv[i]*inv[i-1]%mod;gr
#endif
}
#ifdef COMB
int C(int n,int m)
{
if(n==m||m==0)return 1;
if(n<m)return 0;
return fac[n]*inv[m]%mod*inv[n-m]%mod;
}
#endif
inline int qp(int a,int b){int c=1;while(b){if(b&1)c=c*a%mod;a=a*a%mod;b>>=1;}return c;}
inline int mae(int &a,int b){a+=b;if(a>=mod)a-=mod;return a;}
inline int mde(int &a,int b){a+=mod-b;if(a>=mod)a-=mod;return a;}
inline int mle(int &a,int b){a=a*b%mod;return a;}
inline int mve(int &a,int b){a=a*qp(b,mod-2)%mod;return a;}
inline int mxe(int &a,int b){return a=a>b?a:b;}
inline int mne(int &a,int b){return a=a<b?a:b;}
inline int ae(int a,int b){int c=a+b;return c>=mod?c-mod:c;}
inline int de(int a,int b){return ae(a,mod-b);}
inline int me(int a,int b){return a*b%mod;}
inline int mive(int &a,int b){a=a*rnv[b]%mod;return a;}
inline int ive(int a,int b){return a*rnv[b]%mod;}
inline int ve(int a,int b){return a*qp(b,mod-2)%mod;}
#ifdef cmlST
struct STmin{
int a[21][1000005],n;
void init(int N,int *b)
{
n=N;
rg(n)a[0][i]=b[i];gr
rg(20)rg_(j,n-(1<<i)+1)a[i][j]=min(a[i-1][j],a[i-1][j+(1<<i-1)]);gr gr
}
int q(int l,int r)
{
int d=std::__lg(r-l+1);
return min(a[d][l],a[d][r-(1<<d)+1]);
}
};
struct STmax{
int a[21][1000005],n;
void init(int N,int *b)
{
n=N;
rg(n)a[0][i]=b[i];gr
rg(20)rg_(j,n-(1<<i)+1)a[i][j]=max(a[i-1][j],a[i-1][j+(1<<i-1)]);gr gr
}
int q(int l,int r)
{
int d=std::__lg(r-l+1);
return max(a[d][l],a[d][r-(1<<d)+1]);
}
};
#endif
#ifdef cmlSAM
struct SAM{
int ch[1000005][26],lnk[1000005],len[1000005],lst=1,cc=1;
int sz[1000005];
void insert(int c)
{
len[++cc]=len[lst]+1;sz[cc]=1;
int p=lst;lst=cc;
while(p&&ch[p][c]==0)ch[p][c]=cc,p=lnk[p];
if(p==0)lnk[cc]=1;
else
{
int x=ch[p][c];
if(len[p]+1==len[x])lnk[cc]=x;
else
{
int q=cc;++cc;
lnk[cc]=lnk[x];
lnk[x]=lnk[q]=cc;
len[cc]=len[p]+1;
memcpy(ch[cc],ch[x],sizeof(ch[cc]));
while(p&&ch[p][c]==x)ch[p][c]=cc,p=lnk[p];
}
}
}
newe(1000005);
long long ans;
void build()
{
rg(cc)addedge(lnk[i],i,0);gr
}
void dfs(int u)
{
fe(u)dfs(v),sz[u]+=sz[v];gr
if(sz[u]>1)ans=max(ans,1ll*sz[u]*len[u]);
}
}t;
#endif
int a[109][109],vis[109][109];
void dfs(int x,int y)
{
if(vis[x][y])return;
vis[x][y]=1;
dfs(x-1,y+0);
dfs(x+1,y+0);
dfs(x-0,y+1);
dfs(x-0,y-1);
}
int sx,sy,tx,ty;
int dir[4][2]={1,0,-1,0,0,1,0,-1},cc,dd;
char R[14]="DURL";
char res[1234567],kes[1234567];
void walk(int d)
{
res[++cc]=R[d];
tx+=dir[d^1][0],ty+=dir[d^1][1];
int A=sx,B=sy;
A+=dir[d][0],B+=dir[d][1];
if(a[A][B]==0)sx=A,sy=B;
}
using pi=std::pair<int,int>;
struct wew{
int sx,sy,tx,ty;
// bool operator<(const wew&v)const{
// return d>v.d;
// }
};
wew walk(int sx,int sy,int tx,int ty,int d)
{
tx+=dir[d^1][0],ty+=dir[d^1][1];
int A=sx,B=sy;
A+=dir[d][0],B+=dir[d][1];
if(a[A][B]==0)sx=A,sy=B;
// pi X={sx,sy},Y={tx,ty};
return {sx,sy,tx,ty};
}
wew walk2(int sx,int sy,int tx,int ty,int d)
{
int C=tx+dir[d][0],D=ty+dir[d][1];
// if(sx+sy+tx+ty==24&&R[d]=='L')
if(a[C][D])
{
int A=sx,B=sy;
A+=dir[d][0],B+=dir[d][1];
if(a[A][B]==0)sx=A,sy=B;
}
// pi X={sx,sy},Y={tx,ty};
return {sx,sy,tx,ty};
}
void dfs2()
{
vis[tx][ty]=1;
// odp(tx,ty);fflush(stdout);
for(int i=0;i<4;i++)
{
if(vis[tx+dir[i^1][0]][ty+dir[i^1][1]])continue;
walk(i);
//
dfs2();
walk(i^1);
}
}
int f[32][32][32][32],g[32][32][32][32];
wew h[32][32][32][32];
std::vector<std::pair<wew,int> >G[32][32][32][32];
int SX=sx,SY=sy,TX=tx,TY=ty;
int fis[66][66];
void qwq(char c)
{
putchar(c);
int p=SX,q=SY;
fis[p][q]=1;
if(c=='R')q++;
if(c=='L')q--;
if(c=='D')p++;
if(c=='U')p--;
if(a[p][q]==0)SX=p,SY=q;
fis[SX][SY]=1;
// odp(SX,SY);
}
signed main()
{
initprog();
int n=read(),m=read();
rrg(100)rg_(j,100)a[i][j-1]=vis[i][j-1]=1;gr gr
rg(n)rg_(j,m)vis[i][j]=a[i][j]=!re1d();gr gr
sx=read(),sy=read(),tx=read(),ty=read();
SX=sx,SY=sy,TX=tx,TY=ty;
dfs(sx,sy);
rg(n)rg_(j,m)if(vis[i][j]==0)return puts("-1"),0;gr gr
rg(n)rg_(j,m)vis[i][j]=a[i][j];gr gr
dfs2();
// puts(res+1);
// odp(sx,sy);
// odp(tx,ty);fflush(stdout);
memset(f,inf,sizeof(f));
std::queue<wew>q;
for(int i=1;i<=n;i++)
for(int j=1;j<=m;j++)
if(a[i][j]==0)
{
q.push({i,j,i,j});
f[i][j][i][j]=0;
g[i][j][i][j]=-114;
}
for(int i=1;i<=n;i++)
for(int j=1;j<=m;j++)
if(a[i][j]==0)
{
for(int d=0;d<4;d++)
{
int x=i+dir[d][0],y=j+dir[d][1];
if(a[x][y])continue;
q.push({i,j,x,y});
f[i][j][x][y]=1;
g[i][j][x][y]=-d-1;
}
}
for(int i=1;i<=n;i++)
for(int j=1;j<=m;j++)
if(a[i][j]==0)
for(int x=1;x<=n;x++)
for(int y=1;y<=m;y++)
if(a[x][y]==0)
{
for(int d=0;d<4;d++)
{
for(int ee=0;ee<2;ee++)
{
wew c=ee?walk(i,j,x,y,d):walk2(i,j,x,y,d);
auto [q,w,e,r]=c;
wew t={i,j,x,y};
G[q][w][e][r].push_back({t,d});
// printf("[%d %d %d %d]->[%d %d %d %d]\n",i,j,x,y,q,w,e,r);
}
}
}
while(!q.empty())
{
auto [i,j,x,y]=q.front();q.pop();
for(auto [c,d]:G[i][j][x][y])
{
// wew c=walk(i,j,x,y,d);
auto [I,J,X,Y]=c;
if(f[I][J][X][Y]==inf)
f[I][J][X][Y]=f[i][j][x][y]+1,
g[I][J][X][Y]=d,q.push(c),h[I][J][X][Y]={i,j,x,y};
}
}
if(f[sx][sy][tx][ty]==inf)
{
// int *a
while(clock()*1./CLOCKS_PER_SEC<0.5)tx=(tx+ty)%(sx+5);
return puts("-1"),0;
}
// return 0;
while(1)
{
int d=g[sx][sy][tx][ty];
// printf("%d %d %d %d : %d\n",sx,sy,tx,ty,d);fflush(stdout);
if(d<0)
{
// std::reverse(kes+1,kes+1+dd);
// odl(dd);
// puts(res+1);
// puts(kes+1);
for(int i=1;i<=cc;i++)qwq(res[i]);
// puts("--");
// printf("@@@@@@@@@@");odp(SX,SY);
for(int i=1;i<=dd;i++)qwq(kes[i]);
// printf("@@@@@@@@@@");odp(SX,SY);
if(d>-10)
{
qwq(R[-d-1]);
}
for(int i=dd;i>=1;i--)qwq(kes[i]);
// printf("@@@@@@@@@@");odp(SX,SY);
for(int i=cc;i>=1;i--)qwq(res[i]);
puts("");
// rg(n)rg_(j,m)od(fis[i][j]);gr puts("");gr
fflush(stdout);
// assert(SX==TX);
// assert(SY==TY);
// rg(n)rg_(j,m)if(a[i][j]==0)assert(fis[i][j]);gr gr
return 0;
}
// putchar(R[d]);
kes[++dd]=R[d];
wew t=h[sx][sy][tx][ty];
auto [i,j,x,y]=t;
sx=i;
sy=j;
tx=x;
ty=y;
}
return 0;
}
这程序好像有点Bug,我给组数据试试?
详细
Test #1:
score: 100
Accepted
time: 4ms
memory: 38236kb
input:
2 2 11 11 1 1 2 2
output:
DRUDLURDRULDURD
result:
ok Valid Solution (Length = 15).
Test #2:
score: 0
Accepted
time: 0ms
memory: 28308kb
input:
2 2 10 01 1 1 2 2
output:
-1
result:
ok No Solution.
Test #3:
score: 0
Accepted
time: 3ms
memory: 36956kb
input:
1 1 1 1 1 1 1
output:
result:
ok Valid Solution (Length = 0).
Test #4:
score: 0
Accepted
time: 0ms
memory: 40024kb
input:
5 4 1111 1111 1111 1111 1111 4 2 4 2
output:
DDDRUUUULLDDDDLUUUUDDDDRUUUURRDDDDLUUUDLDUUULDDDDRRUUUURDDDDUUUULDDDDLLUUUURDDD
result:
ok Valid Solution (Length = 79).
Test #5:
score: 0
Accepted
time: 0ms
memory: 40276kb
input:
5 5 11111 10101 11111 10101 11111 1 4 5 5
output:
DDDDRRUUUURRDDDDLRUULRUULLLRDDLRDDLLUUUURRDDDDRRUUUULLDDRLDDRLLLUURLUURLDDDDRRUUUURRDDDD
result:
ok Valid Solution (Length = 88).
Test #6:
score: 0
Accepted
time: 0ms
memory: 40240kb
input:
5 3 111 100 111 001 111 4 3 3 2
output:
RDDLLRRUULLUURRLLDDRRDDLLRRUULLUURRLLDDR
result:
ok Valid Solution (Length = 40).
Test #7:
score: 0
Accepted
time: 0ms
memory: 39488kb
input:
5 4 1001 1101 1111 0011 0010 2 2 1 1
output:
UULDULUUDLDDDUUURDRRDDULUDDRRDRUUUDDDLDUULUDLUU
result:
ok Valid Solution (Length = 47).
Test #8:
score: 0
Accepted
time: 4ms
memory: 40772kb
input:
5 3 101 111 100 111 100 4 1 2 2
output:
RDUUUUDLLRRDDLLDURRLLUULLRRUDLLDDRRLLDUUUUDR
result:
ok Valid Solution (Length = 44).
Test #9:
score: 0
Accepted
time: 4ms
memory: 45008kb
input:
5 5 01110 10110 11110 11011 11100 2 4 5 1
output:
DDDULUULRDDLDDRLLUUULRDDDRUURRUULDDLDDLUURRUURDDDRLUUULLRDDLDDRLUULUDDD
result:
ok Valid Solution (Length = 71).
Test #10:
score: 0
Accepted
time: 0ms
memory: 40156kb
input:
5 3 011 111 110 111 011 3 1 2 1
output:
UULDDDLUDRUUUULDURDRDDLLDDRDRUDLUUUURDULDDDLUU
result:
ok Valid Solution (Length = 46).
Test #11:
score: 0
Accepted
time: 0ms
memory: 40348kb
input:
4 5 11111 11111 11111 11111 3 2 1 3
output:
UUURDDDRUUUDDDLUUULLDDDLUUUDDDRUUURDDDUUUDDDRUUURDDDUUULDDDLLUUULDDDUUURDDDRUUU
result:
ok Valid Solution (Length = 79).
Test #12:
score: 0
Accepted
time: 3ms
memory: 42652kb
input:
5 5 11111 10101 11111 10101 11111 2 5 1 1
output:
UUUULLDDDDRLLLUUUURLDDRLDDRRUURLUURRDDDDUULLLLUUDDDDRRUULRUURRDDLRDDLRUUUULLLRDDDDLLUUUU
result:
ok Valid Solution (Length = 88).
Test #13:
score: 0
Accepted
time: 7ms
memory: 40480kb
input:
4 5 11111 10000 11111 00001 1 3 4 5
output:
DRRRRDDLLLLRRRRUULLLLUDDRRRRDDULLLLUURRRRLLLLDDRRRRD
result:
ok Valid Solution (Length = 52).
Test #14:
score: 0
Accepted
time: 2ms
memory: 28704kb
input:
3 5 10100 00010 00111 1 3 1 1
output:
-1
result:
ok No Solution.
Test #15:
score: 0
Accepted
time: 0ms
memory: 40156kb
input:
4 5 10001 11111 11100 11111 4 5 3 1
output:
DDULUURLLDDLLDURRUULLRRRDDRUDLLLLDURDDRRRLLUURRUDLLDDLLRUULUDD
result:
ok Valid Solution (Length = 62).
Test #16:
score: 0
Accepted
time: 3ms
memory: 38288kb
input:
3 5 11111 10100 11111 1 2 3 5
output:
RRDDRRUULRDDLLLLRRUULLRRDDRRLLUURRLLLLDDRLUURRDDRR
result:
ok Valid Solution (Length = 50).
Test #17:
score: 0
Accepted
time: 0ms
memory: 28996kb
input:
4 5 01110 10101 11011 10111 1 3 2 3
output:
-1
result:
ok No Solution.
Test #18:
score: 0
Accepted
time: 3ms
memory: 40496kb
input:
5 5 11111 11111 11111 11111 11111 1 3 5 2
output:
DDDDRUUUUDDDDLLUUUULDDDDLUUUUDDDDRUUUURDDDDRUUUULDDDDLUUUURDDDDRUUUURDDDDUUUULDDDDLUUUULLDDDDUUUURDDDD
result:
ok Valid Solution (Length = 102).
Test #19:
score: 0
Accepted
time: 3ms
memory: 40024kb
input:
5 5 11111 10101 11111 10101 11111 5 1 2 3
output:
DRRUUUULLDDRLLLDDRLUUUURLDDRRUURRDDDDLLUUUULLDDDDRRUURRDDLRUUUULRDDLLLRDDLLUUUURRD
result:
ok Valid Solution (Length = 82).
Test #20:
score: 0
Accepted
time: 5ms
memory: 43260kb
input:
5 5 11111 10000 11111 00001 11111 4 5 5 3
output:
RRLLLLDDRRRRDDLLLLRRRRUULLLLUURRLLDDRRRRDDLLRRUULLLLUURRRRLLLLDDRRRRDDLLLLRR
result:
ok Valid Solution (Length = 76).
Test #21:
score: 0
Accepted
time: 2ms
memory: 28236kb
input:
5 5 01010 10101 10101 11001 10011 4 1 5 4
output:
-1
result:
ok No Solution.
Test #22:
score: 0
Accepted
time: 0ms
memory: 39872kb
input:
5 5 10101 11111 10101 11111 11111 3 1 2 4
output:
RDUUUURDRDDDULRUUUDLULLDLDDDUUUUDRURDDDLRUUURLDDDRURDUUUUDDDLDLLULDUUURLUDDDRDRUUUUDR
result:
ok Valid Solution (Length = 85).
Test #23:
score: 0
Accepted
time: 0ms
memory: 44976kb
input:
5 5 00001 11111 01110 01111 01111 1 5 5 2
output:
DDDRLLUUULDDDLDURUULUDRURDDDRUUULLDLLUUURDDDRURDULUURUDLDDDLUUULLRDDD
result:
ok Valid Solution (Length = 69).
Test #24:
score: 0
Accepted
time: 5ms
memory: 28380kb
input:
5 5 01011 10111 11011 10101 01110 4 1 2 3
output:
-1
result:
ok No Solution.
Test #25:
score: 0
Accepted
time: 3ms
memory: 43204kb
input:
10 8 11111111 11111111 11111111 11111111 11111111 11111111 11111111 11111111 11111111 11111111 7 7 3 6
output:
DDRUUUUUUUUURDDDDDDDDDRUUUUUUUUURDDDDDDDDDRUUUUUUUUUDDDDDDDDDLUUUUUUUUULDDDDDDDDDLUUUUUUUUULLDDDDDDLDDDLUUUUUUUUURDDDDDUUUUULDDDDDDDDDRUUURUUUUUURDDDDDDDDDLUUDDUUUUURRRUUUUUDDUULDDDDDDDDDRUUUUUURUUURDDDDDDDDDLUUUUUDDDDDRUUUUUUUUULDDDLDDDDDDLLUUUUUUUUULDDDDDDDDDLUUUUUUUUULDDDDDDDDDUUUUUUUUURDDDDDDDDD...
result:
ok Valid Solution (Length = 333).
Test #26:
score: 0
Accepted
time: 3ms
memory: 47424kb
input:
10 6 111111 101010 111111 101010 111111 101010 111111 101010 111111 101010 1 6 2 3
output:
DRRUUUUUUUUUDLLDDDDDDRLLLDDRLLRUUUUUUUUUDRLLRDDRLLRDDRLLRDDLRRRUURLUURLUUUDRRDDDDDDDDLLULDLULLDDDDDDDDRRDUUULRUULRUURRRLDDRLLRDDRLLRDDRLLRDUUUUUUUUURLLRDDLLLRDDDDDDLLDUUUUUUUUURRD
result:
ok Valid Solution (Length = 179).
Test #27:
score: 0
Accepted
time: 0ms
memory: 46136kb
input:
10 10 1111111111 1000000000 1111111111 0000000001 1111111111 1000000000 1111111111 0000000001 1111111111 1000000000 5 5 5 2
output:
RUULLLLLLLLLUURRRRRRRRRUDLLLLLLLLLDDRRRRRRRRRDDLLLLLLLLLDDRRRRRRRRRDDLLLLLLLLLRRRRRRRRRUULLLLLLLLLUURRRRRRRRRUULLLLLLLLLUURRRRRRRRRUULLLLLLLLLUURRRRRRRRRLLLLLLLLLDDRRRRRRRRRDDLLLLLLLLLDDRRRRRRRRRDDLLLLLLLLLDURRRRRRRRRUULLLLLLLLLUUR
result:
ok Valid Solution (Length = 231).
Test #28:
score: 0
Accepted
time: 3ms
memory: 30044kb
input:
10 10 1010110101 0000011010 1001001001 0011111000 1000111100 1011101001 1100110011 0110001011 0011111000 0101011101 7 5 4 3
output:
-1
result:
ok No Solution.
Test #29:
score: 0
Accepted
time: 6ms
memory: 44460kb
input:
10 6 100100 111111 100001 111111 101111 111111 101010 111111 111100 111111 6 5 7 3
output:
DDDRRDDDULLLDULLUUUURDDRUUDDLUUUURUURDDRUURDDDDDULRUUUULDDLUULLLRRDDLLRDDLDDDDRRRRRUULLUUUDRRDDLLLLLDDRRDUUULLUURRRRRDDDDLDDRLLDDRRLLLUULDDLUUUURLUDDDDDRUURDDRUURUUUULDDUURDDRUUUULLUDLLLUDDDRRDDD
result:
ok Valid Solution (Length = 195).
Test #30:
score: 0
Accepted
time: 10ms
memory: 43064kb
input:
10 8 11111110 11110111 01111111 11111101 11011101 11111111 11111011 11011101 11001111 11111110 7 1 2 1
output:
DLUUUUUUUUURDDDDDDUUUUUULLLLDDDDDDDRDDRUUULUUUUDRDULDDDRDDDLLLUUUUULULDDDDDRDUUDLUUUUUUURURDDUULDLDDRDRDDDDDRRUULUUUUUUURRRDDDDDDDDDRULDLLLULLLDLURDDDDDDDDDRRRUUUUUUULUURRDDDDDRDRDDLDLUUDDRURUUUUUUULDUUDRDDDDDLULUUUUULLLDDDRDDDLUDRDUUUULUUURDDRDDDDDDDLLLLUUUUUUDDDDDDRUUUUUUUUULD
result:
ok Valid Solution (Length = 279).
Test #31:
score: 0
Accepted
time: 0ms
memory: 30412kb
input:
10 10 1111011101 1110111110 1111011111 1011101111 0101010111 1110111111 0111010111 1011111011 0111010101 1011111110 2 6 7 4
output:
-1
result:
ok No Solution.
Test #32:
score: 0
Accepted
time: 3ms
memory: 46448kb
input:
8 10 1111111111 1111111111 1111111111 1111111111 1111111111 1111111111 1111111111 1111111111 8 10 6 10
output:
DDDDDRUUUUUUURDDDDDDDRUUUUUUURDDDDDDDRUUUUUUURDDDDDDDRUUUUUUURDDDDDDDRUUUUUUUDDDDDDDLUUUUUUULDDDDDDDLUUUUUUULDDDDDDDLUUUUUUULDDDDDDDLUUUUUUULLDURDDDDDDDLUUUUURRRRRDDDRRRRRUUUUULDDDDDDDRUDLLUUUUUUULDDDDDDDLUUUUUUULDDDDDDDLUUUUUUULDDDDDDDLUUUUUUULDDDDDDDUUUUUUURDDDDDDDRUUUUUUURDDDDDDDRUUUUUUURDDDDDDDR...
result:
ok Valid Solution (Length = 329).
Test #33:
score: 0
Accepted
time: 3ms
memory: 43240kb
input:
10 10 1111111111 1010101010 1111111111 1010101010 1111111111 1010101010 1111111111 1010101010 1111111111 1010101010 3 5 9 1
output:
DDDDDDDDLLUUUUUUUUUDRLLLDDDDDDDDRLLLUUUUUUUUUDRLLLDDDDDDDDRLLRUURLLRUURLLRUURLLRUUUDLRRRDDRLDDRLDDRLDDRRUURLUURLUURLUUUDRRDDRLDDRLDDRLDDRRUUUUUUUUUDDDDLDLLLDLDDDDUUUUUUUUURRDDLRDDLRDDLRDDRRDUUULRUULRUULRUURRDDLRDDLRDDLRDDRRRLDUUURLLRUURLLRUURLLRUURLLRDDDDDDDDLLLRDUUUUUUUUULLLRDDDDDDDDLLLRDUUUUUUUUUL...
result:
ok Valid Solution (Length = 309).
Test #34:
score: 0
Accepted
time: 0ms
memory: 44716kb
input:
10 10 1111111111 1000000000 1111111111 0000000001 1111111111 1000000000 1111111111 0000000001 1111111111 1000000000 5 4 7 2
output:
RDDLLLLLLLLLDDRRRRRRRRRDDLLLLLLLLLRRRRRRRRRUULLLLLLLLLUURRRRRRRRRUULLLLLLLLLUURRRRRRRRRUDLLLLLLLLLDDRRRRRRRRRDDLLLLLLLLLDDRRRRRRRRRDDLLLLLLLLLDURRRRRRRRRUULLLLLLLLLUURRRRRRRRRUULLLLLLLLLUURRRRRRRRRLLLLLLLLLDDRRRRRRRRRDDLLLLLLLLLDDR
result:
ok Valid Solution (Length = 231).
Test #35:
score: 0
Accepted
time: 2ms
memory: 29356kb
input:
9 10 1111001000 1110010111 0001001000 0101000101 1101000001 0111100110 0010010000 0001001000 1011001101 2 8 5 2
output:
-1
result:
ok No Solution.
Test #36:
score: 0
Accepted
time: 0ms
memory: 40096kb
input:
5 10 1001011101 1111111111 1000011001 1111111111 1101110010 4 3 4 7
output:
DDDRUUUURDRUDRRURDDDDULLLDULRRRRUUULDLLLULDDDDLLULLDUUURUDRLLDDRRDRUUURRRUUURDRRDDLLRDURUUUDLLULLDDDDLULLLDLUUURRRRLUDLLLUDDDDRURRDURDRUUUURDDD
result:
ok Valid Solution (Length = 143).
Test #37:
score: 0
Accepted
time: 5ms
memory: 29564kb
input:
7 10 1111111001 1111101110 1111011111 1101011101 1111011111 1111001011 1111111011 7 10 7 2
output:
-1
result:
ok No Solution.
Test #38:
score: 0
Accepted
time: 6ms
memory: 48208kb
input:
9 10 0101011101 1111111111 0101111111 1111111111 1111110101 1011111111 1101111101 1111111011 1101011111 3 7 7 10
output:
DDDDDDURUURDDDRUUURDDDURUUUUUURDDDDDDDURRDUUUURDUUUUULDDULRURDDDDLLDUUDRDDDRLLLUUUUUUUDLLDDDULUUURLLLDLUDRURRDDLDDULRURDRUURDDDDDDLUULDDDLUUULDDLUUUUURRDRRDDRRDRRUUUUULDDLUUULDDDLUULDDDDDDRUURDRURLUDDLDDRRURDULDLLLRUUULUDDDLLDUUUUUUULLLRDDDRDUUDLLDDDDRURLUDDLUUUUUDRUUUUDRRUDDDDDDDRUUUUUURUDDDRUUURDD...
result:
ok Valid Solution (Length = 312).
Test #39:
score: 0
Accepted
time: 0ms
memory: 47424kb
input:
10 10 1111111111 1111111111 1111111111 1111111111 1111111111 1111111111 1111111111 1111111111 1111111111 1111111111 9 5 3 2
output:
DDRUUUUUUUUULDDDDDDLDDDLUUUUUUUUURDDDDDUUUUULLDDDDDDDDDLUUUUUUUUULDDDDDDDDDLUUUUUUUUULDDDDDDDDDLUUUUUUUUUDDDDDDDDDRUUUUUUUUURDDDDDDDDDRUUUUUUUUURDDDDDDDDDRUUUUUUUUURDDDDDDDDDRUUURUUUUUURDDDDDDDDDLUUUURLLLLLULLLLLRUUUULDDDDDDDDDRUUUUUURUUURDDDDDDDDDRUUUUUUUUURDDDDDDDDDRUUUUUUUUURDDDDDDDDDRUUUUUUUUURD...
result:
ok Valid Solution (Length = 413).
Test #40:
score: 0
Accepted
time: 6ms
memory: 46488kb
input:
10 10 1111111111 1010101010 1111111111 1010101010 1111111111 1010101010 1111111111 1010101010 1111111111 1010101010 2 1 1 3
output:
UUUUUUUUUDRRDDDDDDDDLRUULRUULRUULRUUUDLLLLDDDDDDDDRLLLUUUUUUUUUDRLLLDDDDDDDDRLLRUURLLRUURLLRUURLLRUUUDLRRRDDRLDDRLDDRLDDRRUURLUURLUURLUUUDRRDDDDDDDDUUUUURRUUUUUDDDDDDDDRRDUUULRUULRUULRUURRDDLRDDLRDDLRDDRRRLDUUURLLRUURLLRUURLLRUURLLRDDDDDDDDLLLRDUUUUUUUUULLLRDDDDDDDDLLLLDUUURLUURLUURLUURLDDDDDDDDRRDU...
result:
ok Valid Solution (Length = 308).
Test #41:
score: 0
Accepted
time: 0ms
memory: 46588kb
input:
10 10 1111111111 1000000000 1111111111 0000000001 1111111111 1000000000 1111111111 0000000001 1111111111 1000000000 7 4 3 5
output:
RRRRDDLLLLLLLLLRRRRRRRRRUULLLLLLLLLUURRRRRRRRRUULLLLLLLLLUURRRRRRRRRUDLLLLLLLLLDDRRRRRRRRRDDLLLLLLLLLDDRRRRRLLLLLUURRRRRRRRRUULLLLLRRRRRDDLLLLLLLLLDDRRRRRRRRRDDLLLLLLLLLDURRRRRRRRRUULLLLLLLLLUURRRRRRRRRUULLLLLLLLLUURRRRRRRRRLLLLLLLLLDDRRRR
result:
ok Valid Solution (Length = 239).
Test #42:
score: 0
Accepted
time: 0ms
memory: 30108kb
input:
10 10 1110000101 1100110001 1011011001 0000000111 0010010111 0100111011 1110010011 1100111111 0110001110 0100000101 9 9 6 10
output:
-1
result:
ok No Solution.
Test #43:
score: 0
Accepted
time: 6ms
memory: 43604kb
input:
10 10 1110111011 1111111111 1110110000 1111111111 1010011100 1111111111 1111001110 1111111111 1001010011 1111111111 6 9 2 9
output:
DLUDRURRDRUUUUURRUUUURRRDDDDDDDDDLUUULDDDULLDUUURLDDRRUUUUUURDDUULDDDDRDDDRUUUUUUUUULLLLLDDRLLDDDDLUUUULDDLRUUUURRLLLDDUURDDRDDDDLLRRRUUUURUURRDDDDLLDDDDDLULLRUUURRURURRUUURLLULDDDDDLLDDDDRRUURUUUURRRLLDDDDRDDRUUDDLLLRRUUUURLDDLUUUULDDDDLLRDDLLLLLUUUUUUUUURDDDRDDDDLUUDDRUUUUUURRDDLRUUUDLLUDDDLUUULDD...
result:
ok Valid Solution (Length = 331).
Test #44:
score: 0
Accepted
time: 6ms
memory: 43328kb
input:
10 10 1111110011 1011111110 0111011111 1101101101 1111111110 1110111101 1011011111 1111111101 1011111101 1111111011 7 3 5 5
output:
DRDDDRUURUUURDDUUUUUULLDDDDDLRUULUUULDDLDDDLDDDRDRUDLUUDLLUUUUUUURDDDUUUURDULDLDDLLDUUUURLDDDRRDDLRDDLDDLRUULUDRRDRUUURURLUURUURDDDRURLUURRDDDDLDDDLDDRRUDLLLUUULURDLLDDLLDRULUUULLLDURRDDLDDDLDDDDRRUULRURDDDRUURUULRURUUURDRRDULUURLDDLDDRLDDRRDDDLRUUUUDLLDDLDLUDRUUUUDDDRUUUUUUULLDUULDURDRDDDLDDDLDDLUU...
result:
ok Valid Solution (Length = 334).
Test #45:
score: 0
Accepted
time: 0ms
memory: 30144kb
input:
10 10 1101011101 1110111011 0101110101 1111101011 1111111111 1010111010 0111111101 1111101011 0111111101 1011101111 3 8 2 2
output:
-1
result:
ok No Solution.
Test #46:
score: 0
Accepted
time: 11ms
memory: 61044kb
input:
20 12 111111111111 111111111111 111111111111 111111111111 111111111111 111111111111 111111111111 111111111111 111111111111 111111111111 111111111111 111111111111 111111111111 111111111111 111111111111 111111111111 111111111111 111111111111 111111111111 111111111111 16 8 13 12
output:
DDDDDDDDDDDDRUUUUUUUUUUUUUUUUUUURDDDDDDDDDDDDDDDDDDDRUUUUUUUUUUUUUUUUUUURDDDDDDDDDDDDDDDDDDDRUUUUUUUUUUUUUUUUUUURDDDDDDDDDDDDDDDDDDDRUUUUUUUUUUUUUUUUUUURDDDDDDDDDDDDDDDDDDDRUUUUUUUUUUUUUUUUUUURDDDDDDDDDDDDDDDDDDDRUUUUUUUUUUUUUUUUUUUDDDDDDDDDDDDDDDDDDDLUUUUUUUUUUUUUUUUUUULDDDDDDDDDDDDDDDDDDDLUUUUUUUU...
result:
ok Valid Solution (Length = 973).
Test #47:
score: 0
Accepted
time: 17ms
memory: 63984kb
input:
20 17 11111111111111111 10101010101010101 11111111111111111 10101010101010101 11111111111111111 10101010101010101 11111111111111111 10101010101010101 11111111111111111 10101010101010101 11111111111111111 10101010101010101 11111111111111111 10101010101010101 11111111111111111 10101010101010101 111111...
output:
DDDDDLLUUUUUUUUUUUUUUUUUUUDRRDDDDDDDDDDDDLRUULRUULRUULRUULRUULRUUUDLLLLDDDDDDDDDDDDDDDDDDRLLLUUUUUUUUUUUUUUUUUUUDRLLLDDDDDDDDDDDDDDDDDDRLLLUUUUUUUUUUUUUUUUUUUDRLLLDDDDDDDDDDDDDDDDDDRLLLUUUUUUUUUUUUUUUUUUUDRLLLDDDDDDDDDDDDDDDDDDRLUURLUURLUURLUURLUURLUURLUURLUURLUUUDRRDDRLDDRLDDRLDDRLDDRLDDRLDDRLDDRLD...
result:
ok Valid Solution (Length = 1045).
Test #48:
score: 0
Accepted
time: 11ms
memory: 58900kb
input:
20 19 1111111111111111111 1000000000000000000 1111111111111111111 0000000000000000001 1111111111111111111 1000000000000000000 1111111111111111111 0000000000000000001 1111111111111111111 1000000000000000000 1111111111111111111 0000000000000000001 1111111111111111111 1000000000000000000 11111111111111...
output:
RRRRRRRRRRRDDLLLLLLLLLLLLLLLLLLDDRRRRRRRRRRRRRRRRRRDDLLLLLLLLLLLLLLLLLLDDRRRRRRRRRRRRRRRRRRDDLLLLLLLLLLLLLLLLLLRRRRRRRRRRRRRRRRRRUULLLLLLLLLLLLLLLLLLUURRRRRRRRRRRRRRRRRRUULLLLLLLLLLLLLLLLLLUURRRRRRRRRRRRRRRRRRUULLLLLLLLLLLLLLLLLLUURRRRRRRRRRRRRRRRRRUULLLLLLLLLLLLLLLLLLUURRRRRRRRRRRRRRRRRRUULLLLLLLLL...
result:
ok Valid Solution (Length = 840).
Test #49:
score: 0
Accepted
time: 3ms
memory: 29504kb
input:
20 16 0101001111110001 0000111101001011 0000111100011001 1101110100110100 1011011110001101 1101000110111111 0111010111100101 1101101111011001 1101010100000101 1111001000110010 0001011000101000 0101111010110110 0001101111000111 1010100010000110 0100100011011100 0100100101011111 0001000001001110 10011...
output:
-1
result:
ok No Solution.
Test #50:
score: 0
Accepted
time: 32ms
memory: 66184kb
input:
20 18 100101011111011110 111111111111111111 101111101010000001 111111111111111111 110010011011001010 111111111111111111 110110111110000010 111111111111111111 100001000001111000 111111111111111111 100010100111111000 111111111111111111 111100011010110111 111111111111111111 111101010111011110 111111111...
output:
RRUURDDDDDRURDRURUURDDDURUUUUUURDDRRDDRDDDULLUULDDDUUURDDRRUUUUUUUUUUUUUUUUUULDDLDDDDDDRUUUUDDDDLLUUUUUUUURDULLLLDDRDDDDRLLLDDRDDRDDLDDRLLDDLDUUUUURDULLDDULULUUUURDDRUURUULUUUUUURRDDDDDURLLRUULRUULLLLDDRLLLLDDDDRDDDDDDRUUUUUURUURDDDUUULLLDURRDDLDDDDDDLLUUUULUUUUUULLDDRDDDDLUUDDRUUUULUURRDDDDDDRDDLLL...
result:
ok Valid Solution (Length = 1120).
Test #51:
score: 0
Accepted
time: 26ms
memory: 65928kb
input:
20 16 1110111111111111 1111111001111111 1111110111111011 1111110011111111 1111111111011111 1111110111101111 1111011111111111 1101111111111111 1011111111111001 0111111011111111 1110111111111111 1111111111111111 1111011011111111 0101110111111111 1110111101111110 1111111111111111 1111111111011111 11111...
output:
DDDDDDDDDRUUUUURDDDDRDRUUUUUUURDDDDDDDUUUUUUUUDLDLDDDDUUUULUUURDUUUURDDDURUUDDLUUUUUUUUURDDDDDUUUUULLDDDDDULUUUULDDDDDDRDDLDDDDUUULUUUUUUUUULDDDDDLDLDDDDDDDDDDDRLLDDRRRUDLLLLUUURUUUUUUUUUUUUUUUURDDDDRUUUUDDDDLUUUULLDDLDDDDDDDDDDDRDUUUUUUUUUUDDDDDDDDDLLDDDDDDRUUUUDDDDLLULDLUUUUUUUUUUUUURDDDDRUUUUUUUU...
result:
ok Valid Solution (Length = 1165).
Test #52:
score: 0
Accepted
time: 0ms
memory: 30140kb
input:
20 18 110111110101110101 101010111110101010 110101111101111101 111011111011101111 010111110111111101 111011111011111011 011111110111010111 101110101010111010 010111110101110111 101010101011101110 011101110111011111 101010111011111010 010101111111110101 101011101110111011 110101011101010101 101010101...
output:
-1
result:
ok No Solution.
Test #53:
score: 0
Accepted
time: 23ms
memory: 60800kb
input:
14 20 11111111111111111111 11111111111111111111 11111111111111111111 11111111111111111111 11111111111111111111 11111111111111111111 11111111111111111111 11111111111111111111 11111111111111111111 11111111111111111111 11111111111111111111 11111111111111111111 11111111111111111111 11111111111111111111 ...
output:
DDDDDDDDDDDDDRUUUUUUUUUUUUURDDDDDDDDDDDDDRUUUUUUUUUUUUURDDDDDDDDDDDDDRUUUUUUUUUUUUURDDDDDDDDDDDDDRUUUUUUUUUUUUURDDDDDDDDDDDDDRUUUUUUUUUUUUURDDDDDDDDDDDDDRUUUUUUUUUUUUURDDDDDDDDDDDDDUUUUUUUUUUUUULDDDDDDDDDDDDDLUUUUUUUUUUUUULDDDDDDDDDDDDDLUUUUUUUUUUUUULDDDDDDDDDDDDDLUUUUUUUUUUUUULDDDDDDDDDDDDDLUUUUUUU...
result:
ok Valid Solution (Length = 1135).
Test #54:
score: 0
Accepted
time: 20ms
memory: 66368kb
input:
19 20 11111111111111111111 10101010101010101010 11111111111111111111 10101010101010101010 11111111111111111111 10101010101010101010 11111111111111111111 10101010101010101010 11111111111111111111 10101010101010101010 11111111111111111111 10101010101010101010 11111111111111111111 10101010101010101010 ...
output:
DDDDDDDDDRRUUUUUUUUUUUUUUUUUURRDDDDDDDDDDDDDDDDDDRRUUUUUUUUUUUUUUUUUURRDDDDDDDDDDDDDDDDDDRRUUUUUUUUUUUUUUUUUURRDDDDDDDDDDDDDDDDDDRRUUUUUUUUUUUUUUUUUULRDDLRDDLRDDLRDDLRDDLRDDLRDDLRDDLRDDLLLRUULRUULRUULRUULRUULRUULRUULRUULRUULLLRDDLRDDLRDDLRDDLRDDLRDDLRDDLRDDLRDDLLLRUULRUULRUULRUULRUULRUULRUULRUULRUUL...
result:
ok Valid Solution (Length = 1177).
Test #55:
score: 0
Accepted
time: 4ms
memory: 44960kb
input:
10 20 11111111111111111111 10000000000000000000 11111111111111111111 00000000000000000001 11111111111111111111 10000000000000000000 11111111111111111111 00000000000000000001 11111111111111111111 10000000000000000000 5 6 8 20
output:
DRRRRRRRRRRRRRRRRRRRDDLLLLLLLLLLLLLLLLLLLDDRRRRRRRRRRRRRRRRRRRDDLLLLLLLLLLLLLLLLLLLRRRRRRRRRRRRRRRRRRRUULLLLLLLLLLLLLLLLLLLUURRRRRRRRRRRRRRRRRRRUULLLLLLLLLLLLLLLLLLLUURRRRRRRRRRRRRRRRRRRUDLLLLLLLLLLLLLLLLLLLDDRRRRRRRRRRRRRRRRRRRDDLLLLLLLLLLLLLLLLLLLDDRRRRRRRRRRRRRRRRRRRDDLLLLLLLLLLLLLLLLLLLDURRRRRRR...
result:
ok Valid Solution (Length = 479).
Test #56:
score: 0
Accepted
time: 6ms
memory: 28336kb
input:
18 20 11011110100011011100 01100010001011110000 11100110001011101110 10110111100011001111 10100011111011110011 00001010110000010010 01101101100110010001 10001000111110000100 11000011001000001001 10101011101010100110 01111011011010100001 00010110000101101011 10110101011011000011 00110010111011000100 ...
output:
-1
result:
ok No Solution.
Test #57:
score: 0
Accepted
time: 34ms
memory: 70996kb
input:
20 20 10101101000110011011 11111111111111111111 10110101010011101111 11111111111111111111 11010000010101011110 11111111111111111111 10100110101011011011 11111111111111111111 10010101101010101001 11111111111111111111 11101001101101101010 11111111111111111111 11100110110111110111 11111111111111111111 ...
output:
DDDRUURUURDDRDDDDRUUUUUURDDDDDDDDDDDDDDDULLDUUURUULUURLLUULUURLDDLDDDDRRDDDDLDLUUURLLLDDDURLLLUUUURUUUUUUUUUUUURRDDRLLDDUURUURRRRDDUURRDUUULLLLLLLLLDDDDDDDDLDDDDDDLDDRLLDDDRURLDLULUUUUUURDDUUUURUUUUUURDDUULLDDDDLDDLDDLDDDDRDDLDLUUUUUUUUUUURUUUURDDDDDUURUUUUURDURUURLLLLDDDULUULLLDDDDDDDDDDRLLDDDDRDDD...
result:
ok Valid Solution (Length = 1292).
Test #58:
score: 0
Accepted
time: 40ms
memory: 68780kb
input:
18 20 11111111111110111111 01111111111011111111 01111111111110011111 11111111111101111111 11111011111110111111 11111111111110111110 11111111111111011111 11011111111111111110 11110111111111001111 10111111110110111111 11111011111111111111 11111111111011101111 11101111001111111111 11111111111111111111 ...
output:
DDDDRDDDDDDDDDDDDDRUUUUUUUUUUUUUUUUURDDDDDDRDDRDDDDDDDDDRUUUUUURDDDDDDRLUUURUUUUUUUUUUUUUULDDDDDDDLDDRDULUUUUUUULDDLDUUDRUURDDDDLDURDRUUUUUUULLLDURRRRDDDDDDDDDDDDDDLUUULDDDDDDLLUUUUUUULDDUUUUDDRDDDDLDDDUUURDDDRUUUUUUUUULUULUUUUUULLDDDUUURDDDDDDDDDDDDDDDDDLLUUUUUUUUUUULDDDDDDDDDDDLUUUUUUUULDDDDDDLDDR...
result:
ok Valid Solution (Length = 1315).
Test #59:
score: 0
Accepted
time: 0ms
memory: 29668kb
input:
13 20 11011101111111110111 11111110111010111111 11111111111101011101 10111010101111111010 01011101111111010111 10101011101110101110 01111101010101011111 11111011111110101011 11110111111111011111 11111010101011101011 01111111110101011111 10111010101011111110 11111111110111011101 12 16 1 20
output:
-1
result:
ok No Solution.
Test #60:
score: 0
Accepted
time: 44ms
memory: 79460kb
input:
20 20 11111111111111111111 11111111111111111111 11111111111111111111 11111111111111111111 11111111111111111111 11111111111111111111 11111111111111111111 11111111111111111111 11111111111111111111 11111111111111111111 11111111111111111111 11111111111111111111 11111111111111111111 11111111111111111111 ...
output:
DDDDRUUUUUUUUUUUUUUUUUUURDDDDDDDDDDDDDDDDDDDRUUUUUUUUUUUUUUUUUUURDDDDDDDDDDDDDDDDDDDRUUUUUUUUUUUUUUUUUUURDDDDDDDDDDDDDDDDDDDRUUUUUUUUUUUUUUUUUUURDDDDDDDDDDDDDDDDDDDRUUUUUUUUUUUUUUUUUUURDDDDDDDDDDDDDDDDDDDRUUUUUUUUUUUUUUUUUUURDDDDDDDDDDDDDDDDDDDRUUUUUUUUUUUUUUUUUUURDDDDDDDDDDDDDDDDDDDRUUUUUUUUUUUUUUU...
result:
ok Valid Solution (Length = 1635).
Test #61:
score: 0
Accepted
time: 28ms
memory: 68956kb
input:
20 20 11111111111111111111 10101010101010101010 11111111111111111111 10101010101010101010 11111111111111111111 10101010101010101010 11111111111111111111 10101010101010101010 11111111111111111111 10101010101010101010 11111111111111111111 10101010101010101010 11111111111111111111 10101010101010101010 ...
output:
DDRRUUUUUUUUUUUUUUUUUUUDRRDDDDDDDDDDDDDDDDDDRRUUUUUUUUUUUUUUUUUUUDRRDDDDDDDDDDDDDDDDDDRRUUUUUUUUUUUUUUUUUUUDRRDDDDDDDDDDDDDDDDDDRRUUUUUUUUUUUUUUUUUUUDRRDDDDDDDDDDDDDDDDDDLRUULRUULRUULRUULRUULRUULRUULRUULRUUUDLLLRDDLRDDLRDDLRDDLRDDLRDDLRDDLRDDLRDDLLLRUULRUULRUULRUULRUULRUULRUULRUULRUUUDLLLRDDLRDDLRDD...
result:
ok Valid Solution (Length = 1215).
Test #62:
score: 0
Accepted
time: 8ms
memory: 60200kb
input:
20 20 11111111111111111111 10000000000000000000 11111111111111111111 00000000000000000001 11111111111111111111 10000000000000000000 11111111111111111111 00000000000000000001 11111111111111111111 10000000000000000000 11111111111111111111 00000000000000000001 11111111111111111111 10000000000000000000 ...
output:
RDDLLLLLLLLLLLLLLLLLLLRRRRRRRRRRRRRRRRRRRUULLLLLLLLLLLLLLLLLLLUURRRRRRRRRRRRRRRRRRRUULLLLLLLLLLLLLLLLLLLUURRRRRRRRRRRRRRRRRRRUULLLLLLLLLLLLLLLLLLLUURRRRRRRRRRRRRRRRRRRUULLLLLLLLLLLLLLLLLLLUURRRRRRRRRRRRRRRRRRRUULLLLLLLLLLLLLLLLLLLUDRRRRRRRRRRRRRRRRRRRDDLLLLLLLLLLLLLLLLLLLDDRRRRRRRRRRRRRRRRRRRDDLLLLL...
result:
ok Valid Solution (Length = 979).
Test #63:
score: 0
Accepted
time: 3ms
memory: 29616kb
input:
20 20 11110100001010101100 10110001101110101000 01011110111010110000 10111001001011011100 00110111011000010101 01001111110001010010 00101001010111010111 10110100100010001000 10101010001110000010 01111111010110101011 00100101001111000101 00110001001001111000 10101110010001000010 00000100010000110000 ...
output:
-1
result:
ok No Solution.
Test #64:
score: 0
Accepted
time: 35ms
memory: 71708kb
input:
20 20 11010001010100101010 11111111111111111111 11000010111011001011 11111111111111111111 10010100111100111110 11111111111111111111 11101100001110000111 11111111111111111111 11010100111101000011 11111111111111111111 11010011111100110100 11111111111111111111 10001011110000111010 11111111111111111111 ...
output:
DDDDRDDDDRDDDDRDDRUUUUUURDDDDDDDDDDDLUUULLUULUULDDDDRLLDDRRRDURLLLLLDULUUUURRLLLDDDDDULUUUUUUUUUURDDDDRUUUUUUUURRLLLUURUURDDRLUURLLLLLLLLDDDDRDDRRRRDULLLLLDDDDRDDRDDRDDLDDRDULLUULUURLLDDLDDDURRDULLLLDUUUUUUUUURUURUURDDDDLRUUUULLLDDLRUULRRRDDLDDLLDDDDUUUURDDRDDDDURUDLUUURRRLLLLDDDDLDDUURDDRRUURUURDDR...
result:
ok Valid Solution (Length = 1217).
Test #65:
score: 0
Accepted
time: 44ms
memory: 74272kb
input:
20 20 11111111111101111111 11111111111111111101 11111110111110111111 11111011110111111111 11010010110111111011 11111111111111101111 11111111111111111111 11111111111111111001 11111111011110111111 11111111111111111101 11101011111111111111 11111110111111101111 11111111111111111101 10111111111111100111 ...
output:
DDDDDLUUUUUUUUUUUURDDDDDDUUUUUUUUUUUULDDDLDDDDDDDDDDLDDDDDRUUUDDDLLUUUDLDDLUUUUUUUUUUUUUUURRDDDDDDDDDDLUUUUDDDDRURUUUDDDLUUUUURUUUUUUUURDDDUUURLLLLDDRDULLUULDDDDDDDLDDDRDDDDLDDDDDRUDLLUUUUUUUUUUUUUULDDDDDDDDDLDDDDDRUUDDLULUUUUUUUUUUUUUUUUUURDDDDDDDDDDDDDUUUUUUUUURUUUURRDDDLUDRUUULLDDDDLUUUULLDDDDDDD...
result:
ok Valid Solution (Length = 1468).
Test #66:
score: 0
Accepted
time: 3ms
memory: 28564kb
input:
20 20 11010111110101010101 10111010101111101010 11111101111101110111 10101011111010101110 11111111110101111101 10111111111010101111 11110101010111111101 10111110101011101111 01110111011101111101 10111011101010111010 11010111011111010111 11111011101011101111 01010111011111011111 11111010111110111011 ...
output:
-1
result:
ok No Solution.
Test #67:
score: 0
Accepted
time: 206ms
memory: 155776kb
input:
30 25 1111111111111111111111111 1111111111111111111111111 1111111111111111111111111 1111111111111111111111111 1111111111111111111111111 1111111111111111111111111 1111111111111111111111111 1111111111111111111111111 1111111111111111111111111 1111111111111111111111111 1111111111111111111111111 11111111...
output:
DDDDDDDDDDDDDDDDDDDDDDDDDRUUUUUUUUUUUUUUUUUUUUUUUUUUUUULDDDLDDDDDDDDDDDDDDDDDDDDDDDDDDLUUUUUUUUUUUUUUUUUUUUUUUUUUUUURDDUULLDDDDDDDDDDDDDDDDDDDDDDDDDDDDDLUUUUUUUUUUUUUUUUUUUUUUUUUUUUULDDDDDDDDDDDDDDDDDDDDDDDDDDDDDLUUUUUUUUUUUUUUUUUUUUUUUUUUUUULDDDDDDDDDDDDDDDDDDDDDDDDDDDDDLUUUUUUUUUUUUUUUUUUUUUUUUUUU...
result:
ok Valid Solution (Length = 3039).
Test #68:
score: 0
Accepted
time: 137ms
memory: 123212kb
input:
30 25 1111111111111111111111111 1010101010101010101010101 1111111111111111111111111 1010101010101010101010101 1111111111111111111111111 1010101010101010101010101 1111111111111111111111111 1010101010101010101010101 1111111111111111111111111 1010101010101010101010101 1111111111111111111111111 10101010...
output:
DDDDDDDDDDDDDLLUUUUUUUUUUUUUUUUUUUUUUUUUUUUUDRRDDDDDDDDDDDDDDLRUULRUULRUULRUULRUULRUULRUUUDLLLLDDDDDDDDDDDDDDDDDDDDDDDDDDDDRLLLUUUUUUUUUUUUUUUUUUUUUUUUUUUUUDRLLLDDDDDDDDDDDDDDDDDDDDDDDDDDDDRLLLUUUUUUUUUUUUUUUUUUUUUUUUUUUUUDRLLLDDDDDDDDDDDDDDDDDDDDDDDDDDDDRLLLUUUUUUUUUUUUUUUUUUUUUUUUUUUUUDRLLLDDDDDDD...
result:
ok Valid Solution (Length = 2291).
Test #69:
score: 0
Accepted
time: 47ms
memory: 88712kb
input:
30 25 1111111111111111111111111 1000000000000000000000000 1111111111111111111111111 0000000000000000000000001 1111111111111111111111111 1000000000000000000000000 1111111111111111111111111 0000000000000000000000001 1111111111111111111111111 1000000000000000000000000 1111111111111111111111111 00000000...
output:
RRRRRRRRRRRRRRRRRRRUDLLLLLLLLLLLLLLLLLLLLLLLLDDRRRRRRRRRRRRRRRRRRRRRRRRDDLLLLLLLLLLLLLLLLLLLLLLLLDDRRRRRRRRRRRRRRRRRRRRRRRRDDLLLLLLLLLLLLLLLLLLLLLLLLDDRRRRRRRRRRRRRRRRRRRRRRRRDDLLLLLLLLLLLLLLLLLLLLLLLLDDRRRRRRRRRRRRRRRRRRRRRRRRDDLLLLLLLLLLLLLLLLLLLLLLLLDDRRRRRRRRRRRRRRRRRRRRRRRRDDLLLLLLLLLLLLLLLLLLL...
result:
ok Valid Solution (Length = 1854).
Test #70:
score: 0
Accepted
time: 0ms
memory: 29432kb
input:
30 30 011110110001111010011111110010 011101110110100110001101010100 100100100111010000000011100101 111110001011110110101000100000 100110011100000111100111100010 110011101000111000101110011101 011000001101110100001010011100 001101101010010100111111110011 100010111001110111010110100001 000101010010110...
output:
-1
result:
ok No Solution.
Test #71:
score: 0
Accepted
time: 205ms
memory: 148080kb
input:
30 30 101011111010110011011100010111 111111111111111111111111111111 101000010010011000101010010010 111111111111111111111111111111 101010011110010001011010010101 111111111111111111111111111111 111100010110101001000001000001 111111111111111111111111111111 111101000101101001001000100001 111111111111111...
output:
DDDDDDDDDDDDDDDDDDDDDDDULLDUUUUUUUUUUUUURLLDDDDDDDDLDDRLLLLDDDRURDRURLDLULDLLULLDUUUUUUURDDDDRUURDUUURRUURUULLUURRLLLDDDDRLLUULDDDULLDDLDDRLLDDDDDRURLDLULUULLLUUUUUUUURRUURDDDDDDDDLLRRUURLLLRRUURRDUUURDURLLLRDDLLLLRRUUUUUURRDDRRUURUURRDDDURRUUUURDDDDRUURRLLDDRRLLLUUUUUURDDRRLLUUUUUURDDRDDLRUULUUUUUU...
result:
ok Valid Solution (Length = 2741).
Test #72:
score: 0
Accepted
time: 236ms
memory: 185288kb
input:
30 30 111111111111111101111111011011 111111100111011111111111101010 111111111111111111111111011111 111111111101111111110111111110 111111111111111011111111111111 111110111111111111111111011111 111111111111111111111111111011 111101111111011111111111111111 111111111111111111111111111111 101110111110111...
output:
DDDLDDRLUUUUUUUUUUUUUUUUUURDDDDDDRDDDDDDRDDDDDDRUUUUUUUUUUUUUUUUURDDDDDDDDDDDDDDDDDRUURDDRUUUUUUUUUUUUUURDDDDRDDDDDDDDDRDRUUUUUUUUUUUUUUUUUUUUUURDDDDDDDDDDDDDDDDDDDDDDRRUUUUUUUURDDDDRDDDDRRRUUUUUUUUUUUUUUUUUUUUUUUUUUUUURDDDRDDDDDDDDDDDDDDRDDDDDDDDDDDDRUUUUUUUUUUUUUUUUUUUUUUUUUUUURDDDDDDDDDDRDDDDDDDD...
result:
ok Valid Solution (Length = 3388).
Test #73:
score: 0
Accepted
time: 3ms
memory: 28876kb
input:
30 30 110111011111110111011111110101 101110101010111010101011101010 011101111101011101011111010111 111110101110111111111011101110 010101110101011101010101111111 101111101011111111111110101011 111101110111010101011101010101 111011111010101010101010101111 011111011111110101011111111101 111010101111101...
output:
-1
result:
ok No Solution.
Test #74:
score: 0
Accepted
time: 129ms
memory: 124624kb
input:
21 30 111111111111111111111111111111 111111111111111111111111111111 111111111111111111111111111111 111111111111111111111111111111 111111111111111111111111111111 111111111111111111111111111111 111111111111111111111111111111 111111111111111111111111111111 111111111111111111111111111111 111111111111111...
output:
DDDDDDDDDDDDDRUUUUUUUUUUUUUUUUUUUURDDDDDDDDDDDDDDDDDDDDRUUUUUUUUUUUUUUUUUUUURDDDDDDDDDDDDDDDDDDDDUUUUUUUUUUUUUUUUUUUULDDDDDDDDDDDDDDDDDDDDLUUUUUUUUUUUUUUUUUUUULLDDDDDDLDDDDDDDDDDDDDDLUUUUUUUUUUUUUUUUUUUURDDDDDUUUUULLDDDDDDDDDDDDDDDDDDDDLUUUUUUUUUUUUUUUUUUUULDDDDDDDDDDDDDDDDDDDDLUUUUUUUUUUUUUUUUUUUUL...
result:
ok Valid Solution (Length = 2543).
Test #75:
score: 0
Accepted
time: 79ms
memory: 100184kb
input:
21 30 111111111111111111111111111111 101010101010101010101010101010 111111111111111111111111111111 101010101010101010101010101010 111111111111111111111111111111 101010101010101010101010101010 111111111111111111111111111111 101010101010101010101010101010 111111111111111111111111111111 101010101010101...
output:
RDDDDDDRRUUUUUUUUUUUUUUUUUUUURRDDDDDDDDDDDDDDDDDDDDLRUULRUULRUULRUULRUULRUULRUULRUULRUULRUULLLLDDDDDDDDDDDDDURLLLDDDDDDDDRLLLUUUUUUUUUUUUUUUUUUUURRDDDDDDDDDDDURLLRUURLLRUURLLRUURLLRUURLLRUURLLLLLDDDDDDDDDDDDDDDDDDDDRLLLUUUUUUUUUUUUUUUUUUUURLLLDDDDDDDDDDDDDDDDDDDDRLLLUUUUUUUUUUUUUUUUUUUURLLLDDDDDDDDD...
result:
ok Valid Solution (Length = 1943).
Test #76:
score: 0
Accepted
time: 31ms
memory: 75812kb
input:
21 30 111111111111111111111111111111 100000000000000000000000000000 111111111111111111111111111111 000000000000000000000000000001 111111111111111111111111111111 100000000000000000000000000000 111111111111111111111111111111 000000000000000000000000000001 111111111111111111111111111111 100000000000000...
output:
RUULLLLLLLLLLLLLLLLLLLLLLLLLLLLLUURRRRRRRRRRRRRRRRRRRRRRRRRRRRRUULLLLLLLLLLLLLLLLLLLLLLLLLLLLLUURRRRRRRRRRRRRRRRRRRRRRRRRRRRRLLLLLLLLLLLLLLLLLLLLLLLLLLLLLDDRRRRRRRRRRRRRRRRRRRRRRRRRRRRRDDLLLLLLLLLLLLLLLLLLLLLLLLLLLLLDDRRRRRRRRRRRRRRRRRRRRRRRRRRRRRDDLLLLLLLLLLLLLLLLLLLLLLLLLLLLLDDRRRRRRRRRRRRRRRRRRRR...
result:
ok Valid Solution (Length = 1445).
Test #77:
score: 0
Accepted
time: 0ms
memory: 28492kb
input:
25 30 011010010110010101001110110111 000011111001111101110011010001 011011100010011000110100110000 001111001100100010111111101001 000101111100111001000000001111 001010110011101110101000010000 001010011001010000011001001001 011111010111110110101001110000 011001010011100010100101011000 100011000011110...
output:
-1
result:
ok No Solution.
Test #78:
score: 0
Accepted
time: 130ms
memory: 118244kb
input:
25 30 101100000100000111111100110011 111111111111111111111111111111 100111110101001111010001110011 111111111111111111111111111111 101101100110111111011110101110 111111111111111111111111111111 111001000110101100010101000110 111111111111111111111111111111 100000001011110010001101011010 111111111111111...
output:
UUUUUUUUUUUUUUUUUUURRDDRDDRRRDDRUUUUUUUURUUULDLULDDDDDDDRLLUULDURDDRUURLUURLLUUUDLDDLUULDDLLRRUULLRRRDDRUURDDRUUURDRURDRDDRRDDRUUUUURDRDDRUUURDRURDDDRRUURRUDRRDDDDRDDRUURUUUUURDDDDDDDDDDDDDDDDDDDDDDDDULLDLUUUUURDDRLUUUURDDUULLLLDDDDDDRUUDDLLUUUULLLDDDDDURRUULRDDLLLLUURUUUUUUUURDDRDDRRLLLDURUURRRUURU...
result:
ok Valid Solution (Length = 2244).
Test #79:
score: 0
Accepted
time: 188ms
memory: 143928kb
input:
25 30 111111101111111111111111111111 111111111111111101111111110111 111111111111101111111111111111 111111111111111101101111111111 011101111111111111111111101111 111011100111111110111110111111 111111110111111111111111111111 111111111111110111111111111111 111111111111111101111111111111 111111111111111...
output:
URDDDDDDDDDDDDDDDDDDDDDRUUURDDDRUUUUUUUUUUUUUURDDDDDDDDDDDDDDRUUUDDDLUUUUURUUUUUUUUUUUUUUUUUUULDDDLDDRDDDDULULDDDDDDDDDDDLDUUUUUUUUUUUUUUUUUUURDDDDDDUUUUURUDLULLDDULULDDDDDDDDDDRDDDDDDDDDDDDDDULUUULDDDDLUUUUUUUUUUURDDDDRDUUUUUULUUUUUUUULDDDDDDDLDDDDDDDDDDDDDLUUUUUUUUUUUUUUUUUUUUUUUULDDDDDDDDDLULDDDD...
result:
ok Valid Solution (Length = 2841).
Test #80:
score: 0
Accepted
time: 0ms
memory: 28508kb
input:
25 30 110101110101011111010101010111 101111101011111011111110101010 110111011101110111111101011101 101011111011101011111111111011 110111111101011111110111111111 111111111110101011111111101010 110101010101010101011111011101 101010111010101111111111101111 111101110111011101011111010111 101010101010111...
output:
-1
result:
ok No Solution.
Test #81:
score: 0
Accepted
time: 301ms
memory: 199132kb
input:
30 30 111111111111111111111111111111 111111111111111111111111111111 111111111111111111111111111111 111111111111111111111111111111 111111111111111111111111111111 111111111111111111111111111111 111111111111111111111111111111 111111111111111111111111111111 111111111111111111111111111111 111111111111111...
output:
DDDDDRUUUUUUUUUUUUUUUUUUUUUUUUUUUUURDDDDDDDDDDDDDDDDDDDDDDDDDDDDDRUUUUUUUUUUUUUUUUUUUUUUUUUUUUURDDDDDDDDDDDDDDDDDDDDDDDDDDDDDRUUUUUUUUUUUUUUUUUUUUUUUUUUUUURDDDDDDDDDDDDDDDDDDDDDDDDDDDDDRUUUUUUUUUUUUUUUUUUUUUUUUUUUUURDDDDDDDDDDDDDDDDDDDDDDDDDDDDDRUUUUUUUUUUUUUUUUUUUUUUUUUUUUURDDDDDDDDDDDDDDDDDDDDDDDD...
result:
ok Valid Solution (Length = 3643).
Test #82:
score: 0
Accepted
time: 188ms
memory: 150624kb
input:
30 30 111111111111111111111111111111 101010101010101010101010101010 111111111111111111111111111111 101010101010101010101010101010 111111111111111111111111111111 101010101010101010101010101010 111111111111111111111111111111 101010101010101010101010101010 111111111111111111111111111111 101010101010101...
output:
DDDDDDDDDDRRUUUUUUUUUUUUUUUUUUUUUUUUUUUUUDRRDDDDDDDDDDDDDDDDDDDDDDDDDDDDRRUUUUUUUUUUUUUUUUUUUUUUUUUUUUUDRRDDDDDDDDDDDDDDDDDDDDDDDDDDDDRRUUUUUUUUUUUUUUUUUUUUUUUUUUUUUDRRDDDDDDDDDDDDDDDDDDDDDDDDDDDDRRUUUUUUUUUUUUUUUUUUUUUUUUUUUUUDRRDDDDDDDDDDDDDDDDDDDDDDDDDDDDRRUUUUUUUUUUUUUUUUUUUUUUUUUUUUUDRRDDDDDDDD...
result:
ok Valid Solution (Length = 2715).
Test #83:
score: 0
Accepted
time: 68ms
memory: 101668kb
input:
30 30 111111111111111111111111111111 100000000000000000000000000000 111111111111111111111111111111 000000000000000000000000000001 111111111111111111111111111111 100000000000000000000000000000 111111111111111111111111111111 000000000000000000000000000001 111111111111111111111111111111 100000000000000...
output:
RRRRRRRRRRRRRRRRRRRRRRRRRRRRRUULLLLLLLLLLLLLLLLLLLLLLLLLLLLLUURRRRRRRRRRRRRRRRRRRRRRRRRRRRRUULLLLLLLLLLLLLLLLLLLLLLLLLLLLLUURRRRRRRRRRRRRRRRRRRRRRRRRRRRRUULLLLLLLLLLLLLLLLLLLLLLLLLLLLLUURRRRRRRRRRRRRRRRRRRRRRRRRRRRRUULLLLLLLLLLLLLLLLLLLLLLLLLLLLLUURRRRRRRRRRRRRRRRRRRRRRRRRRRRRUULLLLLLLLLLLLLLLLLLLLL...
result:
ok Valid Solution (Length = 2319).
Test #84:
score: 0
Accepted
time: 7ms
memory: 29772kb
input:
30 30 010110110101101010000010000110 101110000111000001001111100101 010100011111100110100001111101 101101100010111011011010001010 100101010100001011101100101100 101001111001111101101100001110 000111101010011110100001110100 111111001101000001011110000111 010000100010000100000011101000 100001010111010...
output:
-1
result:
ok No Solution.
Test #85:
score: 0
Accepted
time: 187ms
memory: 148528kb
input:
30 30 100110101011111011001000111100 111111111111111111111111111111 101001000111011110000110011110 111111111111111111111111111111 111001111110100011111000000010 111111111111111111111111111111 100111001001100000100010001101 111111111111111111111111111111 110001101000111011111010110110 111111111111111...
output:
DDRDDRRRDDRDDRUURRDDDDDDDDRDDDDDDRDDDDRUURDDDDDLULLLDULUURUURDDUULLLUUUUUUUUUUUURUUDDLLDDDDLLDDRDDDDRLLUULUUUULDDDDDDDDRUUDDRRRLLLLLDDDDRDRUUURDDDRURRUULLRRDDLLDLUUULLDURDDDLULLRUULRUULUURUULUURUULUUUURUURDDDDRUURDDDURLUURLLDDLLRUUUURRRLLLLLRDDLDDDDRDDLDDRDDLDDRRUUUUUUUURDDDDRDDRUURLUURLLUURRUUUURDD...
result:
ok Valid Solution (Length = 2752).
Test #86:
score: 0
Accepted
time: 257ms
memory: 184820kb
input:
30 30 111101111111111111111011111111 100111111111111111111111011111 111111011111111111011111111110 101111111101111111111111111111 111111111111111111111111111111 111111101111011111111110111111 111011111111111111111111111111 111111111111111111111101111111 111111111111111111111111111111 011111100111111...
output:
DDDDDDDDDRRDDLLLUUUUULDDDDLDLULDLUUUUUUUURDDRDDDRDUUUUUUUUUUUURDDDDDDDDURUUUUUUUUUUUUUURDDDDDDDDDRDDDDDDDDRDUUUUUDDDDLUUUUUURUUUUULDDUUUUUUUUUUUUUURDDDDDDDDDDUUUUUUUUUUUULLDDDDDDDULUUUUUULDDDDDDLUUUUUULDLDDDDDDDRDDDDDDDDDDDDDDUUULUUUUDLDDDLDDDDDDDDDDLUULDDLUUUURDUUUUUUUUUUUUUUUUUUUUUUUULDDDDDDDDDDDD...
result:
ok Valid Solution (Length = 3388).
Test #87:
score: 0
Accepted
time: 0ms
memory: 28828kb
input:
30 30 011111010101111111011101111101 111011101011111110111111101011 111111010101011101111101110101 111110101011101110111111101110 010111011101110101110101111101 101111101011101110101010111111 110101010101010111011101010101 101110101111101110101110111111 110111011101010111010111110101 101011111110111...
output:
-1
result:
ok No Solution.
Test #88:
score: 0
Accepted
time: 288ms
memory: 198972kb
input:
30 30 111111111111111111111111111111 111111111111111111111111111111 111111111111111111111111111111 111111111111111111111111111111 111111111111111111111111111111 111111111111111111111111111111 111111111111111111111111111111 111111111111111111111111111111 111111111111111111111111111111 111111111111111...
output:
DLUUUUUUUUUUUUUUUUUUUUUUUUUUUUURDDDDDDDDDDDDDDDDDDDDDDDDDDDUUUUUUUUUUUUUUUUUUUUUUUUUUULLDDDDDDDDDDDDDDDDDDDDDDDDDDDDDLUUUUUUUUUUUUUUUUUUUUUUUUUUUUULDDDDDDDDDDDDDDDDDDDDDDDDDDDDDLUUUUUUUUUUUUUUUUUUUUUUUUUUUUULDDDDDDDDDDDDDDDDDDDDDDDDDDDDDLUUUUUUUUUUUUUUUUUUUUUUUUUUUUULDDDDDDDDDDDDDDDDDDDDDDDDDDDDDLUU...
result:
ok Valid Solution (Length = 3653).
Extra Test:
score: 0
Extra Test Passed