# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
127443 | arnold518 | Bitaro the Brave (JOI19_ho_t1) | C++14 | 392 ms | 88824 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
const int MAXN = 3000;
int N, M, O[MAXN+10][MAXN+10], I[MAXN+10][MAXN+10];
ll ans;
char S[MAXN+10][MAXN+10];
int main()
{
int i, j;
scanf("%d%d", &N, &M);
for(i=1; i<=N; i++) scanf("%s", S[i]+1);
for(j=1; j<=N; j++) for(i=M; i>=1; i--) O[j][i]=O[j][i+1]+(S[j][i]=='O');
for(j=1; j<=M; j++) for(i=N; i>=1; i--) I[i][j]=I[i+1][j]+(S[i][j]=='I');
for(i=1; i<=N; i++) for(j=1; j<=M; j++)
{
if(S[i][j]=='J') ans+=O[i][j]*I[i][j];
}
printf("%lld", ans);
}
컴파일 시 표준 에러 (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... |