Submission #424744


Source Code Expand

Copy
# -*- coding: utf-8 -*-
import math,string,itertools,fractions,heapq,collections,re,array,bisect

def s():
    return raw_input().strip()
def n():
    return int(raw_input())
def d():
    return float(raw_input())

def ls():
    return raw_input().strip().split()
def ln():
    return map(int, raw_input().strip().split())
def ld():
    return map(float, raw_input().strip().split())

def fs():
    return [raw_input().strip() for i in xrange(input())]
def fn():
    return [int(raw_input().strip()) for i in xrange(input())]
def fd():
    return [float(raw_input().strip()) for i in xrange(input())]


S = fs()
#arr = ln()
#a = sorted(ln())
#a = ln()


L = len(S)
for i in xrange(L):
    S[i] = list(S[i][::-1])

result = 0
for i in xrange(L):
    for j in xrange(L):
        if S[i][j] == '.':
            result += 1
            for k in xrange(j, L):
                S[i][k] = 'o'
            if i + 1 < L:
                for k in xrange(j + 1):
                    S[i + 1][k] = 'o'
#    for l in S:
#        print l[::-1]

print result

Submission Info

Submission Time
Task C - Z塗り
User mugenen
Language Python (2.7.3)
Score 100
Code Size 1092 Byte
Status
Exec Time 93 ms
Memory 4944 KB

Judge Result

Set Name Score / Max Score Test Cases
Sample 0 / 0 sample-01.txt, sample-02.txt, sample-03.txt
All 100 / 100 sample-01.txt, sample-02.txt, sample-03.txt, 01-01.txt, 01-02.txt, 01-03.txt, 01-04.txt, 01-05.txt, 01-06.txt, 01-07.txt, 01-08.txt, 01-09.txt, 01-10.txt, 01-11.txt, 01-12.txt, 01-13.txt, 01-14.txt, 01-15.txt, 01-16.txt, 01-17.txt, 01-18.txt, 01-19.txt, 01-20.txt
Case Name Status Exec Time Memory
01-01.txt 76 ms 4808 KB
01-02.txt 75 ms 4804 KB
01-03.txt 76 ms 4804 KB
01-04.txt 75 ms 4812 KB
01-05.txt 77 ms 4804 KB
01-06.txt 78 ms 4804 KB
01-07.txt 86 ms 4744 KB
01-08.txt 84 ms 4940 KB
01-09.txt 80 ms 4924 KB
01-10.txt 80 ms 4928 KB
01-11.txt 83 ms 4932 KB
01-12.txt 82 ms 4932 KB
01-13.txt 87 ms 4936 KB
01-14.txt 84 ms 4932 KB
01-15.txt 93 ms 4812 KB
01-16.txt 77 ms 4800 KB
01-17.txt 81 ms 4868 KB
01-18.txt 79 ms 4932 KB
01-19.txt 83 ms 4944 KB
01-20.txt 80 ms 4928 KB
sample-01.txt 77 ms 4804 KB
sample-02.txt 77 ms 4796 KB
sample-03.txt 74 ms 4800 KB