답안 #767982

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
767982 2023-06-27T10:38:13 Z Ahmed57 미술 수업 (IOI13_artclass) C++17
컴파일 오류
0 ms 0 KB
#include "artclass.h"
#include<bits/stdc++.h>

using namespace std;
int style(int H,int W,
int R[500][500],int G[500][500],int B[500][500]){
    for(int i = 0;i<H;i++){
        for(int j = 1;j<W;j++){
            all+=abs(R[i][j]-R[i][j-1]);
            all+=abs(G[i][j]-G[i][j-1]);
            all+=abs(B[i][j]-B[i][j-1]);
        }
    }
    if(all<10)return 4;
    else if(all<=30)return 3
    else if(all<=50)return 2;
    else return 1;
}

Compilation message

artclass.cpp: In function 'int style(int, int, int (*)[500], int (*)[500], int (*)[500])':
artclass.cpp:9:13: error: 'all' was not declared in this scope; did you mean 'std::filesystem::perms::all'?
    9 |             all+=abs(R[i][j]-R[i][j-1]);
      |             ^~~
      |             std::filesystem::perms::all
In file included from /usr/include/c++/10/filesystem:44,
                 from /usr/include/x86_64-linux-gnu/c++/10/bits/stdc++.h:129,
                 from artclass.cpp:2:
/usr/include/c++/10/bits/fs_fwd.h:148:7: note: 'std::filesystem::perms::all' declared here
  148 |       all  =  0777,
      |       ^~~
artclass.cpp:14:8: error: 'all' was not declared in this scope; did you mean 'std::filesystem::perms::all'?
   14 |     if(all<10)return 4;
      |        ^~~
      |        std::filesystem::perms::all
In file included from /usr/include/c++/10/filesystem:44,
                 from /usr/include/x86_64-linux-gnu/c++/10/bits/stdc++.h:129,
                 from artclass.cpp:2:
/usr/include/c++/10/bits/fs_fwd.h:148:7: note: 'std::filesystem::perms::all' declared here
  148 |       all  =  0777,
      |       ^~~
artclass.cpp:15:29: error: expected ';' before 'else'
   15 |     else if(all<=30)return 3
      |                             ^
      |                             ;
   16 |     else if(all<=50)return 2;
      |     ~~~~                     
artclass.cpp:18:1: warning: control reaches end of non-void function [-Wreturn-type]
   18 | }
      | ^