CSES - Datatähti 2023 alku - Results
Submission details
Task:Lehmät
Sender:MatvaZ
Submission time:2022-11-06 21:48:26 +0200
Language:Python3 (CPython3)
Status:READY
Result:0
Feedback
groupverdictscore
#10
#20
Test results
testverdicttimegroup
#1ACCEPTED0.02 s1, 2details
#20.02 s1, 2details
#3ACCEPTED0.02 s1, 2details
#4ACCEPTED0.02 s1, 2details
#50.02 s1, 2details
#6ACCEPTED0.02 s2details
#7ACCEPTED0.02 s2details
#8ACCEPTED0.02 s2details
#9ACCEPTED0.02 s2details

Code

n, m = input().split()
n = int(n)
m = int(m)
k = 0
x = " "
previous = " "
counter = 0

for t in range(n):
    i = 0
    x = str(input())
    for letter in x:
        if letter == "*" and previous == "*" and k == 0:
            k = 1
            break
        elif letter == "*" and previous == "*" and k == 1:
            k = 0
            break
        previous = letter
    if k == 1:
        for letter in x:
            if letter == "*" and i == 0:
                i = 1
            elif letter == "*" and i == 1:
                i = 0
                break
            if letter == "@" and i == 1:
                counter += 1
    
print(counter)

Test details

Test 1

Group: 1, 2

Verdict: ACCEPTED

input
3 3
***
*.*
***

correct output
0

user output
0

Test 2

Group: 1, 2

Verdict:

input
3 3
***
*@*
***

correct output
1

user output
0

Test 3

Group: 1, 2

Verdict: ACCEPTED

input
5 10
...@......
..******..
@.*@@@@*.@
..******..
...

correct output
4

user output
4

Test 4

Group: 1, 2

Verdict: ACCEPTED

input
10 10
@@...@.@@@
..@@.@@..@
@.*******@
..*@....*.
...

correct output
11

user output
11

Test 5

Group: 1, 2

Verdict:

input
10 10
**********
*@@@@@@@@*
*@@@@@@@@*
*@@@@@@@@*
...

correct output
64

user output
32

Test 6

Group: 2

Verdict: ACCEPTED

input
100 100
.........................@.......

correct output
60

user output
60

Test 7

Group: 2

Verdict: ACCEPTED

input
100 100
..@@..........@......@....@@.....

correct output
1507

user output
1507

Test 8

Group: 2

Verdict: ACCEPTED

input
100 100
.@..@@..@@.@..@..@..@@..@..@.....

correct output
3348

user output
3348

Test 9

Group: 2

Verdict: ACCEPTED

input
100 100
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@...

correct output
7225

user output
7225