# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
136745 | hamzqq9 | Bitaro the Brave (JOI19_ho_t1) | C++14 | 168 ms | 88572 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include<bits/stdc++.h>
#define st first
#define nd second
#define pb push_back
#define ppb pop_back
#define ii pair<int,int>
#define ll long long
#define umin(x,y) x=min(x,y)
#define umax(x,y) x=max(x,y)
#define orta ((bas+son)>>1)
#define sz(x) ((int)x.size())
#define all(x) x.begin(),x.end()
#define inf 2000000000
#define N 3005
#define MOD 998244353
using namespace std;
char s[N][N];
int O[N][N],I[N][N];
int main() {
int h,w;
scanf("%d %d",&h,&w);
for(int i=1;i<=h;i++) scanf("%s",s[i]+1);
for(int i=1;i<=h;i++) {
for(int j=1;j<=w;j++) {
O[i][j]=O[i][j-1]+(s[i][j]=='O');
I[i][j]=I[i-1][j]+(s[i][j]=='I');
}
}
ll ans=0;
for(int i=1;i<=h;i++) {
for(int j=1;j<=w;j++) {
if(s[i][j]=='J') {
ans+=(I[h][j]-I[i-1][j])*(O[i][w]-O[i][j-1]);
}
}
}
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... |