Submission #172202


Source Code Expand

Copy
import java.util.Scanner;


public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);

		int r = sc.nextInt();
		int c = sc.nextInt();
		int d = sc.nextInt();
		int[][] data = new int[r][c];
		for (int i = 0; i < r; i++) {
			for (int j = 0; j < c; j++) {
				data[i][j] = sc.nextInt();
			}
		}

		int max = 0;
		for (int j = Math.max(r - 1, c - 1); j >= 0; j --) {
			for (int i = 0; i < c; i++) {
				int jj = j * 2 + d % 2;
				if (jj - i < 0) {
					break;
				}
				if (jj - i >= r) {
					continue;
				}
				if (d < jj) {
					break;
				}
				max = Math.max(data[jj - i][i], max);
			}
		}
		System.out.println(max);
		
		sc.close();
	}
}

Submission Info

Submission Time
Task B - 謎の人物X
User garnacha
Language Java (OpenJDK 1.7.0)
Score 100
Code Size 731 Byte
Status AC
Exec Time 1885 ms
Memory 41288 KB

Judge Result

Set Name Sample Subtask1 Subtask2
Score / Max Score 0 / 0 60 / 60 40 / 40
Status
AC × 3
AC × 18
AC × 30
Set Name Test Cases
Sample sample_01.txt, sample_02.txt, sample_03.txt
Subtask1 sample_01.txt, sample_02.txt, sample_03.txt, subtask1_01.txt, subtask1_02.txt, subtask1_03.txt, subtask1_04.txt, subtask1_05.txt, subtask1_06.txt, subtask1_07.txt, subtask1_08.txt, subtask1_09.txt, subtask1_10.txt, subtask1_11.txt, subtask1_12.txt, subtask1_13.txt, subtask1_14.txt, subtask1_15.txt
Subtask2 subtask1_01.txt, subtask1_02.txt, subtask1_03.txt, subtask1_04.txt, subtask1_05.txt, subtask1_06.txt, subtask1_07.txt, subtask1_08.txt, subtask1_09.txt, subtask1_10.txt, subtask1_11.txt, subtask1_12.txt, subtask1_13.txt, subtask1_14.txt, subtask1_15.txt, subtask2_01.txt, subtask2_02.txt, subtask2_03.txt, subtask2_04.txt, subtask2_05.txt, subtask2_06.txt, subtask2_07.txt, subtask2_08.txt, subtask2_09.txt, subtask2_10.txt, subtask2_11.txt, subtask2_12.txt, subtask2_13.txt, subtask2_14.txt, subtask2_15.txt
Case Name Status Exec Time Memory
sample_01.txt AC 438 ms 23256 KB
sample_02.txt AC 434 ms 23264 KB
sample_03.txt AC 425 ms 23140 KB
subtask1_01.txt AC 421 ms 23260 KB
subtask1_02.txt AC 452 ms 23772 KB
subtask1_03.txt AC 444 ms 23896 KB
subtask1_04.txt AC 640 ms 32672 KB
subtask1_05.txt AC 468 ms 24180 KB
subtask1_06.txt AC 576 ms 26760 KB
subtask1_07.txt AC 632 ms 31392 KB
subtask1_08.txt AC 668 ms 32872 KB
subtask1_09.txt AC 648 ms 32556 KB
subtask1_10.txt AC 629 ms 32604 KB
subtask1_11.txt AC 659 ms 32324 KB
subtask1_12.txt AC 678 ms 32412 KB
subtask1_13.txt AC 671 ms 32536 KB
subtask1_14.txt AC 722 ms 32812 KB
subtask1_15.txt AC 656 ms 32220 KB
subtask2_01.txt AC 588 ms 25556 KB
subtask2_02.txt AC 561 ms 25568 KB
subtask2_03.txt AC 1075 ms 38344 KB
subtask2_04.txt AC 637 ms 29504 KB
subtask2_05.txt AC 757 ms 36860 KB
subtask2_06.txt AC 881 ms 37720 KB
subtask2_07.txt AC 1637 ms 41288 KB
subtask2_08.txt AC 1876 ms 41048 KB
subtask2_09.txt AC 1832 ms 41112 KB
subtask2_10.txt AC 1822 ms 40560 KB
subtask2_11.txt AC 1737 ms 40628 KB
subtask2_12.txt AC 1859 ms 41020 KB
subtask2_13.txt AC 1885 ms 41060 KB
subtask2_14.txt AC 1838 ms 41180 KB
subtask2_15.txt AC 1776 ms 41184 KB