Submission #33717


Source Code Expand

Copy
import java.util.*;

public class Main{
	public static int judge(char[][] lot){
		int now = 0;
		for(int i = 0; i < lot[0].length; i++){
			if( lot[lot.length-1][i] == 'o' ){
				now = i;
			}
		}
		for(int i = lot.length-2; i >= 0; i--){
			if( now > 0 && lot[i][now-1] == '-' ){
				now -= 2;
			} else if( now < lot[0].length-1 && lot[i][now+1] == '-' ){
				now += 2;
			}
		}
		return now/2 + 1;
	}
	public static void main(String[] args){
		Scanner stdIn = new Scanner(System.in);
		int n = stdIn.nextInt(), w = stdIn.nextInt();
		char[][] lot = new char[w+1][n];
		stdIn.nextLine();
		for(int i = 0; i < w+1; i++){
			lot[i] = stdIn.nextLine().toCharArray();
		}
		System.out.println(judge(lot));
	}
}

Submission Info

Submission Time
Task B - あみだくじ
User eulerdora
Language Java (OpenJDK 1.7.0)
Score 100
Code Size 739 Byte
Status AC
Exec Time 450 ms
Memory 20604 KB

Judge Result

Set Name All
Score / Max Score 100 / 100
Status
AC × 34
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 AC 449 ms 20432 KB
00_sample_01.txt AC 439 ms 20404 KB
00_sample_02.txt AC 433 ms 20460 KB
00_sample_03.txt AC 442 ms 20444 KB
00_sample_04.txt AC 429 ms 20456 KB
00_sample_05.txt AC 431 ms 20448 KB
01_rnd_00.txt AC 440 ms 20468 KB
01_rnd_01.txt AC 433 ms 20392 KB
01_rnd_02.txt AC 430 ms 20468 KB
01_rnd_03.txt AC 431 ms 20472 KB
01_rnd_04.txt AC 433 ms 20452 KB
01_rnd_05.txt AC 432 ms 20456 KB
01_rnd_06.txt AC 431 ms 20472 KB
01_rnd_07.txt AC 431 ms 20532 KB
01_rnd_08.txt AC 441 ms 20464 KB
01_rnd_09.txt AC 436 ms 20456 KB
01_rnd_10.txt AC 450 ms 20472 KB
01_rnd_11.txt AC 435 ms 20432 KB
01_rnd_12.txt AC 435 ms 20552 KB
01_rnd_13.txt AC 428 ms 20456 KB
01_rnd_14.txt AC 439 ms 20532 KB
01_rnd_15.txt AC 428 ms 20476 KB
01_rnd_16.txt AC 442 ms 20460 KB
01_rnd_17.txt AC 448 ms 20584 KB
01_rnd_18.txt AC 433 ms 20468 KB
01_rnd_19.txt AC 429 ms 20532 KB
02_maxrnd_00.txt AC 429 ms 20532 KB
02_maxrnd_01.txt AC 434 ms 20472 KB
02_maxrnd_02.txt AC 437 ms 20468 KB
02_maxrnd_03.txt AC 429 ms 20604 KB
02_maxrnd_04.txt AC 440 ms 20480 KB
03_empty_00.txt AC 431 ms 20460 KB
03_empty_01.txt AC 430 ms 20416 KB
03_empty_02.txt AC 423 ms 20464 KB