Contest Duration: - (local time) (90 minutes) Back to Home

Submission #171390

Source Code Expand

Copy
```import java.io.ByteArrayInputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.Arrays;
import java.util.InputMismatchException;

public class Main {
static InputStream is;
static PrintWriter out;
static String INPUT = "";

static void solve()
{
int n = ni(), m = ni(), K = ni();
int[][] a = new int[n][m];
for(int i = 0;i < n;i++){
for(int j = 0;j < m;j++){
a[i][j] = ni();
}
}

int max = 0;
for(int i = 0;i < n;i++){
for(int j = 0;j < m;j++){
if((i+j) % 2 == K % 2){
if(i+j <= K){
max = Math.max(max, a[i][j]);
}
}
}
}
out.println(max);
}

public static void main(String[] args) throws Exception
{
long S = System.currentTimeMillis();
is = INPUT.isEmpty() ? System.in : new ByteArrayInputStream(INPUT.getBytes());
out = new PrintWriter(System.out);

solve();
out.flush();
long G = System.currentTimeMillis();
tr(G-S+"ms");
}

private static boolean eof()
{
if(lenbuf == -1)return true;
int lptr = ptrbuf;
while(lptr < lenbuf)if(!isSpaceChar(inbuf[lptr++]))return false;

try {
is.mark(1000);
while(true){
if(b == -1){
is.reset();
return true;
}else if(!isSpaceChar(b)){
is.reset();
return false;
}
}
} catch (IOException e) {
return true;
}
}

private static byte[] inbuf = new byte[1024];
static int lenbuf = 0, ptrbuf = 0;

{
if(lenbuf == -1)throw new InputMismatchException();
if(ptrbuf >= lenbuf){
ptrbuf = 0;
try { lenbuf = is.read(inbuf); } catch (IOException e) { throw new InputMismatchException(); }
if(lenbuf <= 0)return -1;
}
return inbuf[ptrbuf++];
}

private static boolean isSpaceChar(int c) { return !(c >= 33 && c <= 126); }
//	private static boolean isSpaceChar(int c) { return !(c >= 32 && c <= 126); }
private static int skip() { int b; while((b = readByte()) != -1 && isSpaceChar(b)); return b; }

private static double nd() { return Double.parseDouble(ns()); }
private static char nc() { return (char)skip(); }

private static String ns()
{
int b = skip();
StringBuilder sb = new StringBuilder();
while(!(isSpaceChar(b))){
sb.appendCodePoint(b);
}
return sb.toString();
}

private static char[] ns(int n)
{
char[] buf = new char[n];
int b = skip(), p = 0;
while(p < n && !(isSpaceChar(b))){
buf[p++] = (char)b;
}
return n == p ? buf : Arrays.copyOf(buf, p);
}

private static char[][] nm(int n, int m)
{
char[][] map = new char[n][];
for(int i = 0;i < n;i++)map[i] = ns(m);
return map;
}

private static int[] na(int n)
{
int[] a = new int[n];
for(int i = 0;i < n;i++)a[i] = ni();
return a;
}

private static int ni()
{
int num = 0, b;
boolean minus = false;
while((b = readByte()) != -1 && !((b >= '0' && b <= '9') || b == '-'));
if(b == '-'){
minus = true;
}

while(true){
if(b >= '0' && b <= '9'){
num = num * 10 + (b - '0');
}else{
return minus ? -num : num;
}
}
}

private static long nl()
{
long num = 0;
int b;
boolean minus = false;
while((b = readByte()) != -1 && !((b >= '0' && b <= '9') || b == '-'));
if(b == '-'){
minus = true;
}

while(true){
if(b >= '0' && b <= '9'){
num = num * 10 + (b - '0');
}else{
return minus ? -num : num;
}
}
}

private static void tr(Object... o) { if(INPUT.length() != 0)System.out.println(Arrays.deepToString(o)); }
}
```

#### Submission Info

Submission Time 2014-05-17 21:04:49+0900 B - 謎の人物X uwi Java (OpenJDK 1.7.0) 100 3794 Byte AC 1359 ms 27108 KB

#### Judge Result

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
Case Name Status Exec Time Memory
sample_01.txt AC 416 ms 20780 KB
sample_02.txt AC 1359 ms 20656 KB
sample_03.txt AC 430 ms 20664 KB
subtask1_01.txt AC 423 ms 20644 KB
subtask1_02.txt AC 431 ms 20664 KB
subtask1_03.txt AC 462 ms 20752 KB
subtask1_04.txt AC 443 ms 21608 KB
subtask1_05.txt AC 417 ms 20656 KB
subtask1_06.txt AC 448 ms 20972 KB
subtask1_07.txt AC 460 ms 21740 KB
subtask1_08.txt AC 458 ms 21700 KB
subtask1_09.txt AC 449 ms 21680 KB
subtask1_10.txt AC 460 ms 21936 KB
subtask1_11.txt AC 444 ms 21932 KB
subtask1_12.txt AC 452 ms 22072 KB
subtask1_13.txt AC 447 ms 21808 KB
subtask1_14.txt AC 438 ms 21776 KB
subtask1_15.txt AC 448 ms 21940 KB
subtask2_01.txt AC 445 ms 20648 KB
subtask2_02.txt AC 434 ms 20780 KB
subtask2_03.txt AC 536 ms 23728 KB
subtask2_04.txt AC 465 ms 20948 KB
subtask2_05.txt AC 458 ms 22324 KB
subtask2_06.txt AC 473 ms 22988 KB
subtask2_07.txt AC 783 ms 27104 KB
subtask2_08.txt AC 902 ms 26288 KB
subtask2_09.txt AC 536 ms 26556 KB
subtask2_10.txt AC 596 ms 27108 KB
subtask2_11.txt AC 563 ms 26420 KB
subtask2_12.txt AC 606 ms 26424 KB
subtask2_13.txt AC 794 ms 26964 KB
subtask2_14.txt AC 696 ms 26520 KB
subtask2_15.txt AC 649 ms 26296 KB