2018南京现场赛K 随机输出

题目链接:http://codeforces.com/gym/101981/attachments

n和m太小,空地联通无环,总步数太大,直接随机输出5w个方向

#include<iostream>
#include<algorithm>
#include<ctime>
using namespace std;
int t,a,b,c,d,k;
int main()
{
    srand((unsigned)time(0));
    int n,m;
    char op,ch[4]={'L','R','U','D'};
    cin>>n>>m;
    for(int i=1;i<=n;i++)
    {
        for(int j=1;j<=m;j++)
        cin>>op;
    }
    for(int i=1;i<=50000;i++)
    {
        cout<<ch[rand()%4];
    }
    cout<<endl;
    return 0;
}

 

posted on 2019-10-23 21:06  che027  阅读(141)  评论(0编辑  收藏  举报

导航