| # | Time | Username | Problem | Language | Result | Execution time | Memory |
|---|---|---|---|---|---|---|---|
| 499595 | Marceantasy | Bitaro the Brave (JOI19_ho_t1) | C++17 | 76 ms | 21952 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 <bits/stdc++.h>
using namespace std;
#define ll long long
#define ar array
const int mxN = 1e5+1, M = 1e9+7;
int n, m, a[mxN];
string s[mxN];
int main(){
#ifdef _DEBUG
// freopen("input.txt", "r", stdin);
// freopen("output.txt", "w", stdout);
#endif
std::ios_base::sync_with_stdio(false); std::cin.tie(0); std::cout.tie(0);
cin >> n >> m;
for(int i = 0; i<n; ++i){
cin >> s[i];
}
ll ans = 0;
for(int i = n-1; i>=0; --i){
int b = 0;
for(int j = m-1; j>=0; --j){
if(s[i][j] == 'J'){
ans += a[j]*b;
}else if(s[i][j] == 'O'){
b++;
}else{
a[j]++;
}
}
}
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... | ||||
