Submission #765432

# Submission time Handle Problem Language Result Execution time Memory
765432 2023-06-24T13:13:07 Z LinkedArray Bitaro the Brave (JOI19_ho_t1) C++17
0 / 100
1 ms 340 KB
#include <bits/stdc++.h>
using namespace std;

const int MAXH = 3000;

string v[MAXH];
int ingots[MAXH];

int main() {
    ios_base::sync_with_stdio(false);
    cin.tie(0);

    int h, w, i, j, orbs;
    long long ans;  
    cin >> h >> w;

    for(i = 0; i < h; i++){
        cin >> v[i];
    }
    ans = 0;
    for(i = h - 1; i >= 0; i--){
        orbs = 0;
        for(j = w - 1; j >= 0; j--){
            switch(v[i][j]){
                case 'O':
                    ++orbs;
                    break;
                case 'I':
                    ++ingots[i];
                    break;
                case 'J':
                    ans += 1LL * orbs * ingots[i];
                    break;
            }
        }
    }
    cout << ans;
    return 0;
}
# Verdict Execution time Memory Grader output
1 Correct 1 ms 340 KB Output is correct
2 Incorrect 1 ms 340 KB Output isn't correct
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 1 ms 340 KB Output is correct
2 Incorrect 1 ms 340 KB Output isn't correct
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 1 ms 340 KB Output is correct
2 Incorrect 1 ms 340 KB Output isn't correct
3 Halted 0 ms 0 KB -