CSES - Datatähti 2023 alku - Results
Submission details
Task:Lehmät
Sender:fatihmerickoc
Submission time:2023-02-04 14:57:29 +0200
Language:Python3 (CPython3)
Status:READY
Result:0
Feedback
groupverdictscore
#10
#20
Test results
testverdicttimegroup
#1ACCEPTED0.02 s1, 2details
#20.02 s1, 2details
#30.02 s1, 2details
#40.02 s1, 2details
#50.02 s1, 2details
#60.44 s2details
#70.58 s2details
#80.69 s2details
#90.90 s2details

Code

n, m = map(int, input().split())
a = [list(input().strip()) for _ in range(n)]
ans = sum([row.count("@") for row in a])
for i in range(n):
    for j in range(m):
        if a[i][j] == "*":
            for x in range(n):
                for y in range(m):
                    if a[x][y] == "@" and (x < i or x > i or y < j or y > j):
                        ans -= 1
print(ans)

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
-7

Test 3

Group: 1, 2

Verdict:

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

correct output
4

user output
-104

Test 4

Group: 1, 2

Verdict:

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

correct output
11

user output
-759

Test 5

Group: 1, 2

Verdict:

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

correct output
64

user output
-2240

Test 6

Group: 2

Verdict:

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

correct output
60

user output
-29480

Test 7

Group: 2

Verdict:

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

correct output
1507

user output
-676997

Test 8

Group: 2

Verdict:

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

correct output
3348

user output
-1580856

Test 9

Group: 2

Verdict:

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

correct output
7225

user output
-3312008