Submission #33762


Source Code Expand

Copy
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

using Ustok.Util;

class Program
{
	static void Main(string[] args)
	{
		int[] a = Console.ReadLine().Split(' ').Select(i => i.ToInt()).ToArray();
		int N = a[0], L = a[1];

		char[][] field = new char[L][];
		for (int i = 0; i < L; i++)
		{
			field[i] = Console.ReadLine().ToArray();
		}
		string m = Console.ReadLine();

		int p = getp(m);

		for (int i = L - 1; i >= 0; i--)
		{
			if (p > 0 && field[i][p - 1] == '-')
			{
				p -= 2;
			}
			else if (p < N*2 - 1 && field[i][p + 1] == '-')
			{
				p += 2;
			}
		}
		Console.WriteLine((p / 2) + 1);
	}

	static int getp(string l)
	{
		for (int i = 0; i < l.Length; i++)
		{
			if (l[i] == 'o') return i;
		}
		return 0;
	}

}

namespace Ustok.Util
{
	public static class Extensions
	{
		public static int ToInt(this string s)
		{
			return int.Parse(s);
		}

		public static double ToDouble(this string s)
		{
			return double.Parse(s);
		}

		public static float ToFloat(this string s)
		{
			return float.Parse(s);
		}
	}

}

Submission Info

Submission Time
Task B - あみだくじ
User nankotsu230
Language C# (Mono 2.10.8.1)
Score 0
Code Size 1138 Byte
Status RE
Exec Time 173 ms
Memory 8760 KB

Judge Result

Set Name All
Score / Max Score 0 / 100
Status
AC × 23
RE × 11
Set Name Test Cases
All 00_min.txt, 00_sample_01.txt, 00_sample_02.txt, 00_sample_03.txt, 00_sample_04.txt, 00_sample_05.txt, 01_rnd_00.txt, 01_rnd_01.txt, 01_rnd_02.txt, 01_rnd_03.txt, 01_rnd_04.txt, 01_rnd_05.txt, 01_rnd_06.txt, 01_rnd_07.txt, 01_rnd_08.txt, 01_rnd_09.txt, 01_rnd_10.txt, 01_rnd_11.txt, 01_rnd_12.txt, 01_rnd_13.txt, 01_rnd_14.txt, 01_rnd_15.txt, 01_rnd_16.txt, 01_rnd_17.txt, 01_rnd_18.txt, 01_rnd_19.txt, 02_maxrnd_00.txt, 02_maxrnd_01.txt, 02_maxrnd_02.txt, 02_maxrnd_03.txt, 02_maxrnd_04.txt, 03_empty_00.txt, 03_empty_01.txt, 03_empty_02.txt
Case Name Status Exec Time Memory
00_min.txt RE 150 ms 8664 KB
00_sample_01.txt AC 145 ms 8684 KB
00_sample_02.txt AC 156 ms 8736 KB
00_sample_03.txt RE 148 ms 8668 KB
00_sample_04.txt RE 150 ms 8676 KB
00_sample_05.txt AC 148 ms 8684 KB
01_rnd_00.txt RE 148 ms 8668 KB
01_rnd_01.txt AC 148 ms 8744 KB
01_rnd_02.txt AC 146 ms 8736 KB
01_rnd_03.txt RE 147 ms 8528 KB
01_rnd_04.txt AC 148 ms 8616 KB
01_rnd_05.txt RE 149 ms 8668 KB
01_rnd_06.txt AC 147 ms 8704 KB
01_rnd_07.txt AC 155 ms 8660 KB
01_rnd_08.txt AC 149 ms 8728 KB
01_rnd_09.txt AC 148 ms 8736 KB
01_rnd_10.txt RE 148 ms 8668 KB
01_rnd_11.txt AC 147 ms 8676 KB
01_rnd_12.txt AC 150 ms 8760 KB
01_rnd_13.txt RE 147 ms 8676 KB
01_rnd_14.txt AC 145 ms 8748 KB
01_rnd_15.txt RE 153 ms 8664 KB
01_rnd_16.txt RE 147 ms 8656 KB
01_rnd_17.txt AC 173 ms 8680 KB
01_rnd_18.txt RE 150 ms 8656 KB
01_rnd_19.txt AC 146 ms 8612 KB
02_maxrnd_00.txt AC 147 ms 8676 KB
02_maxrnd_01.txt AC 146 ms 8740 KB
02_maxrnd_02.txt AC 142 ms 8616 KB
02_maxrnd_03.txt AC 148 ms 8680 KB
02_maxrnd_04.txt AC 147 ms 8616 KB
03_empty_00.txt AC 146 ms 8608 KB
03_empty_01.txt AC 148 ms 8612 KB
03_empty_02.txt AC 146 ms 8676 KB