Submission #3447277
Source Code Expand
Option Strict On Imports System.Collections.Generic Imports System.Console Imports System.Math Module Program Sub Main() Dim s As String = NextString() Dim t As Integer = NextInt() WriteLine(Calc(s)(t - 1)) End Sub Function Calc(S As String) As Integer() Dim x, y, t As Integer For Each v As Char In S Select Case v Case "L"c x -= 1 Case "R"c x += 1 Case "U"c y += 1 Case "D"c y -= 1 Case Else t += 1 End Select Next Dim base As Integer = Abs(x) + Abs(y) Dim maxResult As Integer = base + t Dim tmp As Integer = base - t Dim minResult As Integer If tmp >= 0 Then minResult = tmp Else minResult = Abs(tmp Mod 2) End If Return New Integer() {maxResult, minResult} End Function Function NextInt() As Integer Return CInt(NextString()) End Function Function NextString() As String Dim result As New List(Of Char) Do Dim tmp As Integer = Read() If tmp < 0 Then Exit Do Dim nextChar As Char = Chr(tmp) If Not Char.IsWhiteSpace(nextChar) Then result.Add(nextChar) ElseIf nextChar <> vbCr Then Exit Do End If Loop Return New String(result.ToArray()) End Function End Module
Submission Info
Submission Time | |
---|---|
Task | B - ドローン |
User | ToshiroYanagi |
Language | Visual Basic (Mono 4.0.1) |
Score | 101 |
Code Size | 1658 Byte |
Status | AC |
Exec Time | 60 ms |
Memory | 22576 KB |
Judge Result
Set Name | Sample | Subtask1 | All | ||||||
---|---|---|---|---|---|---|---|---|---|
Score / Max Score | 0 / 0 | 100 / 100 | 1 / 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 | 48 ms | 17872 KB |
00_example_02.txt | AC | 48 ms | 17872 KB |
00_example_03.txt | AC | 47 ms | 17872 KB |
00_example_04.txt | AC | 48 ms | 19920 KB |
10_rand_01.txt | AC | 49 ms | 18000 KB |
10_rand_02.txt | AC | 48 ms | 17872 KB |
10_rand_03.txt | AC | 48 ms | 18000 KB |
10_rand_04.txt | AC | 48 ms | 18000 KB |
20_no_question_01.txt | AC | 50 ms | 20600 KB |
20_no_question_02.txt | AC | 48 ms | 17872 KB |
20_no_question_03.txt | AC | 48 ms | 17872 KB |
20_no_question_04.txt | AC | 48 ms | 20048 KB |
30_max_01.txt | AC | 58 ms | 19164 KB |
30_max_02.txt | AC | 58 ms | 19164 KB |
30_max_03.txt | AC | 58 ms | 19292 KB |
30_max_04.txt | AC | 59 ms | 21212 KB |
40_corner_01.txt | AC | 58 ms | 19164 KB |
40_corner_02.txt | AC | 57 ms | 20528 KB |
40_corner_03.txt | AC | 58 ms | 21212 KB |
40_corner_04.txt | AC | 59 ms | 22576 KB |
50_hand_01.txt | AC | 48 ms | 19920 KB |
50_hand_02.txt | AC | 49 ms | 19920 KB |
50_hand_03.txt | AC | 49 ms | 19920 KB |
60_rand_01.txt | AC | 50 ms | 20048 KB |
60_rand_02.txt | AC | 48 ms | 19920 KB |
60_rand_03.txt | AC | 48 ms | 19920 KB |
60_rand_04.txt | AC | 49 ms | 20048 KB |
70_no_ques_01.txt | AC | 50 ms | 20048 KB |
70_no_ques_02.txt | AC | 47 ms | 17872 KB |
70_no_ques_03.txt | AC | 48 ms | 19920 KB |
70_no_ques_04.txt | AC | 48 ms | 20048 KB |
80_max_01.txt | AC | 58 ms | 19164 KB |
80_max_02.txt | AC | 58 ms | 19164 KB |
80_max_03.txt | AC | 58 ms | 21212 KB |
80_max_04.txt | AC | 59 ms | 21212 KB |
90_corner_01.txt | AC | 57 ms | 19164 KB |
90_corner_02.txt | AC | 57 ms | 19164 KB |
90_corner_03.txt | AC | 58 ms | 19292 KB |
90_corner_04.txt | AC | 60 ms | 22448 KB |