Submission #171898


Source Code Expand

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

class Program {
	static void Main(string[] args) {
		new Program().solve();
	}

	Action<Object> PUTS = str => Console.WriteLine(str);
	Action<int[,]> LIST = (array2D) => {
		for (int i = 0; i < array2D.GetLength(0); i++) {
			for (int j = 0; j < array2D.GetLength(1); j++) Console.Write("{0,-3} ", array2D[i, j]);
			Console.WriteLine();
		}
	};
	Action<int, Action<int>> REP = (n, action) => { for (int i = 0; i < n; i++) action(i); };
	Action<int, int, Action<int>> FOR = (a, b, action) => { for (int i = a; i < b; i++) action(i); };
	Action<int, int, Action<int, int>> NEST = (row, col, action) => {
		for (int i = 0; i < row; i++) for (int j = 0; j < col; j++) action(i, j);
	};

	public void solve() {

		Scanner cin = new Scanner();
		int r = cin.nextInt();
		int c = cin.nextInt();
		int d = cin.nextInt();

		int[,] a = new int[r, c];
		for (int i = 0; i < r; i++) for (int j = 0; j < c; j++) a[i, j] = cin.nextInt();

		int ans = 0;

		if (d == 0) {
			ans = a[0, 0];
		} else {
			bool dIsOdd = d % 2 == 0 ? false : true;
			if (dIsOdd) {
				for (int i = 0; i < r; i++) for (int j = 0; j < c - i; j++)
						if (i % 2 != j % 2 && ans < a[i, j]) ans = a[i, j];
			} else {
				for (int i = 0; i < r; i++) for (int j = 0; j < c - i; j++)
						if (i % 2 == j % 2 && ans < a[i, j]) ans = a[i, j];
			}
		}
		PUTS(ans);

	}

}


class Scanner {
	string[] s;
	int i;
	char[] cs = new char[] { ' ' };

	public Scanner() {
		s = new string[0];
		i = 0;
	}

	public string next() {
		if (i < s.Length) return s[i++];
		s = Console.ReadLine().Split(cs, StringSplitOptions.RemoveEmptyEntries);
		i = 0;
		return s[i++];
	}

	public int nextInt() {
		return int.Parse(next());
	}

	public long nextLong() {
		return long.Parse(next());
	}
}

Submission Info

Submission Time
Task B - 謎の人物X
User parfait
Language C# (Mono 2.10.8.1)
Score 0
Code Size 1887 Byte
Status WA
Exec Time 459 ms
Memory 15256 KB

Judge Result

Set Name Sample Subtask1 Subtask2
Score / Max Score 0 / 0 0 / 60 0 / 40
Status
AC × 3
AC × 10
WA × 8
AC × 17
WA × 13
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 138 ms 7748 KB
sample_02.txt AC 138 ms 7752 KB
sample_03.txt AC 142 ms 7748 KB
subtask1_01.txt AC 133 ms 7748 KB
subtask1_02.txt AC 137 ms 7752 KB
subtask1_03.txt WA 142 ms 7852 KB
subtask1_04.txt AC 143 ms 8012 KB
subtask1_05.txt AC 143 ms 7872 KB
subtask1_06.txt WA 144 ms 7884 KB
subtask1_07.txt WA 143 ms 7976 KB
subtask1_08.txt AC 144 ms 8008 KB
subtask1_09.txt WA 145 ms 8076 KB
subtask1_10.txt WA 142 ms 8016 KB
subtask1_11.txt WA 146 ms 8008 KB
subtask1_12.txt AC 142 ms 8012 KB
subtask1_13.txt WA 142 ms 8012 KB
subtask1_14.txt WA 144 ms 8008 KB
subtask1_15.txt AC 147 ms 7988 KB
subtask2_01.txt AC 145 ms 7972 KB
subtask2_02.txt WA 144 ms 7888 KB
subtask2_03.txt AC 236 ms 10308 KB
subtask2_04.txt AC 139 ms 8008 KB
subtask2_05.txt WA 156 ms 8260 KB
subtask2_06.txt AC 185 ms 9284 KB
subtask2_07.txt AC 332 ms 15248 KB
subtask2_08.txt WA 451 ms 15236 KB
subtask2_09.txt WA 442 ms 15232 KB
subtask2_10.txt AC 455 ms 15252 KB
subtask2_11.txt AC 395 ms 15240 KB
subtask2_12.txt WA 455 ms 15256 KB
subtask2_13.txt AC 442 ms 15224 KB
subtask2_14.txt AC 456 ms 15248 KB
subtask2_15.txt AC 459 ms 15240 KB