Submission #461235

# Submission time Handle Problem Language Result Execution time Memory
461235 2021-08-09T15:11:44 Z vanic Nuclearia (CEOI15_nuclearia) C++14
Compilation error
0 ms 0 KB
#include <iostream>
#include <cstdio>
#include <cmath>
#include <algorithm>
#include <cstring>

using namespace std;
typedef long long ll;

vector < vector < ll > > l;
vector < ll > vi;

int main(){
	ios_base::sync_with_stdio(false);
	cin.tie(0);
	cout.tie(0);
	int h, w;
	cin >> w >> h;
	vi.resize(h, 0);
	l.resize(w, vi);
	int n;
	cin >> n;
	ll a, b, c, d;
	for(int i=0; i<n; i++){
		cin >> a >> b >> c >> d;
		a--;
		b--;
		for(int j=0; j<w; j++){
			for(int k=0; k<h; k++){
				l[j][k]+=max(0ll, c-d*max(abs(j-a), abs(k-b)));
			}
		}
	}
	int q;
	cin >> q;
	ll sum;
	for(int i=0; i<q; i++){
		cin >> a >> b >> c >> d;
		a--; b--; c--; d--;
		sum=0;
		for(int j=a; j<=c; j++){
			for(int k=b; k<=d; k++){
				sum+=l[j][k];
			}
		}
		cout << (ll)round((double)sum/((c-a+1)*(d-b+1))) << '\n';
	}
	return 0;
}

Compilation message

nuclearia.cpp:10:1: error: 'vector' does not name a type
   10 | vector < vector < ll > > l;
      | ^~~~~~
nuclearia.cpp:11:1: error: 'vector' does not name a type
   11 | vector < ll > vi;
      | ^~~~~~
nuclearia.cpp: In function 'int main()':
nuclearia.cpp:19:2: error: 'vi' was not declared in this scope
   19 |  vi.resize(h, 0);
      |  ^~
nuclearia.cpp:20:2: error: 'l' was not declared in this scope
   20 |  l.resize(w, vi);
      |  ^