549A - Face Detection - CodeForces Solution


implementation strings *900

Please click on ads to support us..

Python Code:

arr = list(map(int, input().rstrip().split()))
arra= []
if arr[0]==1 or arr[1]==0 :
    print("0")
else:
    for i in range(arr[0]):
        b = input()
        a = list(b)
        
        arra.append(a)
    count = 0
            x = arr[0]-1
    y = arr[1]-1
    z = x*y
    for i in range(x):

                for j in range(y):
            ar = []
                        ar.append(arra[i][j])
                        ar.append(arra[i][j + 1])
                        ar.append( arra[i + 1][j])
                        ar.append( arra[i + 1][j + 1])

            if 'f' in ar and 'a' in ar and 'c' in ar and 'e' in ar:
                count+=1
                    print(count)


Comments

Submit
0 Comments
More Questions

1702E - Split Into Two Sets
1703B - ICPC Balloons
1702F - Equate Multisets
1700A - Optimal Path
665C - Simple Strings
1708A - Difference Operations
1703E - Mirror Grid
1042A - Benches
1676B - Equal Candies
1705B - Mark the Dust Sweeper
1711A - Perfect Permutation
1701B - Permutation
1692A - Marathon
1066A - Vova and Train
169B - Replacing Digits
171D - Broken checker
380C - Sereja and Brackets
1281B - Azamon Web Services
1702A - Round Down the Price
1681C - Double Sort
12A - Super Agent
1709A - Three Doors
1680C - Binary String
1684B - Z mod X = C
1003A - Polycarp's Pockets
1691B - Shoe Shuffling
1706A - Another String Minimization Problem
1695B - Circle Game
1702B - Polycarp Writes a String from Memory
1701A - Grass Field