# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
531985 | nguyentunglam | Bitaro the Brave (JOI19_ho_t1) | C++14 | 281 ms | 9168 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>
#define forin(i, a, b) for(int i = a; i <= b; i++)
#define forde(i, a, b) for(int i = a; i >= b; i--)
#define fi first
#define se second
#define ll long long
using namespace std;
const int N = 3e3 + 10;
char a[N][N];
int row[N], col[N];
long long res;
int main()
{
int h, w; cin >> h >> w;
forin(i, 1, h)
{
string s; cin >> s;
forin(j, 0, s.size()-1) a[i][j+1] = s[j];
}
forde(i, h, 1) forde(j, w, 1)
{
if (a[i][j] == 'O') row[i]++;
if (a[i][j] == 'I') col[j]++;
if (a[i][j] == 'J') res +=row[i]*col[j];
}
cout << res;
}
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |