CSES - Datatähti 2023 alku - Results
Submission details
Task:Lehmät
Sender:Tipu
Submission time:2022-10-31 09:43:59 +0200
Language:C++17
Status:READY
Result:0
Feedback
groupverdictscore
#10
#20
Test results
testverdicttimegroup
#10.00 s1, 2details
#2ACCEPTED0.00 s1, 2details
#30.00 s1, 2details
#40.01 s1, 2details
#50.00 s1, 2details
#60.00 s2details
#70.00 s2details
#80.00 s2details
#90.00 s2details

Compiler report

input/code.cpp: In function 'int main()':
input/code.cpp:17:24: warning: comparison of integer expressions of different signedness: 'std::__cxx11::basic_string<char>::size_type' {aka 'long unsigned int'} and '__gnu_cxx::__alloc_traits<std::allocator<char>, char>::value_type' {aka 'char'} [-Wsign-compare]
   17 |         if(s.find('*') == s[s.length()]){
input/code.cpp:21:13: warning: unused variable 'c' [-Wunused-variable]
   21 |         int c;
      |             ^
input/code.cpp:12:10: warning: unused variable 'in' [-Wunused-variable]
   12 |     bool in= false;
      |          ^~
input/code.cpp:38:13: warning: 'a' may be used uninitialized in this function [-Wmaybe-uninitialized]
   38 |     cout << a;
      |             ^

Code

#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
 
using namespace std::chrono;
int main(){
    int n, m;
    cin >> n;
    cin >> m;

    int a;
    bool in= false;
    for (int i = 0; i < m; i++)
    {
        string s;
        cin >> s;
        if(s.find('*') == s[s.length()]){
            continue;
        }
        bool jn = false;
        int c;
        for (int j = 0; j < n; j++)
        {
            if(s[j] == '*' && jn == true){
                break;
            }
            if(s[j] == '*' && jn == false){
                jn = true;
            }
            if(jn){
                a += s[j] == '@';
            }
        }
        
     
        
    }
    cout << a;

}

Test details

Test 1

Group: 1, 2

Verdict:

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

correct output
0

user output
1

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
3

Test 4

Group: 1, 2

Verdict:

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

correct output
11

user output
12

Test 5

Group: 1, 2

Verdict:

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

correct output
64

user output
1

Test 6

Group: 2

Verdict:

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

correct output
60

user output
61

Test 7

Group: 2

Verdict:

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

correct output
1507

user output
1508

Test 8

Group: 2

Verdict:

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

correct output
3348

user output
3349

Test 9

Group: 2

Verdict:

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

correct output
7225

user output
7226