QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#298075#77. Dazzling Starsgrass8cowWA 49ms9604kbC++17688b2024-01-05 17:06:272024-01-05 17:06:28

Judging History

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

  • [2024-01-05 17:06:28]
  • 评测
  • 测评结果:WA
  • 用时:49ms
  • 内存:9604kb
  • [2024-01-05 17:06:27]
  • 提交

answer

#include<bits/stdc++.h>
using namespace std;
int n,x[1010],y[1010],p[1010];
struct no{
	int x,y,hf;
	no(){}
	no(int x_,int y_){x=x_,y=y_,hf=(x>0)||(x==0&&y>0);}
	inline int cro(no a){return x*a.y-y*a.x;}
	inline int dot(no a){return x*a.x+y*a.y;}
}a[1001000];
int m;
int main(){
	scanf("%d",&n);
	for(int i=1;i<=n;i++)scanf("%d%d%d",&x[i],&y[i],&p[i]);
	for(int i=1;i<=n;i++)for(int j=1;j<=n;j++)if(p[i]>p[j])
	a[++m]=no(x[j]-x[i],y[j]-y[i]);
	sort(a+1,a+m+1,[&](no a,no b){if(a.hf!=b.hf)return a.hf<b.hf;return a.cro(b)>0;});
	for(int i=1;i<=m;i++)if(a[i].cro(a[i%m+1])<0||a[i].cro(a[i%m+1])==0&&a[i].dot(a[i%m+1])<0){
		puts("Y");return 0;
	}
	return puts("N"),0;
}

詳細信息

Test #1:

score: 100
Accepted
time: 1ms
memory: 3392kb

input:

4
2 2 1
2 5 2
5 5 3
5 2 4

output:

Y

result:

ok single line: 'Y'

Test #2:

score: 0
Accepted
time: 21ms
memory: 6676kb

input:

1000
948 1040 5
8222 9897 5
227 -2641 5
7927 -779 5
8288 865 5
1626 -3327 5
3849 -6795 5
3468 7081 5
8003 -6418 5
4603 3061 5
7459 690 5
3780 -6692 5
1982 4037 5
9069 2764 5
248 -5372 5
7575 -3451 5
7273 2061 5
8378 2182 5
6238 406 5
1847 226 5
1704 1876 5
9124 7138 5
977 7813 5
1036 -5564 5
6767 -2...

output:

N

result:

ok single line: 'N'

Test #3:

score: 0
Accepted
time: 19ms
memory: 6452kb

input:

1000
9036 -6349 5
6133 5703 5
8367 1427 5
1537 9208 5
3228 -4348 5
8333 -8494 5
4478 -5274 5
6303 -4728 5
7738 5528 5
2640 4490 5
5299 -5419 5
1133 6527 5
372 -9371 5
6580 9569 5
7418 -2883 5
7573 4554 5
393 376 5
9460 9699 5
892 786 5
6536 -6410 5
1462 3072 5
5423 8491 5
9100 -6072 5
5269 9822 5
67...

output:

N

result:

ok single line: 'N'

Test #4:

score: 0
Accepted
time: 25ms
memory: 6516kb

input:

1000
9263 -7525 1
-5466 150 1
-8518 -4390 1
5702 -1323 1
8981 -1622 1
903 -7326 1
-844 -3052 1
4148 -5766 1
7979 -7727 1
5 -4715 1
2239 -884 1
-1344 -5032 1
-932 -1722 1
-6695 -5274 1
-278 -1415 1
-9078 -8502 1
-7945 -1334 1
5504 -1435 1
-9357 -8067 1
4386 -8413 1
1577 -9107 1
-6159 317 1
-5868 -514...

output:

N

result:

ok single line: 'N'

Test #5:

score: 0
Accepted
time: 25ms
memory: 6384kb

input:

1000
-971 -9339 1
-1956 -7584 1
7043 -2269 1
6492 -3865 1
-1480 -8110 1
-364 -8582 1
3586 -7905 1
-3961 -3949 1
-3568 -6167 1
-6335 -8104 1
-158 -3928 1
7886 -8912 1
-2571 -3072 1
8982 -3802 1
-7862 -7163 1
9088 -1655 1
2170 -1927 1
6843 -8537 1
-6884 -4769 1
-4606 -4289 1
-4458 -5559 1
-3028 -6900 ...

output:

N

result:

ok single line: 'N'

Test #6:

score: 0
Accepted
time: 19ms
memory: 6688kb

input:

1000
-2334 -538 1
-2211 -310 1
-4272 -2431 1
-1993 -2574 1
-620 -335 1
-6709 -5317 1
-9033 -8951 1
-8340 -6504 1
-2564 -4288 1
-2416 -9241 1
-5061 -4959 1
-3004 -1178 1
-2390 -2504 1
-852 -5459 1
-9465 -1856 1
-1640 -8885 1
-4302 -9766 1
-8651 -4712 1
87 -9246 1
-393 -477 1
-7778 -1788 1
-7017 -8538...

output:

N

result:

ok single line: 'N'

Test #7:

score: 0
Accepted
time: 23ms
memory: 6440kb

input:

1000
731 -9300 1
-3767 -6206 1
-6851 821 1
-2961 -5587 1
-7568 -8064 1
-1425 -3676 1
-4294 -9579 1
934 -7095 1
-7794 -8535 1
-6731 -923 1
-8911 -9323 1
-2960 -2239 1
-7014 -7463 1
-5756 -8529 1
-1797 -3816 1
-1951 -9757 1
-4968 -9757 1
-2442 -8465 1
-5161 -4958 1
-1030 -2386 1
-3469 256 1
-3336 -642...

output:

N

result:

ok single line: 'N'

Test #8:

score: 0
Accepted
time: 25ms
memory: 6464kb

input:

1000
1518 -4880 5
-373 2995 5
609 2542 5
531 -2584 5
-1438 2686 5
4447 -2167 5
-2036 3142 5
-347 -4356 5
640 4035 5
3644 -1407 5
2171 391 5
-3562 -2510 5
88 4088 5
2540 -4970 5
4778 -868 5
-3538 -2415 5
2780 -2634 5
2265 -177 5
-4458 1460 5
-689 2663 5
438 772 5
1125 -769 5
-2145 -2133 5
-3591 1827 ...

output:

N

result:

ok single line: 'N'

Test #9:

score: 0
Accepted
time: 49ms
memory: 9592kb

input:

1000
2136 9955 141
7046 -7009 417
7919 -4006 682
-8469 7209 468
-9927 -7095 462
5713 1169 975
-8181 -1752 83
6743 4766 992
-9882 7704 145
-5506 -8143 343
5766 -3022 563
4411 6761 559
775 -2033 752
-580 9394 926
-4240 9699 924
1171 8031 313
268 2198 239
6072 5218 358
-4695 6064 304
-5158 938 46
-7325...

output:

N

result:

ok single line: 'N'

Test #10:

score: 0
Accepted
time: 47ms
memory: 9360kb

input:

1000
1942 -3686 230
-6143 -6212 112
7753 -3753 891
-5482 -380 102
-4603 -8150 169
996 8522 144
-7001 4115 364
-3555 4073 480
-456 -235 281
-989 -6726 531
5694 1645 863
6120 6585 557
-5943 8253 111
-9189 2198 705
6341 -1170 700
6463 3995 701
-9648 496 548
-3740 -2495 604
6897 4819 611
-1282 -9648 803...

output:

N

result:

ok single line: 'N'

Test #11:

score: 0
Accepted
time: 49ms
memory: 9604kb

input:

1000
-7874 7742 265
-9073 5739 940
-9282 -7936 909
1294 -1058 462
-5293 3412 59
-6675 4016 651
-4277 -8585 498
8965 2616 390
-8023 -6847 78
8332 5827 560
8410 8187 242
7441 -6392 917
336 -8543 486
2821 -6930 90
-87 2442 432
7662 6777 455
4153 -8767 201
-780 5554 619
-6873 3747 877
-4851 3288 556
-46...

output:

N

result:

ok single line: 'N'

Test #12:

score: 0
Accepted
time: 1ms
memory: 3640kb

input:

4
1 -10000 1
-10000 0 100
0 10000 500
10000 0 1000

output:

N

result:

ok single line: 'N'

Test #13:

score: 0
Accepted
time: 10ms
memory: 4812kb

input:

468
-2534 -7230 867
-9872 56 899
-8384 1085 617
-9183 -2420 704
-960 4502 158
-5240 -7781 507
8477 1809 775
-2327 4922 102
-4177 3485 726
-1565 -8246 267
-5802 -4377 810
-6011 7728 880
-8905 -2424 492
-9531 -1506 907
-7759 1937 122
1574 7906 204
-9835 -8330 540
-9651 -8304 497
8419 -1598 399
2774 -8...

output:

N

result:

ok single line: 'N'

Test #14:

score: 0
Accepted
time: 1ms
memory: 3752kb

input:

86
-5352 2203 12
-5424 -2635 106
8870 379 364
-2712 -7797 603
3351 4933 863
7287 -2543 231
-8168 3881 644
-7783 4400 887
-9413 2552 779
4787 -4535 377
-8308 -5584 580
7892 -3176 665
8733 4274 215
-3360 8670 16
-147 -2703 177
1226 -3727 275
6520 4040 888
-9912 6115 473
62 8395 524
7983 5855 71
7363 -...

output:

N

result:

ok single line: 'N'

Test #15:

score: 0
Accepted
time: 34ms
memory: 7516kb

input:

825
-9765 -664 323
-8494 -8859 741
-9279 3189 59
-6668 -1064 723
4127 -1481 509
2637 -9025 416
-324 -9772 517
106 4094 127
6362 2895 343
-9397 6636 647
9898 9506 254
2437 -202 783
-1576 1169 54
8495 -8931 474
6243 -5646 284
3076 -8265 501
9732 -4610 728
207 -1647 495
9652 -7361 578
-2903 -7289 317
7...

output:

N

result:

ok single line: 'N'

Test #16:

score: 0
Accepted
time: 0ms
memory: 3584kb

input:

9
3 -6 1
2 2 3
-9 -3 1
7 -10 3
0 6 3
5 -6 2
-1 1 1
-3 -2 1
7 10 2

output:

N

result:

ok single line: 'N'

Test #17:

score: 0
Accepted
time: 1ms
memory: 3536kb

input:

9
-8 -6 2
0 8 2
5 -3 1
-8 -7 2
6 -6 1
-6 -2 3
-1 4 2
3 -2 2
4 4 1

output:

N

result:

ok single line: 'N'

Test #18:

score: 0
Accepted
time: 0ms
memory: 3540kb

input:

10
-6 -1 2
-4 -8 1
3 6 3
8 -8 2
7 0 2
-6 -5 1
4 4 3
10 -3 3
-2 -7 1
-6 -6 1

output:

Y

result:

ok single line: 'Y'

Test #19:

score: 0
Accepted
time: 0ms
memory: 3740kb

input:

10
10 -7 3
-5 -7 1
7 -1 1
0 -2 2
-4 -6 2
5 2 2
-1 -10 2
-1 -6 3
-4 4 3
3 6 1

output:

N

result:

ok single line: 'N'

Test #20:

score: 0
Accepted
time: 0ms
memory: 3528kb

input:

10
-9 8 3
7 7 3
1 -3 3
8 -10 1
7 -10 2
5 5 3
-3 -2 1
-1 8 3
-6 -3 1
-4 1 1

output:

N

result:

ok single line: 'N'

Test #21:

score: 0
Accepted
time: 0ms
memory: 3708kb

input:

5
-10 -8 1
-3 -9 3
-4 1 2
-3 6 3
3 -9 2

output:

N

result:

ok single line: 'N'

Test #22:

score: 0
Accepted
time: 0ms
memory: 3516kb

input:

9
-4 5 2
-1 7 3
-6 3 2
-10 10 1
9 -5 3
5 3 2
10 1 2
3 -9 2
-2 10 2

output:

N

result:

ok single line: 'N'

Test #23:

score: 0
Accepted
time: 1ms
memory: 3752kb

input:

4
-200 -100 5
-100 -100 9
-100 -200 5
-200 -200 9

output:

N

result:

ok single line: 'N'

Test #24:

score: 0
Accepted
time: 1ms
memory: 3744kb

input:

6
-9 9 3
9 -8 2
9 -9 2
3 -1 3
5 8 1
8 3 1

output:

Y

result:

ok single line: 'Y'

Test #25:

score: 0
Accepted
time: 0ms
memory: 3516kb

input:

8
-9 -1 3
-3 -10 1
8 -9 1
1 7 2
-8 -5 2
1 -4 2
2 -8 3
6 -4 3

output:

N

result:

ok single line: 'N'

Test #26:

score: 0
Accepted
time: 0ms
memory: 3752kb

input:

6
1 6 1
2 -10 1
-7 5 1
-7 2 1
1 -1 3
-2 -7 1

output:

N

result:

ok single line: 'N'

Test #27:

score: 0
Accepted
time: 0ms
memory: 3756kb

input:

3
8 4 1
9 2 2
6 9 2

output:

Y

result:

ok single line: 'Y'

Test #28:

score: 0
Accepted
time: 0ms
memory: 3504kb

input:

3
8 5 2
8 4 3
2 2 2

output:

Y

result:

ok single line: 'Y'

Test #29:

score: 0
Accepted
time: 21ms
memory: 9292kb

input:

1000
543 2 543
844 2 844
398 2 398
690 1 690
352 1 352
546 1 546
601 1 601
612 1 612
621 2 621
315 2 315
592 2 592
90 1 90
670 1 670
16 2 16
559 1 559
521 1 521
936 1 936
246 2 246
226 1 226
686 1 686
708 2 708
190 2 190
130 2 130
910 2 910
825 1 825
520 1 520
640 1 640
547 2 547
945 1 945
917 2 917...

output:

Y

result:

ok single line: 'Y'

Test #30:

score: 0
Accepted
time: 23ms
memory: 6680kb

input:

1000
1 -3432 1
1 -507 1
2 4764 2
2 -9816 2
2 9917 2
1 -2318 1
1 -1760 1
1 6403 1
2 -5668 2
2 -6088 2
2 -7947 2
1 -3789 1
2 -1705 2
1 -6196 1
1 846 1
1 3351 1
1 5797 1
1 3077 1
1 -3920 1
1 -8520 1
2 -4760 2
1 -3418 1
1 1290 1
2 263 2
2 7945 2
2 -8837 2
1 -5925 1
2 -8928 2
1 -2618 1
2 4189 2
2 -7121 2...

output:

Y

result:

ok single line: 'Y'

Test #31:

score: 0
Accepted
time: 49ms
memory: 9420kb

input:

1000
520 -7680 520
603 1311 603
973 3187 973
26 -8539 26
602 7906 602
235 -5272 235
843 7616 843
3 -3495 3
148 841 148
954 -7268 954
546 8378 546
502 2817 502
904 6844 904
278 6819 278
858 1042 858
118 4809 118
257 4840 257
423 -6444 423
576 7200 576
267 8306 267
173 9760 173
20 -9212 20
400 -8156 4...

output:

Y

result:

ok single line: 'Y'

Test #32:

score: 0
Accepted
time: 49ms
memory: 9360kb

input:

1000
619 -609 619
684 1039 684
515 3725 515
893 -7524 893
600 3917 600
587 8245 587
989 -1679 989
132 -526 132
739 -982 739
180 1746 180
241 -3260 241
543 7156 543
58 -9211 58
968 6309 968
142 -2831 142
104 -3860 104
975 -5783 975
256 7903 256
153 5608 153
108 -6822 108
977 -9930 977
651 148 651
631...

output:

Y

result:

ok single line: 'Y'

Test #33:

score: -100
Wrong Answer
time: 1ms
memory: 3576kb

input:

1000
2762 -183 10
-3790 -3834 10
2129 4448 10
-3860 -2738 10
1078 -5622 10
-5816 288 10
3289 4425 10
1856 9026 10
-1006 -5795 10
8248 -6164 10
2127 -695 10
6738 3464 10
-511 7509 10
468 -4243 10
-8003 6051 10
-7270 -251 10
9784 -3674 10
2989 7245 10
-2141 3318 10
556 4211 10
-9119 492 10
1784 -1851 ...

output:

N

result:

wrong answer 1st lines differ - expected: 'Y', found: 'N'