답안 #646905

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
646905 2022-10-01T00:28:13 Z Olson Bitaro the Brave (JOI19_ho_t1) C++17
20 / 100
9 ms 4664 KB
#include<bits/stdc++.h>
using namespace std;
using ll = long long;

int main(){
    int h,w;cin>>h>>w;
    ll pso[h+1][w+1];
    ll psi[h+1][w+1];
    for(int i=0; i<=h; i++)psi[i][0]=0;
    for(int i=0; i<=w; i++)pso[0][i]=0;
    string s[h];
    for(int i=0; i<h; i++)cin>>s[i];
    for(int i=1; i<=h; i++){
        for(int j=1; j<=w; j++){
            psi[i][j]=psi[i-1][j];
            pso[i][j]=pso[i][j-1];
            if(s[i-1][j-1]=='I')psi[i][j]++;
            if(s[i-1][j-1]=='O')pso[i][j]++;
        }
    }
    int ans=0;
    for(int i=1; i<=h; i++){
        for(int j=1; j<=w; j++){
            if(s[i-1][j-1]=='J'){
                int m = psi[h][j]-psi[i][j];
                int n = pso[i][w]-pso[i][j];
                ans+=m*n;
            }
        }
    }
    cout<<ans<<endl;
}
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 212 KB Output is correct
2 Correct 1 ms 212 KB Output is correct
3 Correct 1 ms 212 KB Output is correct
4 Correct 0 ms 212 KB Output is correct
5 Correct 1 ms 468 KB Output is correct
6 Correct 1 ms 340 KB Output is correct
7 Correct 1 ms 340 KB Output is correct
8 Correct 1 ms 468 KB Output is correct
9 Correct 1 ms 340 KB Output is correct
10 Correct 1 ms 340 KB Output is correct
11 Correct 1 ms 468 KB Output is correct
12 Correct 1 ms 340 KB Output is correct
13 Correct 1 ms 340 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 212 KB Output is correct
2 Correct 1 ms 212 KB Output is correct
3 Correct 1 ms 212 KB Output is correct
4 Correct 0 ms 212 KB Output is correct
5 Correct 1 ms 468 KB Output is correct
6 Correct 1 ms 340 KB Output is correct
7 Correct 1 ms 340 KB Output is correct
8 Correct 1 ms 468 KB Output is correct
9 Correct 1 ms 340 KB Output is correct
10 Correct 1 ms 340 KB Output is correct
11 Correct 1 ms 468 KB Output is correct
12 Correct 1 ms 340 KB Output is correct
13 Correct 1 ms 340 KB Output is correct
14 Correct 8 ms 3540 KB Output is correct
15 Correct 0 ms 340 KB Output is correct
16 Correct 5 ms 2516 KB Output is correct
17 Correct 0 ms 340 KB Output is correct
18 Correct 9 ms 4664 KB Output is correct
19 Correct 8 ms 4300 KB Output is correct
20 Incorrect 7 ms 4564 KB Output isn't correct
21 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 212 KB Output is correct
2 Correct 1 ms 212 KB Output is correct
3 Correct 1 ms 212 KB Output is correct
4 Correct 0 ms 212 KB Output is correct
5 Correct 1 ms 468 KB Output is correct
6 Correct 1 ms 340 KB Output is correct
7 Correct 1 ms 340 KB Output is correct
8 Correct 1 ms 468 KB Output is correct
9 Correct 1 ms 340 KB Output is correct
10 Correct 1 ms 340 KB Output is correct
11 Correct 1 ms 468 KB Output is correct
12 Correct 1 ms 340 KB Output is correct
13 Correct 1 ms 340 KB Output is correct
14 Correct 8 ms 3540 KB Output is correct
15 Correct 0 ms 340 KB Output is correct
16 Correct 5 ms 2516 KB Output is correct
17 Correct 0 ms 340 KB Output is correct
18 Correct 9 ms 4664 KB Output is correct
19 Correct 8 ms 4300 KB Output is correct
20 Incorrect 7 ms 4564 KB Output isn't correct
21 Halted 0 ms 0 KB -