Submission #172430


Source Code Expand

Copy
R, C ,D = [int(x) for x in raw_input().strip().split()]
data = [[int(x) for x in raw_input().strip().split() ] for _ in xrange(R)]
max_takoyaki = 0

if R == 1:
    move_tuple = [0,0]
    cnt = 1
    flag = D
    while(flag):
        if move_tuple[1] == C-1: cnt = -1
        if move_tuple[1] == 0: cnt = 1
        move_tuple[1] += cnt
        flag -= 1

    takoyaki = data[move_tuple[0]][move_tuple[1]]
    if takoyaki > max_takoyaki: max_takoyaki = takoyaki

elif C == 1:
    move_tuple = [0,0]
    cnt = 1
    flag = D
    while(flag):
        if move_tuple[0] == R-1: cnt = -1
        if move_tuple[0] == 0: cnt = 1
        move_tuple[0] += cnt
        flag -= 1
    takoyaki = data[move_tuple[0]][move_tuple[1]]
    if takoyaki > max_takoyaki: max_takoyaki = takoyaki
else:
    for i in xrange(D+1):
        move_tuple = [0,0]
        cnt = 1
        flag = i
        while(flag):
            if move_tuple[0] == R-1: cnt = -1
            if move_tuple[0] == 0: cnt = 1
            move_tuple[0] += cnt
            flag -= 1

        flag = D-i
        while(flag):
            if move_tuple[1] == C-1: cnt = -1
            if move_tuple[1] == 0: cnt = 1
            move_tuple[1] += cnt
            flag -= 1

        takoyaki = data[move_tuple[0]][move_tuple[1]]
        if takoyaki > max_takoyaki: max_takoyaki = takoyaki

print max_takoyaki

Submission Info

Submission Time
Task B - 謎の人物X
User shin0420
Language Python (2.7.3)
Score 0
Code Size 1400 Byte
Status WA
Exec Time 2035 ms
Memory 38304 KB

Judge Result

Set Name Sample Subtask1 Subtask2
Score / Max Score 0 / 0 0 / 60 0 / 40
Status
AC × 3
AC × 9
WA × 9
AC × 11
WA × 16
TLE × 3
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 49 ms 3444 KB
sample_02.txt AC 64 ms 3500 KB
sample_03.txt AC 48 ms 3508 KB
subtask1_01.txt AC 51 ms 3500 KB
subtask1_02.txt AC 52 ms 3452 KB
subtask1_03.txt AC 50 ms 3496 KB
subtask1_04.txt WA 61 ms 3580 KB
subtask1_05.txt AC 49 ms 3504 KB
subtask1_06.txt WA 50 ms 3456 KB
subtask1_07.txt WA 79 ms 3760 KB
subtask1_08.txt AC 62 ms 3452 KB
subtask1_09.txt AC 62 ms 3628 KB
subtask1_10.txt WA 74 ms 3580 KB
subtask1_11.txt WA 69 ms 3756 KB
subtask1_12.txt WA 74 ms 3756 KB
subtask1_13.txt WA 72 ms 3576 KB
subtask1_14.txt WA 56 ms 3756 KB
subtask1_15.txt WA 70 ms 3768 KB
subtask2_01.txt AC 81 ms 3496 KB
subtask2_02.txt AC 189 ms 3500 KB
subtask2_03.txt WA 737 ms 12588 KB
subtask2_04.txt WA 114 ms 3624 KB
subtask2_05.txt WA 147 ms 4652 KB
subtask2_06.txt TLE 2030 ms 8240 KB
subtask2_07.txt AC 1174 ms 12212 KB
subtask2_08.txt AC 950 ms 38304 KB
subtask2_09.txt AC 1336 ms 32284 KB
subtask2_10.txt TLE 2032 ms 32292 KB
subtask2_11.txt WA 1034 ms 20016 KB
subtask2_12.txt WA 890 ms 32544 KB
subtask2_13.txt WA 1734 ms 32520 KB
subtask2_14.txt TLE 2035 ms 32420 KB
subtask2_15.txt WA 1790 ms 32564 KB