# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
529932 | scottchou | Bitaro the Brave (JOI19_ho_t1) | C++17 | 537 ms | 17920 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include<iostream>
using namespace std;
int const N = 3e3 + 5;
typedef long long LL;
char a[N][N];
LL icnt[N];
int main(){
int n, m;
cin >> n >> m;
for(int i = 0; i < n; i++){
for(int j = 0; j < m; j++){
cin >> a[i][j];
}
}
LL ans = 0;
for(int i = n - 1; i >= 0; i--){
LL ocnt = 0;
for(int j = m - 1; j >= 0; j--){
if(a[i][j] == 'J'){
ans += icnt[j] * ocnt;
}else if(a[i][j] == 'I'){
icnt[j]++;
}else{
ocnt++;
}
}
}
cout << ans << '\n';
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |