Task: | Lehmät |
Sender: | finnish_guy |
Submission time: | 2022-11-09 20:02:49 +0200 |
Language: | C++ (C++11) |
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 | 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:25:43: warning: 'row' may be used uninitialized in this function [-Wmaybe-uninitialized] 25 | if(mid ==bord && bord == *"*" && row !=i){ | ~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~ input/code.cpp:35:27: warning: 'right' may be used uninitialized in this function [-Wmaybe-uninitialized] 35 | if(j>left && j<right && vec[i][j]==*"@"){ | ~^~~~~~ input/code.cpp:35:17: warning: 'left' may be used uninitialized in this function [-Wmaybe-uninitialized] 35 | if(j>left && j<right && vec[i][j]==*"@"){ | ~^~~~~
Code
#include <iostream> #include <vector> using namespace std; int main(){ int x, y, left, right, count=0, row, count2=0; char s; cin >> x >> y; vector<char>v; vector<vector<char>>vec(x,vector<char> (y)); for(int i = 0; i < x; i++){ for(int j = 0; j < y; j++){ cin >> s; vec[i][j]=s; } } for(int i = 0; i < x; i++){ if(count2==2){break;} for(int j = 0; j < y; j++){ if(count2==2){break;} char bord = vec[i][j]; char mid = vec[i][j+1]; if(mid ==bord && bord == *"*" && row !=i){ left=j; row = i; cout << "Hi" << "\n"; count2 +=1; } if(bord==*"*" && mid != bord && row==i){ right=j; cout << "hi" << "\n"; } if(j>left && j<right && vec[i][j]==*"@"){ count +=1; } } } cout << count << "\n"; }
Test details
Test 1
Group: 1, 2
Verdict: WRONG ANSWER
input |
---|
3 3 *** *.* *** |
correct output |
---|
0 |
user output |
---|
Hi hi Hi 0 |
Test 2
Group: 1, 2
Verdict: WRONG ANSWER
input |
---|
3 3 *** *@* *** |
correct output |
---|
1 |
user output |
---|
Hi hi Hi 1 |
Test 3
Group: 1, 2
Verdict: WRONG ANSWER
input |
---|
5 10 ...@...... ..******.. @.*@@@@*.@ ..******.. ... |
correct output |
---|
4 |
user output |
---|
Hi hi Hi 4 |
Test 4
Group: 1, 2
Verdict: WRONG ANSWER
input |
---|
10 10 @@...@.@@@ ..@@.@@..@ @.*******@ ..*@....*. ... |
correct output |
---|
11 |
user output |
---|
Hi hi Hi 11 |
Test 5
Group: 1, 2
Verdict: WRONG ANSWER
input |
---|
10 10 ********** *@@@@@@@@* *@@@@@@@@* *@@@@@@@@* ... |
correct output |
---|
64 |
user output |
---|
Hi hi Hi 64 |
Test 6
Group: 2
Verdict: WRONG ANSWER
input |
---|
100 100 .........................@....... |
correct output |
---|
60 |
user output |
---|
Hi hi Hi 60 |
Test 7
Group: 2
Verdict: WRONG ANSWER
input |
---|
100 100 ..@@..........@......@....@@..... |
correct output |
---|
1507 |
user output |
---|
Hi hi Hi 1507 |
Test 8
Group: 2
Verdict: WRONG ANSWER
input |
---|
100 100 .@..@@..@@.@..@..@..@@..@..@..... |
correct output |
---|
3348 |
user output |
---|
Hi hi Hi 3348 |
Test 9
Group: 2
Verdict: WRONG ANSWER
input |
---|
100 100 @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@... |
correct output |
---|
7225 |
user output |
---|
Hi hi Hi 7225 |