# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
529338 | smth | Bitaro the Brave (JOI19_ho_t1) | C++14 | 315 ms | 180036 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include<iostream>
#define endl '\n'
using namespace std;
char s[5005][5005];
long long row[5005][5005], col[5005][5005];
int main()
{
ios::sync_with_stdio(0);
cin.tie(0);
cin.tie(0);
long long n,h,w,i,j;
cin>>h>>w;
for(i=0;i<h;i++)
{
for(j=0;j<w;j++)
{
cin>>s[i][j];
if(s[i][j]=='O')row[i][j]=1;
if(s[i][j]=='I')col[i][j]=1;
}
}
for(i=h-1;i>=0;i--)
{
for(j=w-1;j>=0;j--)
{
col[i][j]+=col[i+1][j];
row[i][j]+=row[i][j+1];
}
}
long long ans=0;
for(i=h-1;i>=0;i--)
{
for(j=w-1;j>=0;j--)
{
if(s[i][j]=='J')ans+=col[i][j]*row[i][j];
}
}
cout<<ans<<endl;
}
컴파일 시 표준 에러 (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... |