Task: | Lehmät |
Sender: | Tipu |
Submission time: | 2022-10-31 09:43:59 +0200 |
Language: | C++ (C++17) |
Status: | READY |
Result: | 0 |
group | verdict | score |
---|---|---|
#1 | WRONG ANSWER | 0 |
#2 | WRONG ANSWER | 0 |
test | verdict | time | group | |
---|---|---|---|---|
#1 | WRONG ANSWER | 0.00 s | 1, 2 | details |
#2 | ACCEPTED | 0.00 s | 1, 2 | details |
#3 | WRONG ANSWER | 0.00 s | 1, 2 | details |
#4 | WRONG ANSWER | 0.01 s | 1, 2 | details |
#5 | WRONG ANSWER | 0.00 s | 1, 2 | details |
#6 | WRONG ANSWER | 0.00 s | 2 | details |
#7 | WRONG ANSWER | 0.00 s | 2 | details |
#8 | WRONG ANSWER | 0.00 s | 2 | details |
#9 | WRONG ANSWER | 0.00 s | 2 | details |
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: WRONG ANSWER
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: WRONG ANSWER
input |
---|
5 10 ...@...... ..******.. @.*@@@@*.@ ..******.. ... |
correct output |
---|
4 |
user output |
---|
3 |
Test 4
Group: 1, 2
Verdict: WRONG ANSWER
input |
---|
10 10 @@...@.@@@ ..@@.@@..@ @.*******@ ..*@....*. ... |
correct output |
---|
11 |
user output |
---|
12 |
Test 5
Group: 1, 2
Verdict: WRONG ANSWER
input |
---|
10 10 ********** *@@@@@@@@* *@@@@@@@@* *@@@@@@@@* ... |
correct output |
---|
64 |
user output |
---|
1 |
Test 6
Group: 2
Verdict: WRONG ANSWER
input |
---|
100 100 .........................@....... |
correct output |
---|
60 |
user output |
---|
61 |
Test 7
Group: 2
Verdict: WRONG ANSWER
input |
---|
100 100 ..@@..........@......@....@@..... |
correct output |
---|
1507 |
user output |
---|
1508 |
Test 8
Group: 2
Verdict: WRONG ANSWER
input |
---|
100 100 .@..@@..@@.@..@..@..@@..@..@..... |
correct output |
---|
3348 |
user output |
---|
3349 |
Test 9
Group: 2
Verdict: WRONG ANSWER
input |
---|
100 100 @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@... |
correct output |
---|
7225 |
user output |
---|
7226 |