ამოხსნების სტატუსი

ამ გვერდზე თქვენ იხილავთ გაგზავნილი ამოხსნების სტატუსს.


გაგზავნის თარიღი: 13.09.2021 16:36:03

ამოცანა: გუბურების დათვლა

მომხმარებელი: SSHH

ვერდიქტი: ამოუხსნელი

შეფასება: 0 ქულა







#include <bits/stdc++.h>

int main(){
    int n, m;
    cin >> n >> m;
    int mp1 = m + 1;
    int count = 0;
    char c = 0;
    bool *last = malloc(mp2);
    bool *curr = malloc(mp2);
    
    for(int i = 0; i < mp2; i++){
        last[i] = 0;
        curr[i] = 0;
    }
    
    for(int i = 0; i < n; i++){
        for(int j = 1; j < mp1; j++){
            cin.get(&c);
            if(c == 'W'){
                curr[j] = 1;
                if(curr[j - 1] || last[j - 1] || last[j] || last[j + 1]){
                    
                }else{
                    count++;
                }
            }
        }
    }
    cout << count << endl;
    free(last);
    free(curr);
    return 0;
}
PROB_cpp_UID2638PID262_696a5d/main.cpp: In function 'int main()':
PROB_cpp_UID2638PID262_696a5d/main.cpp:5:5: error: 'cin' was not declared in this scope
     cin >> n >> m;
     ^~~
PROB_cpp_UID2638PID262_696a5d/main.cpp:5:5: note: suggested alternative:
In file included from /usr/include/x86_64-linux-gnu/c++/6/bits/stdc++.h:75:0,
                 from PROB_cpp_UID2638PID262_696a5d/main.cpp:1:
/usr/include/c++/6/iostream:60:18: note:   'std::cin'
   extern istream cin;  /// Linked to standard input
                  ^~~
PROB_cpp_UID2638PID262_696a5d/main.cpp:9:25: error: 'mp2' was not declared in this scope
     bool *last = malloc(mp2);
                         ^~~
PROB_cpp_UID2638PID262_696a5d/main.cpp:30:5: error: 'cout' was not declared in this scope
     cout << count << endl;
     ^~~~
PROB_cpp_UID2638PID262_696a5d/main.cpp:30:5: note: suggested alternative:
In file included from /usr/include/x86_64-linux-gnu/c++/6/bits/stdc++.h:75:0,
                 from PROB_cpp_UID2638PID262_696a5d/main.cpp:1:
/usr/include/c++/6/iostream:61:18: note:   'std::cout'
   extern ostream cout;  /// Linked to standard output
                  ^~~~
PROB_cpp_UID2638PID262_696a5d/main.cpp:30:22: error: 'endl' was not declared in this scope
     cout << count << endl;
                      ^~~~
PROB_cpp_UID2638PID262_696a5d/main.cpp:30:22: note: suggested alternative:
In file included from /usr/include/c++/6/istream:39:0,
                 from /usr/include/c++/6/sstream:38,
                 from /usr/include/c++/6/complex:45,
                 from /usr/include/c++/6/ccomplex:39,
                 from /usr/include/x86_64-linux-gnu/c++/6/bits/stdc++.h:52,
                 from PROB_cpp_UID2638PID262_696a5d/main.cpp:1:
/usr/include/c++/6/ostream:590:5: note:   'std::endl'
     endl(basic_ostream<_CharT, _Traits>& __os)
     ^~~~