Submission #1050215

# Submission time Handle Problem Language Result Execution time Memory
1050215 2024-08-09T08:02:15 Z vjudge1 Dango Maker (JOI18_dango_maker) Python 3
0 / 100
9 ms 3164 KB
n,m=map(int,input().split())
mas=[]
for i in range(n):
    mas.append(list(input()))
dic={}


for i in range(n):
    for j in range(m):
        s1=''
        s2=''
        for k in range(3):
            ik=i+k
            jk=j+k
            if ik<n:
                s1+=mas[ik][j]
            if jk<m:
                s2+=mas[i][jk]
        flag1,flag2=0,0
        if s1 in dic:
            for k in range(len(dic[s1][1])):
                if dic[s1][1][k]==[i,j]:
                    flag1=1
                    break
        if s2 in dic:
            for k in range(len(dic[s2][1])):
                if dic[s2][1][k]==[i,j]:
                    flag2=1
                    break

        if len(s1)==3 and len(s2)==3 and not flag1 and not flag2:
                if s1 in dic:
                    dic[s1][1].append([i,j])
                    dic[s1][1].append([i+1,j])
                    dic[s1][1].append([i+2,j])
                    dic[s1][0]+=1
                else:
                    dic[s1]=[1,[[i,j],[i+1,j],[i+2,j]]]
        elif len(s2)==3 and not flag2:
            if s2 in dic:
                dic[s2][1].append([i,j])
                dic[s2][1].append([i,j+1])
                dic[s2][1].append([i,j+2])
                dic[s2][0]+=1
            else:
                dic[s2]=[1,[[i,j],[i,j+1],[i,j+2]]]
        elif len(s1)==3 and not flag1:
            if s1 in dic:
                dic[s1][1].append([i,j])
                dic[s1][1].append([i+1,j])
                dic[s1][1].append([i+2,j])
                dic[s1][0]+=1
            else:
                dic[s1]=[1,[[i+1,j],[i,j],[i+2,j]]]
mx=0
for i in dic:
    if mx < dic[i][0]:
        mx=dic[i][0]
print(mx)
# Verdict Execution time Memory Grader output
1 Correct 9 ms 3164 KB Output is correct
2 Correct 8 ms 3164 KB Output is correct
3 Correct 9 ms 3164 KB Output is correct
4 Incorrect 9 ms 3104 KB Output isn't correct
5 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 9 ms 3164 KB Output is correct
2 Correct 8 ms 3164 KB Output is correct
3 Correct 9 ms 3164 KB Output is correct
4 Incorrect 9 ms 3104 KB Output isn't correct
5 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 9 ms 3164 KB Output is correct
2 Correct 8 ms 3164 KB Output is correct
3 Correct 9 ms 3164 KB Output is correct
4 Incorrect 9 ms 3104 KB Output isn't correct
5 Halted 0 ms 0 KB -