Submission #1070768
Source Code Expand
/* package whatever; // don't place package name! */ import java.util.*; import java.lang.*; import java.io.*; /* Name of the class has to be "Main" only if the class is public. */ class Main { public static void main (String[] args) { Scanner sc = new Scanner(System.in); int sx = Integer.parseInt(sc.next()); int sy = Integer.parseInt(sc.next()); int tx = Integer.parseInt(sc.next()); int ty = Integer.parseInt(sc.next()); String route = ""; for(int i = 0; i < ty - sy; i++) route += "U"; for(int i = 0; i < tx - sx; i++) route += "R"; for(int i = 0; i < ty - sy; i++) route += "D"; for(int i = 0; i < tx - sx; i++) route += "L"; route += "L"; for(int i = 0; i <= ty - sy; i++) route += "U"; for(int i = 0; i <= tx - sx; i++) route += "R"; route += "D"; route += "R"; for(int i = 0; i <= ty - sy; i++) route += "D"; for(int i = 0; i <= tx - sx; i++) route += "L"; route += "U"; System.out.println(route); } }
Submission Info
Submission Time | |
---|---|
Task | C - Back and Forth |
User | |
Language | Java8 (OpenJDK 1.8.0) |
Score | 300 |
Code Size | 1008 Byte |
Status | AC |
Exec Time | 493 ms |
Memory | 206908 KB |
Judge Result
Set Name | Sample | All | ||||
---|---|---|---|---|---|---|
Score / Max Score | 0 / 0 | 300 / 300 | ||||
Status |
|
|
Set Name | Test Cases |
---|---|
Sample | sample_01.txt, sample_02.txt |
All | subtask_1_01.txt, subtask_1_02.txt, subtask_1_03.txt, subtask_1_04.txt, subtask_1_05.txt, subtask_1_06.txt, subtask_1_07.txt, subtask_1_08.txt, subtask_1_09.txt, subtask_1_10.txt |
Case Name | Status | Exec Time | Memory |
---|---|---|---|
sample_01.txt | AC | 124 ms | 9548 KB |
sample_02.txt | AC | 125 ms | 9552 KB |
subtask_1_01.txt | AC | 124 ms | 9548 KB |
subtask_1_02.txt | AC | 493 ms | 206908 KB |
subtask_1_03.txt | AC | 232 ms | 71624 KB |
subtask_1_04.txt | AC | 181 ms | 41168 KB |
subtask_1_05.txt | AC | 164 ms | 25424 KB |
subtask_1_06.txt | AC | 124 ms | 10060 KB |
subtask_1_07.txt | AC | 125 ms | 9680 KB |
subtask_1_08.txt | AC | 164 ms | 25416 KB |
subtask_1_09.txt | AC | 195 ms | 41300 KB |
subtask_1_10.txt | AC | 161 ms | 25296 KB |