제출 #781713

#제출 시각아이디문제언어결과실행 시간메모리
781713FatihSolak미술 수업 (IOI13_artclass)C++17
89 / 100
78 ms6080 KiB
#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]) { int delta = 0; int cnt = 0; for(int i = 0;i<h;i++){ for(int j = 0;j<w;j++){ if(r[i][j] > g[i][j] && r[i][j] > b[i][j]) cnt++; if(i){ delta += abs(r[i][j] - r[i-1][j]); delta += abs(g[i][j] - g[i-1][j]); delta += abs(b[i][j] - b[i-1][j]); } if(j){ delta += abs(r[i][j] - r[i][j-1]); delta += abs(g[i][j] - g[i][j-1]); delta += abs(b[i][j] - b[i][j-1]); } } } double x = (double)delta / (h * w); double a = (double)cnt / (h * w); //cout << x << ' ' << a << endl; if(x < 20){ return 4; } if(x < 70){ return 1; } if(x < 120){ return 2; } return 3; }

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

artclass.cpp: In function 'int style(int, int, int (*)[500], int (*)[500], int (*)[500])':
artclass.cpp:24:12: warning: unused variable 'a' [-Wunused-variable]
   24 |     double a = (double)cnt / (h * w);
      |            ^
#Verdict Execution timeMemoryGrader output
Fetching results...