用户输出
1
0
系统信息
Exited with return code 0
编号 | 题目 | 状态 | 分数 | 总时间 | 内存 | 代码 / 答案文件 | 提交者 | 提交时间 |
---|---|---|---|---|---|---|---|---|
#23908 | #1004. D. 成立西安“全天候”量化科技有限公司 | Wrong Answer | 5 | 51212 ms | 9776 K | C++ / 1.0 K | 电类935-郑新宇 | 2020-02-24 20:48:39 |
#include <iostream>
#include <algorithm>
#include <cstdio>
#include <cstring>
#define ll long long
using namespace std;
struct star {
ll x, y;
} k0[300010], k1[300010];
int t, n, cnt, u, v, w, s1, s2;
bool cmp(star a, star b) {
if (a.x == b.x)
return a.y > b.y;
return a.x > b.x;
}
ll read() {
ll xx = 0;
char ch = getchar();
while (ch < '0' || ch > '9') ch = getchar();
while (ch >= '0' && ch <= '9') {
xx = xx * 10 + ch - '0';
ch = getchar();
}
return xx;
}
int main() {
// freopen("in.txt","r",stdin);
cin >> t;
while (t--) {
memset(k1, 0, sizeof(k1));
memset(k0, 0, sizeof(k0));
cnt = 0;
s1 = 0, s2 = 0;
cin >> n;
for (int i = 1; i <= n; i++) {
u = read();
v = read();
w = read();
if (w == 0)
k0[++s1].x = u, k0[s1].y = v;
else
k1[++s2].x = u, k1[s2].y = v;
}
sort(k0 + 1, k0 + s1 + 1, cmp);
sort(k1 + 1, k1 + s2 + 1, cmp);
int i = 1, j = s2;
while (i <= s1 && j > 0) {
if (k0[i].x > k1[j].x && k0[i].y > k1[j].y)
i++, j--, cnt++;
if (k0[i].x < k1[j].x && k0[i].y < k1[j].y)
i++, j--, cnt++;
if (k0[i].x > k1[j].x && k0[i].y < k0[j].y)
j--;
if (k0[i].x < k1[j].x)
break;
}
cout << cnt << endl;
}
return 0;
}
用户输出
0
0
0
0
2
Special Judge 信息
Files user_out and answer differ
系统信息
Exited with return code 0
5
5
0 1 0
3 2 1
4 5 0
1 4 0
2 2 1
1
0 3 0
3
0 1 0
1 5 0
4 2 1
1
2 0 1
3
1 0 1
4 3 1
<9 bytes omitted>
用户输出
1
0
0
0
0
Special Judge 信息
Files user_out and answer differ
系统信息
Exited with return code 0
5
4
5 1 0
2 0 0
0 5 1
4 0 0
1
2 3 1
4
0 0 0
4 4 1
0 5 1
0 3 1
5
5 5 1
3 5 1
0 0 0
2
<51 bytes omitted>
5
3
4 3 0
2 1 0
4 3 0
5
1 3 0
4 5 1
4 3 0
2 0 0
0 5 0
5
4 2 0
4 2 1
1 2 1
0 2 1
4 0
<44 bytes omitted>
用户输出
0
5
8
18 19 1
7 10 1
10 2 0
15 16 0
14 10 0
3 10 0
3 0 0
13 20 1
8
20 1 0
20 18 1
5 19 0
<318 bytes omitted>
5
13
2 13 1
9 9 1
10 18 0
10 3 0
11 19 1
15 7 0
1 11 1
9 20 1
12 19 0
12 0 1
0 11 0
17
<255 bytes omitted>
5
20
9 16 1
2 6 0
8 16 1
1 15 1
11 1 0
4 13 1
8 8 1
5 9 0
20 13 1
10 19 1
9 9 0
6 7 1
<509 bytes omitted>
5
4
20 12 1
7 19 1
20 9 1
20 12 1
9
9 8 1
10 6 1
19 1 1
20 3 0
9 1 0
18 17 0
13 0 0
16
<321 bytes omitted>
用户输出
0
2
5
14
18 6 0
9 20 1
13 19 0
5 8 1
11 13 0
14 14 0
2 15 1
11 7 1
17 2 1
9 13 1
9 0 1
7 4
<262 bytes omitted>
5
500
6 21 0
34 19 1
20 16 0
8 39 1
34 28 1
29 28 1
24 0 0
49 7 0
31 29 0
8 0 0
28 33 0
<33156 bytes omitted>
5
99
39 2 1
31 20 0
23 42 1
14 20 0
11 6 0
35 17 1
46 46 1
31 12 1
21 20 1
19 26 1
34 31
<23942 bytes omitted>
5
265
251 3009 1
250 2014 1
260 1683 1
238 3340 0
269 7459 1
275 1090 0
235 1099 0
253 7181
<15743 bytes omitted>
5
208
264 9457 0
269 5127 0
254 587 1
272 9393 0
272 8595 0
269 7076 1
244 1524 0
238 8345
<31650 bytes omitted>
5
64
9269 505 0
5826 519 0
440 508 1
9767 513 0
8806 511 1
5531 518 1
7282 507 0
1401 511 0
<26946 bytes omitted>
1
76883
494039077 497063733 1
991790472 699599226 1
856388129 516813283 0
404603544 968369775 1
<1751102 bytes omitted>
1
8847
671644885 13604453 1
384481136 454599471 0
67657591 420079234 1
160390864 992023037 0
7
<201369 bytes omitted>
1
100000
569980851 442743025 1
97240074 590606533 1
155640720 410869960 1
280099927 120367499 1
<2277533 bytes omitted>
1
100000
12886 286541 1
12710 75580 1
13070 71554 0
12408 394393 0
12700 81182 1
12710 90788
<1574446 bytes omitted>