CSES - Datatähti 2023 alku - Results
Submission details
Task:Lehmät
Sender:fatihmerickoc
Submission time:2023-02-04 14:56:34 +0200
Language:C++ (C++11)
Status:READY
Result:0
Feedback
groupverdictscore
#10
#20
Test results
testverdicttimegroup
#1ACCEPTED0.00 s1, 2details
#20.00 s1, 2details
#30.00 s1, 2details
#40.00 s1, 2details
#50.00 s1, 2details
#60.01 s2details
#70.01 s2details
#80.02 s2details
#90.01 s2details

Code

#include<bits/stdc++.h>
using namespace std;
int n,m,ans;
char a[105][105];

int main()
{
    cin>>n>>m;
    for(int i=0;i<n;i++)
        for(int j=0;j<m;j++)
        {
            cin>>a[i][j];
            if(a[i][j]=='@')
                ans++;
        }
    for(int i=0;i<n;i++)
        for(int j=0;j<m;j++)
            if(a[i][j]=='*')
                for(int x=0;x<n;x++)
                    for(int y=0;y<m;y++)
                        if(a[x][y]=='@')
                            if(x<i || x>i || y<j || y>j)
                                ans--;
    cout<<ans<<endl;
    return 0;
}

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