Contest Duration: ~ (local time) (100 minutes) Back to Home

Submission #1056898

Source Code Expand

Copy
```using System;
public class BaF {
public static void Main() {
string[] read = new string[4];
int sx = int.Parse(read[0]);
int sy = int.Parse(read[1]);
int tx = int.Parse(read[2]);
int ty = int.Parse(read[3]);
//int min = Math.Abs(sx - tx) + Math.Abs(sy-ty);
string hp = "R";
string hm = "L";
string vp = "U";
string vm = "D";
string outp = "";
if (sx > tx) {
hp = "L";
hm = "R";
} else if (sx < tx) {
hp = "R";
hm = "L";
}
if (sy > ty) {
vp = "D";
vm = "U";
} else if (sy < ty) {
vp = "U";
vm = "D";
}
if (sx != tx && sy != ty) {
for (int i = 0; i < Math.Abs(sx - tx); i++) {
outp += hp;
}
for (int i = 0; i < Math.Abs(sy - ty); i++) {
outp += vp;
}//行き1

for (int i = 0; i < Math.Abs(sx - tx); i++) {
outp += hm;
}
for (int i = 0; i < Math.Abs(sy - ty); i++) {
outp += vm;
}//帰り1

outp += hm;//一回逃げる
for (int i = 0; i < Math.Abs(sy - ty); i++) {
outp += vp;
}
outp += vp;//もう一回逃げる
for (int i = 0; i <= Math.Abs(sx - tx); i++) {//一回目の逃げ分補正
outp += hp;
}
outp += vm;//二回目の逃げ分補正、ここまで行き2

outp += hp;//一回逃げ
for (int i = 0; i <= Math.Abs(sy - ty); i++) {//もう一回逃げ
outp += vm;
}
for (int i = 0; i <= Math.Abs(sx - tx); i++) {//一回目の逃げ補正
outp += hm;
}
outp += vp;//二回目の逃げ補正
} else if (sy == ty) {
for (int i = 0; i < Math.Abs(sx - tx); i++) {
outp += hp;
}//直線,行き1

outp += vp;//一回逃げ
for (int i = 0; i < Math.Abs(sx - tx); i++) {
outp += hm;
}//直線
outp += vm;//逃げ補正、帰り1

outp += vm;//一回逃げ
for (int i = 0; i < Math.Abs(sx - tx); i++) {
outp += hp;
}//直線
outp += vp;//逃げ補正、行き2

outp += hp;//逃げ
outp += vp;
outp += vp;//逃げ*2
for (int i = 0; i < Math.Abs(sx - tx) + 2; i++) {
outp += hm;
}//直線+2補正
outp += vm;
outp += vm;//補正*2
outp += hp;//補正
} else if (sx == tx) {
for (int i = 0; i < Math.Abs(sy - ty); i++) {
outp += vp;
}//直線,行き1

outp += hp;//一回逃げ
for (int i = 0; i < Math.Abs(sy - ty); i++) {
outp += vm;
}//直線
outp += hm;//逃げ補正、帰り1

outp += hm;//一回逃げ
for (int i = 0; i < Math.Abs(sy - ty); i++) {
outp += vp;
}//直線
outp += hp;//逃げ補正、行き2

outp += vp;//逃げ
outp += hp;
outp += hp;//逃げ*2
for (int i = 0; i < Math.Abs(sy - ty) + 2; i++) {
outp += vm;
}//直線+2補正
outp += hm;
outp += hm;//補正*2
outp += vp;//補正
}
Console.WriteLine(outp);
}
}```

#### Submission Info

Submission Time 2017-01-07 22:00:44+0900 C - Back and Forth shomu36 C# (Mono 4.6.2.0) 300 3812 Byte AC 339 ms 26568 KB

#### Judge Result

Set Name Score / Max Score Test Cases
Sample 0 / 0 sample_01.txt, sample_02.txt