Submission #123103

#TimeUsernameProblemLanguageResultExecution timeMemory
123103MAMBAArt Class (IOI13_artclass)C++17
Compilation error
0 ms0 KiB
#include <bits/stdc++.h> #include "artclass.h" using namespace std; #define rep(i , j , k) for (int i = j; i < k; i++) double sq(double x) { return x * x; } inline double D(vector<int> a, vector<int> b) { return sqrt((sq(a[0] - b[0]) + sq(a[1] - b[1]) + sq(a[2] - b[2])) / 3.0); } int dx[7] = {0 , 0 , 1 , 1 , 1 , 2 , 2}; int dy[7] = {1 , 2 , 0 , 1 , 2 , 0 , 1}; int style(int H , int W , int R[500][500], int G[500][500], int B[500][500]) { double dist = 0; rep(i , 0 , H) rep(j , 0 , W) dist += D({R[i][j] , G[i][j] , B[i][j]} , {0 , 255 , 0}); dist /= H * W; // cout << dist << endl; double invar = 0; int cnt = 0; rep(i , 0 , H) rep(j , 0 , W) rep(z , 0 , 7) { int x = i + dx[z]; int y = j + dy[z]; if (x < H && y < W) { cnt++; invar += sqrt(D({R[i][j] , G[i][j] , B[i][j]} , {R[x][y] , G[x][y] , B[x][y]})); } } invar /= cnt; // cout << invar << endl; if (dist < 130 && invar < 3) return 4; if (dist > 150) return 1 if (invar < 5.5) return 2 return 3; }

Compilation message (stderr)

artclass.cpp: In function 'int style(int, int, int (*)[500], int (*)[500], int (*)[500])':
artclass.cpp:45:2: error: expected ';' before 'if'
  if (invar < 5.5) return 2
  ^~
artclass.cpp:46:3: error: expected ';' before 'return'
   return 3;
   ^~~~~~