Task: | Lehmät |
Sender: | Tipu |
Submission time: | 2022-10-31 10:00:34 +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 | ACCEPTED | 0.00 s | 1, 2 | details |
#2 | WRONG ANSWER | 0.00 s | 1, 2 | details |
#3 | WRONG ANSWER | 0.00 s | 1, 2 | details |
#4 | WRONG ANSWER | 0.00 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:13:10: warning: unused variable 'in' [-Wunused-variable] 13 | bool in = false; | ^~ input/code.cpp:7:12: warning: ignoring return value of 'FILE* freopen(const char*, const char*, FILE*)' declared with attribute 'warn_unused_result' [-Wunused-result] 7 | freopen("input.txt", "r", stdin); | ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~
Code
#include<bits/stdc++.h> using namespace std; typedef long long ll; using namespace std::chrono; int main(){ freopen("input.txt", "r", stdin); int n, m; cin >> n; cin >> m; int a = 0; bool in = false; for (int i = 0; i < n; i++) { string s; cin >> s; if(s.find('*') == s.npos){ continue; } bool jn = false; for (int j = 0; j < m; j++) { if(s[j] == '*' && jn == true){ // cout << s[j] << "(" << i << "," << j << ")"; break; } if(s[j] == '*' && jn == false){ jn = true; } if(jn && s[j] == '@'){ a += 1; } } } cout << a; }
Test details
Test 1
Group: 1, 2
Verdict: ACCEPTED
input |
---|
3 3 *** *.* *** |
correct output |
---|
0 |
user output |
---|
0 |
Test 2
Group: 1, 2
Verdict: WRONG ANSWER
input |
---|
3 3 *** *@* *** |
correct output |
---|
1 |
user output |
---|
0 |
Test 3
Group: 1, 2
Verdict: WRONG ANSWER
input |
---|
5 10 ...@...... ..******.. @.*@@@@*.@ ..******.. ... |
correct output |
---|
4 |
user output |
---|
0 |
Test 4
Group: 1, 2
Verdict: WRONG ANSWER
input |
---|
10 10 @@...@.@@@ ..@@.@@..@ @.*******@ ..*@....*. ... |
correct output |
---|
11 |
user output |
---|
0 |
Test 5
Group: 1, 2
Verdict: WRONG ANSWER
input |
---|
10 10 ********** *@@@@@@@@* *@@@@@@@@* *@@@@@@@@* ... |
correct output |
---|
64 |
user output |
---|
0 |
Test 6
Group: 2
Verdict: WRONG ANSWER
input |
---|
100 100 .........................@....... |
correct output |
---|
60 |
user output |
---|
0 |
Test 7
Group: 2
Verdict: WRONG ANSWER
input |
---|
100 100 ..@@..........@......@....@@..... |
correct output |
---|
1507 |
user output |
---|
0 |
Test 8
Group: 2
Verdict: WRONG ANSWER
input |
---|
100 100 .@..@@..@@.@..@..@..@@..@..@..... |
correct output |
---|
3348 |
user output |
---|
0 |
Test 9
Group: 2
Verdict: WRONG ANSWER
input |
---|
100 100 @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@... |
correct output |
---|
7225 |
user output |
---|
0 |