Submission #3447242
Source Code Expand
Option Strict On 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 Char() = New 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 ReDim Preserve result(UBound(result) + 1) result(UBound(result)) = nextChar ElseIf nextChar <> vbCr Then Exit Do End If Loop Return New String(result) End Function End Module
Submission Info
Submission Time | |
---|---|
Task | B - ドローン |
User | ToshiroYanagi |
Language | Visual Basic (Mono 4.0.1) |
Score | 0 |
Code Size | 1689 Byte |
Status | TLE |
Exec Time | 2113 ms |
Memory | 40260 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 | 48 ms | 19920 KB |
00_example_02.txt | AC | 47 ms | 17872 KB |
00_example_03.txt | AC | 46 ms | 17872 KB |
00_example_04.txt | AC | 46 ms | 17872 KB |
10_rand_01.txt | AC | 174 ms | 37332 KB |
10_rand_02.txt | AC | 48 ms | 17872 KB |
10_rand_03.txt | AC | 51 ms | 22468 KB |
10_rand_04.txt | AC | 60 ms | 38212 KB |
20_no_question_01.txt | AC | 174 ms | 35284 KB |
20_no_question_02.txt | AC | 47 ms | 19920 KB |
20_no_question_03.txt | AC | 51 ms | 24516 KB |
20_no_question_04.txt | AC | 60 ms | 38212 KB |
30_max_01.txt | TLE | 2112 ms | 32980 KB |
30_max_02.txt | TLE | 2108 ms | 32980 KB |
30_max_03.txt | TLE | 2113 ms | 32980 KB |
30_max_04.txt | TLE | 2108 ms | 32980 KB |
40_corner_01.txt | TLE | 2109 ms | 35028 KB |
40_corner_02.txt | TLE | 2112 ms | 35028 KB |
40_corner_03.txt | TLE | 2108 ms | 35028 KB |
40_corner_04.txt | TLE | 2108 ms | 35028 KB |
50_hand_01.txt | AC | 47 ms | 17872 KB |
50_hand_02.txt | AC | 47 ms | 19920 KB |
50_hand_03.txt | AC | 47 ms | 19920 KB |
60_rand_01.txt | AC | 175 ms | 37332 KB |
60_rand_02.txt | AC | 47 ms | 17872 KB |
60_rand_03.txt | AC | 50 ms | 22468 KB |
60_rand_04.txt | AC | 61 ms | 38212 KB |
70_no_ques_01.txt | AC | 175 ms | 39380 KB |
70_no_ques_02.txt | AC | 47 ms | 18512 KB |
70_no_ques_03.txt | AC | 50 ms | 22468 KB |
70_no_ques_04.txt | AC | 61 ms | 40260 KB |
80_max_01.txt | TLE | 2109 ms | 35028 KB |
80_max_02.txt | TLE | 2108 ms | 32980 KB |
80_max_03.txt | TLE | 2109 ms | 35028 KB |
80_max_04.txt | TLE | 2108 ms | 32980 KB |
90_corner_01.txt | TLE | 2113 ms | 32980 KB |
90_corner_02.txt | TLE | 2108 ms | 32980 KB |
90_corner_03.txt | TLE | 2109 ms | 35028 KB |
90_corner_04.txt | TLE | 2108 ms | 32980 KB |