답안 #102275

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
102275 2019-03-24T05:14:51 Z onjo0127 Bitaro the Brave (JOI19_ho_t1) C++11
100 / 100
809 ms 18040 KB
#include <bits/stdc++.h>
using namespace std;

char A[3009][3009];
int se[3009], ga[3009];

int main() {
    int H, W; scanf("%d%d",&H,&W);
    for(int i=1; i<=H; i++) {
        for(int j=1; j<=W; j++) {
            scanf(" %c",&A[i][j]);
        }
    }
    long long ans = 0;
    for(int i=H; i>=1; i--) {
        for(int j=W; j>=1; j--) {
            if(A[i][j] == 'J') ans += se[j] * ga[i];
            if(A[i][j] == 'I') ++se[j];
            if(A[i][j] == 'O') ++ga[i];
        }
    }
    printf("%lld",ans);
    return 0;
}

Compilation message

joi2019_ho_t1.cpp: In function 'int main()':
joi2019_ho_t1.cpp:8:20: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
     int H, W; scanf("%d%d",&H,&W);
               ~~~~~^~~~~~~~~~~~~~
joi2019_ho_t1.cpp:11:18: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
             scanf(" %c",&A[i][j]);
             ~~~~~^~~~~~~~~~~~~~~~
# 결과 실행 시간 메모리 Grader output
1 Correct 2 ms 384 KB Output is correct
2 Correct 2 ms 384 KB Output is correct
3 Correct 2 ms 256 KB Output is correct
4 Correct 2 ms 384 KB Output is correct
5 Correct 2 ms 640 KB Output is correct
6 Correct 3 ms 640 KB Output is correct
7 Correct 4 ms 512 KB Output is correct
8 Correct 2 ms 640 KB Output is correct
9 Correct 3 ms 640 KB Output is correct
10 Correct 2 ms 640 KB Output is correct
11 Correct 3 ms 640 KB Output is correct
12 Correct 3 ms 640 KB Output is correct
13 Correct 3 ms 640 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 2 ms 384 KB Output is correct
2 Correct 2 ms 384 KB Output is correct
3 Correct 2 ms 256 KB Output is correct
4 Correct 2 ms 384 KB Output is correct
5 Correct 2 ms 640 KB Output is correct
6 Correct 3 ms 640 KB Output is correct
7 Correct 4 ms 512 KB Output is correct
8 Correct 2 ms 640 KB Output is correct
9 Correct 3 ms 640 KB Output is correct
10 Correct 2 ms 640 KB Output is correct
11 Correct 3 ms 640 KB Output is correct
12 Correct 3 ms 640 KB Output is correct
13 Correct 3 ms 640 KB Output is correct
14 Correct 14 ms 1920 KB Output is correct
15 Correct 3 ms 1536 KB Output is correct
16 Correct 14 ms 1152 KB Output is correct
17 Correct 3 ms 384 KB Output is correct
18 Correct 20 ms 2048 KB Output is correct
19 Correct 17 ms 1912 KB Output is correct
20 Correct 17 ms 1920 KB Output is correct
21 Correct 22 ms 1920 KB Output is correct
22 Correct 26 ms 1912 KB Output is correct
23 Correct 16 ms 1920 KB Output is correct
24 Correct 17 ms 1920 KB Output is correct
25 Correct 16 ms 1920 KB Output is correct
26 Correct 22 ms 2048 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 2 ms 384 KB Output is correct
2 Correct 2 ms 384 KB Output is correct
3 Correct 2 ms 256 KB Output is correct
4 Correct 2 ms 384 KB Output is correct
5 Correct 2 ms 640 KB Output is correct
6 Correct 3 ms 640 KB Output is correct
7 Correct 4 ms 512 KB Output is correct
8 Correct 2 ms 640 KB Output is correct
9 Correct 3 ms 640 KB Output is correct
10 Correct 2 ms 640 KB Output is correct
11 Correct 3 ms 640 KB Output is correct
12 Correct 3 ms 640 KB Output is correct
13 Correct 3 ms 640 KB Output is correct
14 Correct 14 ms 1920 KB Output is correct
15 Correct 3 ms 1536 KB Output is correct
16 Correct 14 ms 1152 KB Output is correct
17 Correct 3 ms 384 KB Output is correct
18 Correct 20 ms 2048 KB Output is correct
19 Correct 17 ms 1912 KB Output is correct
20 Correct 17 ms 1920 KB Output is correct
21 Correct 22 ms 1920 KB Output is correct
22 Correct 26 ms 1912 KB Output is correct
23 Correct 16 ms 1920 KB Output is correct
24 Correct 17 ms 1920 KB Output is correct
25 Correct 16 ms 1920 KB Output is correct
26 Correct 22 ms 2048 KB Output is correct
27 Correct 627 ms 17588 KB Output is correct
28 Correct 8 ms 7168 KB Output is correct
29 Correct 36 ms 1656 KB Output is correct
30 Correct 4 ms 384 KB Output is correct
31 Correct 404 ms 14024 KB Output is correct
32 Correct 573 ms 17916 KB Output is correct
33 Correct 503 ms 17816 KB Output is correct
34 Correct 419 ms 16024 KB Output is correct
35 Correct 498 ms 17796 KB Output is correct
36 Correct 528 ms 18040 KB Output is correct
37 Correct 809 ms 17920 KB Output is correct
38 Correct 524 ms 13688 KB Output is correct
39 Correct 335 ms 13692 KB Output is correct