Submission #1258758

#TimeUsernameProblemLanguageResultExecution timeMemory
1258758khanhanBitaro the Brave (JOI19_ho_t1)C++20
Compilation error
0 ms0 KiB
#include <bits/stdc++.h>
using namespace std;

int main() {
    ios::sync_with_stdio(false);
    cin.tie(nullptr);

    int h, w;
    cin >> h >> w;
    vector<string> a(h);
    for (int i = 0; i < h; i++) {
        cin >> a[i];
    }

    long long ans = 0;

     
    for (int i = 0; i < h; i++) {
        for (int k = i + 1; k < h; k++) {
             
            vector<int> demO(w + 1, 0);
            for (int j = w - 1; j >= 0; j--) {
                dem[j] = demO[j + 1] + (a[i][j] == 'O');
            }

            for (int j = 0; j < w; j++) {
                if (a[i][j] == 'J' && a[k][j] == 'I') {
                    ans += demO[j + 1];
                }
            }
        }
    }

    cout << ans << "\n";
    return 0;
}

Compilation message (stderr)

joi2019_ho_t1.cpp: In function 'int main()':
joi2019_ho_t1.cpp:23:17: error: 'dem' was not declared in this scope; did you mean 'demO'?
   23 |                 dem[j] = demO[j + 1] + (a[i][j] == 'O');
      |                 ^~~
      |                 demO