# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
210478 | gratus907 | Bitaro the Brave (JOI19_ho_t1) | C++17 | 254 ms | 160376 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <bits/stdc++.h>
using namespace std;
#define ll long long
#pragma GCC optimize("O3")
#pragma GCC optimize("Ofast")
#pragma GCC target("avx,avx2,fma")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
#define usecppio ios::sync_with_stdio(0);cin.tie(0);cout.tie(0);
#define all(x) ((x).begin()),((x).end())
#define int ll
using pii = pair<int, int>;
#define INF 0x7f7f7f7f7f7f7f7f
const bool debug = false;
char arrange[3030][3030];
int orb[3030][3030];
int ingot[3030][3030];
int h, w;
int32_t main()
{
scanf("%lld %lld",&h, &w);
for (int i = 1; i<=h; i++)
scanf("%s",arrange[i]+1);
for (int i = 1; i<=h; i++)
{
for (int j = 1; j<=w; j++)
{
if (arrange[i][j]=='O')
orb[i][j]++;
else if (arrange[i][j]=='I')
ingot[i][j]++;
}
}
for (int i = 1; i<=h; i++)
{
for (int j = w-1; j>=1; j--)
{
orb[i][j] += orb[i][j+1];
}
}
for (int i = 1; i<=w; i++)
{
for (int j = h-1; j>=1; j--)
{
ingot[j][i] += ingot[j+1][i];
}
}
int ans = 0;
for (int i = 1; i<=h; i++)
for (int j = 1; j<=w; j++)
if (arrange[i][j]=='J')
ans += orb[i][j+1]*ingot[i+1][j];
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... |