QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#402164 | #1080. Unreal Estate | stasio6# | RE | 0ms | 0kb | C++14 | 1.4kb | 2024-04-30 02:43:05 | 2024-04-30 02:43:06 |
answer
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define int ll
#define rep(i,a,b) for(int i = a; i < (b); i++)
#define all(x) begin(x), end(x)
#define sz(x) (int)(x).size()
#define PB push_back
#define FS first
#define SD second
typedef pair<int, int> pii;
typedef vector<int> vi;
template<class X, class Y> X cmx(X &a, Y b) { a = max<X>(a, b); }
#define ary(k) array<int, k>
int pref[2007][2007];
signed main() {
cin.tie(0)->sync_with_stdio(0); cin.exceptions(cin.failbit);
while (true) {
int n;
cin >> n;
if (n == 0)
break;
for (int i = 0; i <= 2001; i++) {
for (int j = 0; j <= 2001; j++) {
pref[i][j] = 0;
}
}
for (int i = 0; i < n; i++) {
int x1, y1, x2, y2;
cin >> x1 >> y1 >> x2 >> y2;
x1 += 1001;
x2 += 1001;
y1 += 1001;
y2 += 1001;
pref[x1][y1]++;
pref[x2][y1]--;
pref[x1][y2]--;
pref[x2][y2]++;
}
int res = 0;
for (int i = 1; i <= 2001; i++) {
for (int j = 1; j <= 2001; j++) {
pref[i][j] += pref[i][j-1] + pref[i-1][j] - pref[i-1][j-1];
if (pref[i][j] > 0)
res++;
}
}
cout << res << ".00\n";
}
}
詳細信息
Test #1:
score: 0
Runtime Error
input:
2 0 0 100 100 30 30 60 60 2 0 100 300 200 100 0 200 300 10 0 0 100 100 0 0 100 100 0 0 100 100 0 0 100 100 0 0 100 100 0 0 100 100 0 0 100 100 0 0 100 100 0 0 100 100 0 0 100 100 4000 709.00 143.83 709.25 873.14 331.00 60.72 331.25 893.57 940.50 142.82 940.75 791.43 116.51 48.50 911.15 48.75 980.00 ...