제출 #146438

#제출 시각아이디문제언어결과실행 시간메모리
146438achibasadzishvili미술 수업 (IOI13_artclass)C++14
컴파일 에러
0 ms0 KiB
#include<bits/stdc++.h>
#include "artclass.h"
#define ll int
#define f first
#define s second
#define pb push_back
using namespace std;
long long pp = 0;
intstyle(int n,int m,int r[500][500],int g[500][500],int b[500][500]);{
    for(int i=0; i<n; i++)
        for(int j=0; j<m; j++)
            for(int x=-1; x<=1; x++)
                for(int y=-1; y<=1; y++)
                    if(i + x >= 0 && i + x < n && j + y >= 0 && j + y < m){
                        pp += abs(r[i][j] - r[i + x][j + y]) * abs(g[i][j] - g[i + x][j + y]) *
                        abs(b[i][j] - b[i + x][j + y]);
                    }
    // style 1 = 70726740182
    // style 2 = 20327879800
    // style 3 = 204620797406
    // style 4 = 476357764
    vector<ll>v;
    v.pb(70726740182);
    v.pb(20327879800);
    v.pb(204620797406);
    v.pb(476357764);
    ll mn = 100000000000000;
    int ret;
    for(int i=0; i<v.size(); i++){
        if(abs(v[i] - pp) < mn){
            mn = abs(v[i] - pp);
            ret = i + 1;
        }
    }
    return ret;
}
int main(){
    cin >> n >> m;
    
    for(int i=0; i<n; i++)
        for(int j=0; j<m; j++)
            cin >> r[i][j] >> g[i][j] >> b[i][j];
    
    style();
    
    
    
    return 0;
}

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

artclass.cpp:9:70: error: stray '\315' in program
 intstyle(int n,int m,int r[500][500],int g[500][500],int b[500][500]);{
                                                                      ^
artclass.cpp:9:71: error: stray '\276' in program
 intstyle(int n,int m,int r[500][500],int g[500][500],int b[500][500]);{
                                                                       ^
artclass.cpp:9:69: error: ISO C++ forbids declaration of 'intstyle' with no type [-fpermissive]
 intstyle(int n,int m,int r[500][500],int g[500][500],int b[500][500]);{
                                                                     ^
artclass.cpp: In function 'int intstyle(int, int, int (*)[500], int (*)[500], int (*)[500])':
artclass.cpp:23:21: warning: overflow in implicit constant conversion [-Woverflow]
     v.pb(70726740182);
                     ^
artclass.cpp:24:21: warning: overflow in implicit constant conversion [-Woverflow]
     v.pb(20327879800);
                     ^
artclass.cpp:25:22: warning: overflow in implicit constant conversion [-Woverflow]
     v.pb(204620797406);
                      ^
artclass.cpp:27:13: warning: overflow in implicit constant conversion [-Woverflow]
     ll mn = 100000000000000;
             ^~~~~~~~~~~~~~~
artclass.cpp:29:19: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
     for(int i=0; i<v.size(); i++){
                  ~^~~~~~~~~
artclass.cpp: In function 'int main()':
artclass.cpp:38:12: error: 'n' was not declared in this scope
     cin >> n >> m;
            ^
artclass.cpp:38:12: note: suggested alternative: 'yn'
     cin >> n >> m;
            ^
            yn
artclass.cpp:38:17: error: 'm' was not declared in this scope
     cin >> n >> m;
                 ^
artclass.cpp:38:17: note: suggested alternative: 'tm'
     cin >> n >> m;
                 ^
                 tm
artclass.cpp:42:20: error: 'r' was not declared in this scope
             cin >> r[i][j] >> g[i][j] >> b[i][j];
                    ^
artclass.cpp:42:31: error: 'g' was not declared in this scope
             cin >> r[i][j] >> g[i][j] >> b[i][j];
                               ^
artclass.cpp:42:42: error: 'b' was not declared in this scope
             cin >> r[i][j] >> g[i][j] >> b[i][j];
                                          ^
artclass.cpp:44:11: error: too few arguments to function 'int style(int, int, int (*)[500], int (*)[500], int (*)[500])'
     style();
           ^
In file included from artclass.cpp:2:0:
artclass.h:8:5: note: declared here
 int style(int H, int W, int R[500][500], int G[500][500], int B[500][500]);
     ^~~~~