제출 #160526

#제출 시각아이디문제언어결과실행 시간메모리
160526dantoh000Bitaro the Brave (JOI19_ho_t1)C++14
100 / 100
552 ms9720 KiB
#include <bits/stdc++.h>
#define int long long
using namespace std;
main(){
    int n,m;
    scanf("%lld%lld",&n,&m);
    char grid[n][m];
    for (int i = 0; i < n; i++){
        for (int j = 0; j < m; j++){
            scanf(" %c",&grid[i][j]);
        }
    }
    int ans = 0;
    int ct[m]; memset(ct,0,sizeof(ct));
    for (int i = n-1; i >= 0; i--){
        int ct2 = 0;
        for (int j = m-1; j >= 0; j--){
            if (grid[i][j] == 'O') ct2++;
            else if (grid[i][j] == 'I') ct[j]++;
            else ans += ct[j]*ct2;
        }
    }
    printf("%lld ",ans);
}

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

joi2019_ho_t1.cpp:4:6: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
 main(){
      ^
joi2019_ho_t1.cpp: In function 'int main()':
joi2019_ho_t1.cpp:6:10: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
     scanf("%lld%lld",&n,&m);
     ~~~~~^~~~~~~~~~~~~~~~~~
joi2019_ho_t1.cpp:10:18: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
             scanf(" %c",&grid[i][j]);
             ~~~~~^~~~~~~~~~~~~~~~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...