Submission #162215

#TimeUsernameProblemLanguageResultExecution timeMemory
162215crisente235수족관 1 (KOI13_aqua1)C++14
0 / 100
137 ms74648 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; cin >> edge; cin >> x1 >> y1; for(int i =0; i<(edge/2)-1;i++){ for(int j=0; j<(edge/2)+1;j++){ aqua[i][j]=-1; } } 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--; } } } } cout << cnt; return 0; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...