# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
588303 | n_m_p | Bitaro the Brave (JOI19_ho_t1) | C++17 | 224 ms | 159628 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include<bits/stdc++.h>
#define int long long
#define endl '\n'
#define fast ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
#define infi INT_MAX
#define rinfi INT_MIN
#define inf LLONG_MAX
#define rinf LLONG_MIN
#define ff first
#define ss second
#ifdef LOCAL
#include"debug.h"
#else
#define line
#define debug(x...)
#endif
using namespace std;
main()
{
fast
int tc=1,i,j,k;
//cin>>tc;
while(tc--)
{
int a,b;
cin>>a>>b;
string s[a];
for(i=0;i<a;i++)
cin>>s[i];
int r[a][b],c[a][b];
for(i=0;i<a;i++)
{
for(j=0;j<b;j++)
{
r[i][j]=c[i][j]=0;
if(s[i][j]=='I')
{
r[i][j]=1;
}
if(s[i][j]=='O')
{
c[i][j]=1;
}
}
}
for(i=0;i<a;i++)
{
for(j=b-2;j>=0;j--)
{
c[i][j]+=c[i][j+1];
}
}
for(i=a-2;i>=0;i--)
{
for(j=0;j<b;j++)
{
r[i][j]+=r[i+1][j];
}
}
int ans=0;
for(i=0;i<a;i++)
{
for(j=0;j<b;j++)
{
if(s[i][j]=='J')
{
ans+=(r[i][j]*c[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... |