CSES - Datatähti 2023 alku - Results
Submission details
Task:Lehmät
Sender:a256
Submission time:2022-10-31 08:14:03 +0200
Language:C++11
Status:READY
Result:0
Feedback
groupverdictscore
#10
#20
Test results
testverdicttimegroup
#1ACCEPTED0.00 s1, 2details
#2ACCEPTED0.00 s1, 2details
#30.00 s1, 2details
#40.00 s1, 2details
#5ACCEPTED0.00 s1, 2details
#60.00 s2details
#70.00 s2details
#80.00 s2details
#90.00 s2details

Code

#include <bits/stdc++.h>
using namespace std;
#define FOR(i, n) for(decltype(n) i=0;i<(n);++i)
#define FORI(i, s, n) for(decltype(n) i=(s);i<(n);++i)
#define BE(t) t.begin(), t.end()
#define RBE(t) t.rbegin(), t.rend()
#define evn(n) (!((n) & 1))
#define PB push_back
#define MP(f, s) make_pair((f), (s))
#define F first
#define S second
#define pmod(a, m) ((a)%(m)+(m))%(m)
typedef unsigned long long ull;
typedef long long ll;
#define MOD ((int)1e9+7)
#define CEILDIV(a, b) (((a)-1)/(b)+1)

int main(){
	int n, m, r = 0;
	cin >> n >> m;
	for(int i = 0; i < n; ++i){
		string s;
		cin >> s;
		int j;
		for(j = 0; j < m && s[j] != '*'; ++j);
		++j;
		for(; j < m && j != '*'; ++j){
			if(s[j] == '@')
				++r;
		}
	}
	cout << r;
}

Test details

Test 1

Group: 1, 2

Verdict: ACCEPTED

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

correct output
0

user output
0

Test 2

Group: 1, 2

Verdict: ACCEPTED

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

correct output
1

user output
1

Test 3

Group: 1, 2

Verdict:

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

correct output
4

user output
5

Test 4

Group: 1, 2

Verdict:

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

correct output
11

user output
15

Test 5

Group: 1, 2

Verdict: ACCEPTED

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

correct output
64

user output
64

Test 6

Group: 2

Verdict:

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

correct output
60

user output
30

Test 7

Group: 2

Verdict:

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

correct output
1507

user output
596

Test 8

Group: 2

Verdict:

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

correct output
3348

user output
1271

Test 9

Group: 2

Verdict:

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

correct output
7225

user output
3060