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; }