Submission #3414838
Source Code Expand
using System; using System.Linq;//リストの使用 using System.Collections.Generic; class Program { static void Main() { string s = Console.ReadLine(); string[] input = Console.ReadLine().Split(' ');//Splitで区切り文字を指定して複数個受け取る。 long x = long.Parse(input[0]); long y = long.Parse(input[1]); long direction = 0;//1でy、2でX方向 long xMax = 0; long yMax = 0; bool answer = false; for(long i = 0; i < s.Length; i++) { if(direction == 0 && s[i] == 'F') x--; if(s[i] == 'F') { if(direction == 0) direction = 1; else direction = 3 - direction; } if(direction == 1 && s[i] == 'F') yMax++; if(direction == 2 && s[i] == 'F') xMax++; } if(xMax%2 == x%2 && yMax%2==y%2 && x<=xMax && y<=yMax) answer=true; Console.WriteLine((answer) ? "Yes" : "No"); } }
Submission Info
Submission Time | |
---|---|
Task | D - FT Robot |
User | suikameron |
Language | C# (Mono 4.6.2.0) |
Score | 0 |
Code Size | 924 Byte |
Status | CE |
Compile Error
./Main.cs(19,29): error CS1502: The best overloaded method match for `string.this[int]' has some invalid arguments /usr/lib/mono/4.5/mscorlib.dll (Location of the symbol related to previous error) ./Main.cs(19,30): error CS1503: Argument `#1' cannot convert `long' expression to type `int' ./Main.cs(20,11): error CS1502: The best overloaded method match for `string.this[int]' has some invalid arguments /usr/lib/mono/4.5/mscorlib.dll (Location of the symbol related to previous error) ./Main.cs(20,12): error CS1503: Argument `#1' cannot convert `long' expression to type `int' ./Main.cs(25,29): error CS1502: The best overloaded method match for `string.this[int]' has some invalid arguments /usr/lib/mono/4.5/mscorlib.dll (Location of the symbol related to previous error) ./Main.cs(25,30): error CS1503: Argument `#1' cannot convert `long' expression to type `int' ./Main.cs(26,29): error CS1502: The best overloaded method match for `string.this[int]' has some invalid arguments /usr/lib/mono/4.5/mscorlib.dll (Locatio...