# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
197453 | quocnguyen1012 | Bitaro the Brave (JOI19_ho_t1) | C++14 | 218 ms | 18004 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <bits/stdc++.h>
#define fi first
#define se second
#define mp make_pair
#define pb push_back
using namespace std;
typedef long long ll;
const int base = 131;
const int maxn = 3e3 + 5;
int N, M;
char type[maxn][maxn];
int col[maxn];
signed main(void)
{
ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
if (fopen("A.INP", "r")){
freopen("A.INP", "r", stdin);
freopen("A.OUT", "w", stdout);
}
cin >> N >> M;
for (int i = 1; i <= N; ++i){
for (int j = 1; j <= M; ++j){
cin >> type[i][j];
}
}
ll res = 0;
for (int i = N; i >= 1; --i){
int have = 0;
for (int j = M; j >= 1; --j){
if (type[i][j] == 'O'){
++have;
}
else if (type[i][j] == 'I'){
++col[j];
}
else res += 1ll * have * col[j];
}
}
cout << res << '\n';
}
컴파일 시 표준 에러 (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... |