CSES - Datatähti 2023 alku - Results
Submission details
Task:Lehmät
Sender:Yin Shengzhe
Submission time:2022-11-11 10:08:38 +0200
Language:Python3 (CPython3)
Status:READY
Result:0
Feedback
groupverdictscore
#10
#20
Test results
testverdicttimegroup
#10.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

# Online Python - IDE, Editor, Compiler, Interpreter
counter = 0
count = False
n, m = input().split()
for x in range(int(n)):
    line = input()
    for i in range(int(m)):
        if line[i] == "*":
            if line[i+1] == "*" or line[i-1] == "*":
                pass
            else:
                if count == False:
                    count = True
                elif count == True:
                    count = False
                    
        elif line[i] == "@":
            if count == True:
                counter += 1

print(counter)

Test details

Test 1

Group: 1, 2

Verdict:

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

correct output
0

user output
(empty)

Error:
Traceback (most recent call last):
  File "/box/input/code.py", line 10, in <module>
    i...

Test 2

Group: 1, 2

Verdict:

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

correct output
1

user output
(empty)

Error:
Traceback (most recent call last):
  File "/box/input/code.py", line 10, in <module>
    i...

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
(empty)

Error:
Traceback (most recent call last):
  File "/box/input/code.py", line 10, in <module>
    i...

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