Submission #6514133


Source Code Expand

from subprocess import call
call(('julia','-e',"""
const lines=readlines()
input()=shift!(lines)
int(s)=parse(Int32,s)
intLine()=map(int,split(input()))
function nextLine(k)
    x,y,c=split(input())
    int(x)%2k+1,(int(y)+(c=="W")k)%2k+1
end
function solve(k,g)
    m=0
    for i=1:2k,j=1:2k
        a=0
        for x=-1:2,y=-1:2
            (x+y)%2!=0&&continue
            v,w=i+x*k,j+y*k
            v>0<w&&(a+=g[min(2k,v)][min(2k,w)])
            v>k&&w>0&&(a-=g[min(2k,v-k)][min(2k,w)])
            w>k&&v>0&&(a-=g[min(2k,v)][min(2k,w-k)])
            v>k<w&&(a+=g[min(2k,v-k)][min(2k,w-k)])
        end
        m=max(m,a)
    end
    m
end
function main()
    n,k=intLine()
    g=Array{Int32,1}[[0for j=1:2k]for i=1:2k]
    for i=1:n
        x,y=nextLine(k)
        g[x][y]+=1
    end
    println(solve(k,cumsum(map(cumsum,g))))
end
main()
"""))

Submission Info

Submission Time
Task D - Checker
User c_r_5
Language PyPy3 (2.4.0)
Score 0
Code Size 888 Byte
Status MLE
Exec Time 1591 ms
Memory 257312 KB

Judge Result

Set Name Sample All
Score / Max Score 0 / 0 0 / 500
Status
AC × 3
AC × 29
MLE × 2
Set Name Test Cases
Sample 0_000.txt, 0_001.txt, 0_002.txt
All 0_000.txt, 0_001.txt, 0_002.txt, 1_003.txt, 1_004.txt, 1_005.txt, 1_006.txt, 1_007.txt, 1_008.txt, 1_009.txt, 1_010.txt, 1_011.txt, 1_012.txt, 1_013.txt, 1_014.txt, 1_015.txt, 1_016.txt, 1_017.txt, 1_018.txt, 1_019.txt, 1_020.txt, 1_021.txt, 1_022.txt, 1_023.txt, 1_024.txt, 1_025.txt, 1_026.txt, 1_027.txt, 1_028.txt, 1_029.txt, 1_030.txt
Case Name Status Exec Time Memory
0_000.txt AC 910 ms 178248 KB
0_001.txt AC 1362 ms 239392 KB
0_002.txt AC 835 ms 170048 KB
1_003.txt AC 1338 ms 237528 KB
1_004.txt AC 832 ms 173480 KB
1_005.txt AC 830 ms 169300 KB
1_006.txt AC 838 ms 172120 KB
1_007.txt AC 838 ms 170452 KB
1_008.txt AC 1347 ms 239848 KB
1_009.txt AC 832 ms 169172 KB
1_010.txt AC 831 ms 169128 KB
1_011.txt AC 833 ms 173928 KB
1_012.txt AC 836 ms 170720 KB
1_013.txt AC 1344 ms 238472 KB
1_014.txt AC 1047 ms 202680 KB
1_015.txt AC 1042 ms 203300 KB
1_016.txt AC 1060 ms 202588 KB
1_017.txt AC 1059 ms 203396 KB
1_018.txt MLE 1591 ms 256576 KB
1_019.txt AC 845 ms 176284 KB
1_020.txt AC 845 ms 178228 KB
1_021.txt AC 848 ms 176512 KB
1_022.txt AC 851 ms 176520 KB
1_023.txt AC 855 ms 175428 KB
1_024.txt AC 846 ms 177296 KB
1_025.txt AC 1017 ms 203640 KB
1_026.txt MLE 1557 ms 257312 KB
1_027.txt AC 1031 ms 202528 KB
1_028.txt AC 1531 ms 251780 KB
1_029.txt AC 1027 ms 203712 KB
1_030.txt AC 1560 ms 254024 KB