제출 #208227

#제출 시각아이디문제언어결과실행 시간메모리
208227jzhBitaro the Brave (JOI19_ho_t1)C++14
100 / 100
195 ms13048 KiB
#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';

}

컴파일 시 표준 에러 (stderr) 메시지

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;
                   ^
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...