Submission #6514126


Source Code Expand

from subprocess import*
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 884 Byte
Status MLE
Exec Time 1594 ms
Memory 257212 KB

Judge Result

Set Name Sample All
Score / Max Score 0 / 0 0 / 500
Status
AC × 3
AC × 30
MLE × 1
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 854 ms 171488 KB
0_001.txt AC 1361 ms 240960 KB
0_002.txt AC 840 ms 169124 KB
1_003.txt AC 1353 ms 240416 KB
1_004.txt AC 831 ms 167856 KB
1_005.txt AC 831 ms 168024 KB
1_006.txt AC 833 ms 170824 KB
1_007.txt AC 836 ms 171172 KB
1_008.txt AC 1354 ms 239492 KB
1_009.txt AC 833 ms 171944 KB
1_010.txt AC 841 ms 169936 KB
1_011.txt AC 841 ms 168740 KB
1_012.txt AC 852 ms 172348 KB
1_013.txt AC 1359 ms 241860 KB
1_014.txt AC 1057 ms 202272 KB
1_015.txt AC 1052 ms 204556 KB
1_016.txt AC 1058 ms 203220 KB
1_017.txt AC 1063 ms 202920 KB
1_018.txt MLE 1594 ms 257212 KB
1_019.txt AC 863 ms 175344 KB
1_020.txt AC 865 ms 175072 KB
1_021.txt AC 850 ms 174888 KB
1_022.txt AC 854 ms 176200 KB
1_023.txt AC 853 ms 174424 KB
1_024.txt AC 849 ms 174792 KB
1_025.txt AC 1017 ms 203836 KB
1_026.txt AC 1563 ms 255396 KB
1_027.txt AC 1029 ms 204484 KB
1_028.txt AC 1526 ms 254872 KB
1_029.txt AC 1024 ms 202372 KB
1_030.txt AC 1565 ms 253692 KB