Submission #2572677
Source Code Expand
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using System.Reflection; namespace _20180502_pra { class Program { static void Main(string[] args) { string hoge = Console.ReadLine(); char[] moji = hoge.ToCharArray(); int moge = int.Parse(Console.ReadLine()); int[] xy = new int[2]; int tmp=0,tmp2=0; int cnt = 0; for (int i = 0; i < hoge.Length; i++) { switch (moji[i]) { case 'L': xy[0] -= 1; break; case 'R': xy[0] += 1; break; case 'U': xy[1] += 1; break; case 'D': xy[1] -= 1; break; case '?': cnt += 1; break; } } for (int j = 0; j <cnt ; j++) { tmp = Math.Abs(xy[0]) + Math.Abs(xy[1]) + 1; tmp2 = Math.Abs(xy[0]) + Math.Abs(xy[1]) - 1; } if (moge == 1) { Console.WriteLine(tmp > tmp2 ? tmp : tmp2); } else if (moge == 2) { Console.WriteLine(tmp < tmp2 ? tmp : tmp2); } Console.Read(); } } }
Submission Info
Submission Time | |
---|---|
Task | B - ドローン |
User | tomoki_watanabe |
Language | C# (Mono 4.6.2.0) |
Score | 0 |
Code Size | 1415 Byte |
Status | WA |
Exec Time | 24 ms |
Memory | 13536 KB |
Judge Result
Set Name | Sample | Subtask1 | All | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Score / Max Score | 0 / 0 | 0 / 100 | 0 / 1 | ||||||||||||
Status |
|
|
|
Set Name | Test Cases |
---|---|
Sample | 00_example_01.txt, 00_example_02.txt, 00_example_03.txt, 00_example_04.txt |
Subtask1 | 00_example_01.txt, 00_example_02.txt, 00_example_03.txt, 10_rand_01.txt, 10_rand_02.txt, 10_rand_03.txt, 10_rand_04.txt, 20_no_question_01.txt, 20_no_question_02.txt, 20_no_question_03.txt, 20_no_question_04.txt, 30_max_01.txt, 30_max_02.txt, 30_max_03.txt, 30_max_04.txt, 40_corner_01.txt, 40_corner_02.txt, 40_corner_03.txt, 40_corner_04.txt |
All | 00_example_01.txt, 00_example_02.txt, 00_example_03.txt, 00_example_04.txt, 10_rand_01.txt, 10_rand_02.txt, 10_rand_03.txt, 10_rand_04.txt, 20_no_question_01.txt, 20_no_question_02.txt, 20_no_question_03.txt, 20_no_question_04.txt, 30_max_01.txt, 30_max_02.txt, 30_max_03.txt, 30_max_04.txt, 40_corner_01.txt, 40_corner_02.txt, 40_corner_03.txt, 40_corner_04.txt, 50_hand_01.txt, 50_hand_02.txt, 50_hand_03.txt, 60_rand_01.txt, 60_rand_02.txt, 60_rand_03.txt, 60_rand_04.txt, 70_no_ques_01.txt, 70_no_ques_02.txt, 70_no_ques_03.txt, 70_no_ques_04.txt, 80_max_01.txt, 80_max_02.txt, 80_max_03.txt, 80_max_04.txt, 90_corner_01.txt, 90_corner_02.txt, 90_corner_03.txt, 90_corner_04.txt |
Case Name | Status | Exec Time | Memory |
---|---|---|---|
00_example_01.txt | AC | 21 ms | 11220 KB |
00_example_02.txt | AC | 20 ms | 9044 KB |
00_example_03.txt | WA | 20 ms | 11092 KB |
00_example_04.txt | AC | 20 ms | 9044 KB |
10_rand_01.txt | WA | 20 ms | 9064 KB |
10_rand_02.txt | WA | 20 ms | 11092 KB |
10_rand_03.txt | WA | 20 ms | 9044 KB |
10_rand_04.txt | WA | 21 ms | 11048 KB |
20_no_question_01.txt | WA | 21 ms | 11112 KB |
20_no_question_02.txt | WA | 20 ms | 9044 KB |
20_no_question_03.txt | WA | 20 ms | 11092 KB |
20_no_question_04.txt | WA | 21 ms | 11048 KB |
30_max_01.txt | WA | 23 ms | 11488 KB |
30_max_02.txt | WA | 23 ms | 11128 KB |
30_max_03.txt | WA | 23 ms | 11488 KB |
30_max_04.txt | WA | 22 ms | 11488 KB |
40_corner_01.txt | WA | 22 ms | 9440 KB |
40_corner_02.txt | WA | 23 ms | 11488 KB |
40_corner_03.txt | WA | 22 ms | 11488 KB |
40_corner_04.txt | WA | 22 ms | 9440 KB |
50_hand_01.txt | WA | 20 ms | 9044 KB |
50_hand_02.txt | WA | 21 ms | 13140 KB |
50_hand_03.txt | WA | 20 ms | 11092 KB |
60_rand_01.txt | WA | 21 ms | 11112 KB |
60_rand_02.txt | WA | 21 ms | 11092 KB |
60_rand_03.txt | WA | 20 ms | 9044 KB |
60_rand_04.txt | WA | 21 ms | 9128 KB |
70_no_ques_01.txt | WA | 21 ms | 11112 KB |
70_no_ques_02.txt | WA | 20 ms | 9044 KB |
70_no_ques_03.txt | WA | 20 ms | 9044 KB |
70_no_ques_04.txt | WA | 20 ms | 9128 KB |
80_max_01.txt | WA | 22 ms | 9440 KB |
80_max_02.txt | WA | 22 ms | 9440 KB |
80_max_03.txt | WA | 22 ms | 9440 KB |
80_max_04.txt | WA | 22 ms | 9440 KB |
90_corner_01.txt | WA | 23 ms | 11488 KB |
90_corner_02.txt | WA | 22 ms | 9440 KB |
90_corner_03.txt | WA | 23 ms | 11488 KB |
90_corner_04.txt | WA | 24 ms | 13536 KB |