Submission #162214

#TimeUsernameProblemLanguageResultExecution timeMemory
162214crisente235수족관 1 (KOI13_aqua1)C++14
Compilation error
0 ms0 KiB
#include<iostream> #include<iomanip> using namespace std; int aqua[5000][5000]; int main() { int edge; int x1, y1,x2,y2; int hole; int cnt=0; memset(aqua, -1, sizeof(aqua)); cin >> edge; cin >> x1 >> y1; for (int a = 0; a < (edge-2)/2; a++) { cin >> x1 >> y1; cin>> x2 >> y2; for (int i = 0; i < y2; i++) { if ((x2 - x1) > 1) { aqua[i][x1] = 1; aqua[i][x1+1] = 1; cnt+=2; } else { aqua[i][x1] = 1; cnt++; } } } cin >> x1 >> y1; cin >> hole; for (int i = 0; i < hole; i++) { cin >> x1 >> y1 >> x2 >> y2; for (int y = 0; y < y1; y++) { for (int x = 0; x < ((edge) / 2)+1; x++) { if (aqua[y][x] == -1) { break; } else if(aqua[y][x]==0){ } else { aqua[y][x] = 0; cnt--; } } } } for (int i = 0; i < 10; i++) { for (int j = 0; j < 10; j++) { cout <<setw(5)<<aqua[i][j]; } cout << "\n"; } cout << cnt; return 0; }

Compilation message (stderr)

aqua1.cpp: In function 'int main()':
aqua1.cpp:13:2: error: 'memset' was not declared in this scope
  memset(aqua, -1, sizeof(aqua));
  ^~~~~~
aqua1.cpp:13:2: note: suggested alternative: 'wmemset'
  memset(aqua, -1, sizeof(aqua));
  ^~~~~~
  wmemset