답안 #208227

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
208227 2020-03-10T10:53:16 Z jzh Bitaro the Brave (JOI19_ho_t1) C++14
100 / 100
195 ms 13048 KB
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
int main() {
    ios_base::sync_with_stdio(0);
    cin.tie(0);
    ll h,w,i,i1,x,y,sum=0;
    cin>>h>>w;
    ll orbs[h],ingots[w];
    for (i=0;i<h;i++)orbs[i]=0;
    for (i=0;i<w;i++)ingots[i]=0;
    char arr[h][w];
    for (i=0;i<h;i++){
        for (i1=0;i1<w;i1++){
            cin>>arr[i][i1];
        }
    }
    for (i=h-1;i>=0;i--){
        for (i1=w-1;i1>=0;i1--){
            char c;
            c=arr[i][i1];
            if (c=='J'){
                sum+=ingots[i1]*orbs[i];
            }
            else if (c=='O'){
                orbs[i]++;
            }
            else {
                ingots[i1]++;
            }
        }
    }
    cout<<sum<<'\n';

}

Compilation message

joi2019_ho_t1.cpp: In function 'int main()':
joi2019_ho_t1.cpp:7:17: warning: unused variable 'x' [-Wunused-variable]
     ll h,w,i,i1,x,y,sum=0;
                 ^
joi2019_ho_t1.cpp:7:19: warning: unused variable 'y' [-Wunused-variable]
     ll h,w,i,i1,x,y,sum=0;
                   ^
# 결과 실행 시간 메모리 Grader output
1 Correct 5 ms 376 KB Output is correct
2 Correct 5 ms 376 KB Output is correct
3 Correct 4 ms 376 KB Output is correct
4 Correct 5 ms 376 KB Output is correct
5 Correct 5 ms 376 KB Output is correct
6 Correct 5 ms 376 KB Output is correct
7 Correct 5 ms 248 KB Output is correct
8 Correct 5 ms 376 KB Output is correct
9 Correct 5 ms 376 KB Output is correct
10 Correct 5 ms 396 KB Output is correct
11 Correct 5 ms 376 KB Output is correct
12 Correct 5 ms 376 KB Output is correct
13 Correct 6 ms 376 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 5 ms 376 KB Output is correct
2 Correct 5 ms 376 KB Output is correct
3 Correct 4 ms 376 KB Output is correct
4 Correct 5 ms 376 KB Output is correct
5 Correct 5 ms 376 KB Output is correct
6 Correct 5 ms 376 KB Output is correct
7 Correct 5 ms 248 KB Output is correct
8 Correct 5 ms 376 KB Output is correct
9 Correct 5 ms 376 KB Output is correct
10 Correct 5 ms 396 KB Output is correct
11 Correct 5 ms 376 KB Output is correct
12 Correct 5 ms 376 KB Output is correct
13 Correct 6 ms 376 KB Output is correct
14 Correct 9 ms 756 KB Output is correct
15 Correct 5 ms 376 KB Output is correct
16 Correct 7 ms 632 KB Output is correct
17 Correct 5 ms 376 KB Output is correct
18 Correct 10 ms 888 KB Output is correct
19 Correct 8 ms 760 KB Output is correct
20 Correct 9 ms 760 KB Output is correct
21 Correct 10 ms 760 KB Output is correct
22 Correct 9 ms 760 KB Output is correct
23 Correct 9 ms 760 KB Output is correct
24 Correct 10 ms 760 KB Output is correct
25 Correct 9 ms 760 KB Output is correct
26 Correct 8 ms 760 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 5 ms 376 KB Output is correct
2 Correct 5 ms 376 KB Output is correct
3 Correct 4 ms 376 KB Output is correct
4 Correct 5 ms 376 KB Output is correct
5 Correct 5 ms 376 KB Output is correct
6 Correct 5 ms 376 KB Output is correct
7 Correct 5 ms 248 KB Output is correct
8 Correct 5 ms 376 KB Output is correct
9 Correct 5 ms 376 KB Output is correct
10 Correct 5 ms 396 KB Output is correct
11 Correct 5 ms 376 KB Output is correct
12 Correct 5 ms 376 KB Output is correct
13 Correct 6 ms 376 KB Output is correct
14 Correct 9 ms 756 KB Output is correct
15 Correct 5 ms 376 KB Output is correct
16 Correct 7 ms 632 KB Output is correct
17 Correct 5 ms 376 KB Output is correct
18 Correct 10 ms 888 KB Output is correct
19 Correct 8 ms 760 KB Output is correct
20 Correct 9 ms 760 KB Output is correct
21 Correct 10 ms 760 KB Output is correct
22 Correct 9 ms 760 KB Output is correct
23 Correct 9 ms 760 KB Output is correct
24 Correct 10 ms 760 KB Output is correct
25 Correct 9 ms 760 KB Output is correct
26 Correct 8 ms 760 KB Output is correct
27 Correct 184 ms 12536 KB Output is correct
28 Correct 5 ms 376 KB Output is correct
29 Correct 15 ms 1656 KB Output is correct
30 Correct 5 ms 376 KB Output is correct
31 Correct 135 ms 10488 KB Output is correct
32 Correct 151 ms 12920 KB Output is correct
33 Correct 146 ms 13032 KB Output is correct
34 Correct 159 ms 11384 KB Output is correct
35 Correct 150 ms 12956 KB Output is correct
36 Correct 139 ms 12920 KB Output is correct
37 Correct 195 ms 13048 KB Output is correct
38 Correct 125 ms 10360 KB Output is correct
39 Correct 100 ms 10376 KB Output is correct