Submission #33923


Source Code Expand

Copy
import java.util.Scanner;
public class Main{
	    Scanner sc = new Scanner(System.in);
		public static void main(String[] args) {
				Main m = new Main();
				m.run();
		}
		public void run(){
				//main
				int numLine = sc.nextInt();
				int Tate = sc.nextInt();
				sc.nextLine();
				boolean[][] amida = new boolean[Tate][numLine+1];
				for (int i = 0; i < Tate; i++) {
					    String thisLine = sc.nextLine();
						for (int j = 0; j < numLine -1; j++) {
							    String thisComp = thisLine.substring(j*2+1,j*2+2);
								if (thisComp.equals("-")) {
										amida[i][j+1] = true;
								}
						}
				}
				String lastLine = sc.nextLine();
				int goal = 0;
				for (int j = 0; j < numLine; j++) {
						String thisComp = lastLine.substring(j*2,j*2+1);
						if (thisComp.equals("o")) {
								goal = j;
								break;
						}
				}
				//tadoru
				int nowStopLine = goal;
				for (int k = Tate-1; k > -1; k--) {
						//System.out.printf("now :%d%n",nowStopLine);
					    if (amida[k][nowStopLine]) {
								nowStopLine--;
						}else if (amida[k][nowStopLine+1]) {
								nowStopLine++;
						}
				}
				System.out.println(nowStopLine+1);


		}
}

Submission Info

Submission Time
Task B - あみだくじ
User tomoasleep
Language Java (OpenJDK 1.7.0)
Score 100
Code Size 1214 Byte
Status AC
Exec Time 656 ms
Memory 20664 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 656 ms 20664 KB
00_sample_01.txt AC 470 ms 20492 KB
00_sample_02.txt AC 502 ms 20492 KB
00_sample_03.txt AC 461 ms 20492 KB
00_sample_04.txt AC 465 ms 20496 KB
00_sample_05.txt AC 522 ms 20448 KB
01_rnd_00.txt AC 509 ms 20488 KB
01_rnd_01.txt AC 442 ms 20480 KB
01_rnd_02.txt AC 505 ms 20480 KB
01_rnd_03.txt AC 443 ms 20496 KB
01_rnd_04.txt AC 465 ms 20500 KB
01_rnd_05.txt AC 463 ms 20492 KB
01_rnd_06.txt AC 463 ms 20528 KB
01_rnd_07.txt AC 473 ms 20612 KB
01_rnd_08.txt AC 497 ms 20492 KB
01_rnd_09.txt AC 459 ms 20496 KB
01_rnd_10.txt AC 479 ms 20488 KB
01_rnd_11.txt AC 454 ms 20400 KB
01_rnd_12.txt AC 453 ms 20524 KB
01_rnd_13.txt AC 454 ms 20508 KB
01_rnd_14.txt AC 504 ms 20496 KB
01_rnd_15.txt AC 446 ms 20488 KB
01_rnd_16.txt AC 453 ms 20480 KB
01_rnd_17.txt AC 470 ms 20496 KB
01_rnd_18.txt AC 496 ms 20400 KB
01_rnd_19.txt AC 463 ms 20480 KB
02_maxrnd_00.txt AC 503 ms 20576 KB
02_maxrnd_01.txt AC 589 ms 20528 KB
02_maxrnd_02.txt AC 564 ms 20564 KB
02_maxrnd_03.txt AC 497 ms 20488 KB
02_maxrnd_04.txt AC 463 ms 20532 KB
03_empty_00.txt AC 482 ms 20528 KB
03_empty_01.txt AC 456 ms 20492 KB
03_empty_02.txt AC 462 ms 20488 KB