Submission #162215

# Submission time Handle Problem Language Result Execution time Memory
162215 2019-11-07T04:59:13 Z crisente235 수족관 1 (KOI13_aqua1) C++14
0 / 100
137 ms 74648 KB
#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 time Memory Grader output
1 Incorrect 2 ms 504 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 2 ms 504 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 7 ms 3320 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Runtime error 137 ms 74648 KB Execution killed with signal 11 (could be triggered by violating memory limits)
2 Halted 0 ms 0 KB -