Submission #172424


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 1398 Byte
Status WA
Exec Time 915 ms
Memory 38256 KB

Judge Result

Set Name Sample Subtask1 Subtask2
Score / Max Score 0 / 0 0 / 60 0 / 40
Status
AC × 2
WA × 1
AC × 4
WA × 14
AC × 5
WA × 25
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 WA 61 ms 3380 KB
sample_02.txt AC 46 ms 3376 KB
sample_03.txt AC 46 ms 3380 KB
subtask1_01.txt WA 47 ms 3384 KB
subtask1_02.txt WA 47 ms 3376 KB
subtask1_03.txt WA 47 ms 3384 KB
subtask1_04.txt WA 54 ms 3632 KB
subtask1_05.txt WA 48 ms 3384 KB
subtask1_06.txt WA 48 ms 3500 KB
subtask1_07.txt WA 54 ms 3632 KB
subtask1_08.txt AC 53 ms 3500 KB
subtask1_09.txt AC 54 ms 3508 KB
subtask1_10.txt WA 57 ms 3608 KB
subtask1_11.txt WA 55 ms 3632 KB
subtask1_12.txt WA 55 ms 3696 KB
subtask1_13.txt WA 54 ms 3628 KB
subtask1_14.txt WA 53 ms 3624 KB
subtask1_15.txt WA 53 ms 3620 KB
subtask2_01.txt WA 48 ms 3508 KB
subtask2_02.txt WA 51 ms 3492 KB
subtask2_03.txt WA 306 ms 12464 KB
subtask2_04.txt WA 51 ms 3508 KB
subtask2_05.txt WA 79 ms 4528 KB
subtask2_06.txt WA 180 ms 8104 KB
subtask2_07.txt AC 738 ms 12208 KB
subtask2_08.txt AC 915 ms 38256 KB
subtask2_09.txt AC 873 ms 32172 KB
subtask2_10.txt WA 874 ms 32176 KB
subtask2_11.txt WA 806 ms 20000 KB
subtask2_12.txt WA 898 ms 32432 KB
subtask2_13.txt WA 880 ms 32432 KB
subtask2_14.txt WA 868 ms 32308 KB
subtask2_15.txt WA 872 ms 32432 KB