# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
994451 | daffuwu | Bitaro the Brave (JOI19_ho_t1) | C++14 | 332 ms | 18104 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <bits/stdc++.h>
using namespace std;
#define fr first
#define sc second
mt19937_64 rng(chrono::steady_clock::now().time_since_epoch().count());
long long ans;
char a[3069][3069];
int cnt[3069][2], h, w; //{idx, row/col}
int main()
{
int i, j;
scanf("%d%d", &h, &w);
for (i=1; i<=h; i++)
{
for (j=1; j<=w; j++) scanf(" %c", &a[i][j]);
}
for (i=h; i>=1; i--)
{
for (j=w; j>=1; j--)
{
if (a[i][j] == 'J') ans += 1ll*cnt[i][0]*cnt[j][1];
else if (a[i][j] == 'O') cnt[i][0]++;
else cnt[j][1]++;
}
}
printf("%lld\n", 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... |