QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#402164#1080. Unreal Estatestasio6#RE 0ms0kbC++141.4kb2024-04-30 02:43:052024-04-30 02:43:06

Judging History

你现在查看的是最新测评结果

  • [2024-04-30 02:43:06]
  • 评测
  • 测评结果:RE
  • 用时:0ms
  • 内存:0kb
  • [2024-04-30 02:43:05]
  • 提交

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 ...

output:


result: