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;
char matrice[3001][3001];
int main ()
{
ios :: sync_with_stdio(false);
cin.tie(NULL); cout.tie(NULL);
int linii , coloane;
cin >> linii >> coloane;
int aparitii[3000] = { };
for (int linie = 0 ; linie < linii ; linie++)
{
cin >> matrice[linie];
for (int coloana = 0 ; coloana < coloane ; coloana++) {
if (matrice[linie][coloana] == 'I')
{ aparitii[coloana]++; }
}
}
int64_t total = 0;
for (int linie = 0 ; linie < linii ; linie++) {
for (int coloana = 0 , termen = 0 ; coloana < coloane ; coloana++) {
if (matrice[linie][coloana] == 'O') { total += termen; }
else if (matrice[linie][coloana] == 'J') { termen += aparitii[coloana]; }
else { aparitii[coloana]--; }
}
}
cout << total;
return 0;
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |