QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#184986#4345. hpmo / 赫露艾斯塔do_while_true20 20ms17444kbC++202.2kb2023-09-21 15:21:382023-09-21 15:21:39

Judging History

你现在查看的是测评时间为 2023-09-21 15:21:39 的历史记录

  • [2024-04-15 21:10:59]
  • 管理员手动重测该提交记录
  • 测评结果:50
  • 用时:329ms
  • 内存:18868kb
  • [2023-09-21 15:21:39]
  • 评测
  • 测评结果:20
  • 用时:20ms
  • 内存:17444kb
  • [2023-09-21 15:21:38]
  • 提交

answer

#include<cstdio>
#include<vector>
#include<queue>
#include<cstring>
#include<iostream>
#include<algorithm>
#include<ctime>
#include<random>
#include<assert.h>
#define pb emplace_back
#define mp make_pair
#define fi first
#define se second
#define dbg(x) cerr<<"In Line "<< __LINE__<<" the "<<#x<<" = "<<x<<'\n';
#define dpi(x,y) cerr<<"In Line "<<__LINE__<<" the "<<#x<<" = "<<x<<" ; "<<"the "<<#y<<" = "<<y<<'\n';
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef pair<int,int>pii;
typedef pair<ll,int>pli;
typedef pair<ll,ll>pll;
typedef pair<int,ll>pil;
typedef vector<int>vi;
typedef vector<ll>vll;
typedef vector<pii>vpii;
typedef vector<pil>vpil;
template<typename T>T cmax(T &x, T y){return x=x>y?x:y;}
template<typename T>T cmin(T &x, T y){return x=x<y?x:y;}
template<typename T>
T &read(T &r){
	r=0;bool w=0;char ch=getchar();
	while(ch<'0'||ch>'9')w=ch=='-'?1:0,ch=getchar();
	while(ch>='0'&&ch<='9')r=r*10+(ch^48),ch=getchar();
	return r=w?-r:r;
}
template<typename T1,typename... T2>
void read(T1 &x,T2& ...y){read(x);read(y...);}
const int mod=998244353;
inline void cadd(int &x,int y){x=(x+y>=mod)?(x+y-mod):(x+y);}
inline void cdel(int &x,int y){x=(x-y<0)?(x-y+mod):(x-y);}
inline int add(int x,int y){return (x+y>=mod)?(x+y-mod):(x+y);}
inline int del(int x,int y){return (x-y<0)?(x-y+mod):(x-y);}
mt19937 rnd(time(NULL)^(ull)(new char));
const int N=200010;
int n,m,p[N],B;
ll x[N],y[N],a[N],b[N],c[N];
vector<pair<double,int>>vec[N];
signed main(){
	#ifdef do_while_true
//		assert(freopen("data.in","r",stdin));
//		assert(freopen("data.out","w",stdout));
	#endif
	read(n,m);
	B=min(n,450);
	for(int i=1;i<=n;i++){
		read(x[i],y[i]);
		p[i]=i;
	}
	shuffle(p+1,p+n+1,rnd);
	for(int i=1;i<=m;i++){
		read(a[i],b[i],c[i]);
		int pos=0;
		ll mx=0;
		for(int j=1;j<=B;j++){
			ll o=a[i]*x[p[j]]+b[i]*y[p[j]]+c[i];
			if(o>0){
				if(!pos || o<mx){
					pos=j;
					mx=o;
				}
			}
		}
		if(!pos)pos=1;
		vec[pos].pb(mp(atan2(a[i],b[i]),i));
	}
	for(int i=1;i<=B;i++){
		sort(vec[i].begin(),vec[i].end());
		for(auto j:vec[i])cout << j.se << '\n';
	}
    #ifdef do_while_true
		cerr<<'\n'<<"Time:"<<1.0*clock()/CLOCKS_PER_SEC*1000<<" ms"<<'\n';
	#endif
	return 0;
}

详细

Subtask #1:

score: 20
Accepted

Test #1:

score: 20
Accepted
time: 19ms
memory: 16724kb

input:

9997 9990
9019266 5863617
-9132512 9933564
-3874637 4993765
444830 -2250447
-2352800 3441144
-6132076 -4919200
-1607690 1649753
-3707230 -9677822
-4044043 949637
-7761530 2069488
9475384 4537713
-6619947 -121926
5929373 653750
5738540 -7373755
1630427 2169595
7049000 185616
-4436632 7644104
-7326158...

output:

5755
7198
2896
3430
3047
7
25
740
7947
1106
6948
8766
7474
3783
1389
2871
3408
3474
4055
4295
8839
9116
4121
4429
5741
7365
8356
9871
8617
2051
3247
6049
8964
5380
471
2608
6158
9703
32
65
353
388
460
977
1187
1234
1414
1590
1849
1954
2187
2231
2303
2367
2592
2722
2763
2869
2960
3030
3411
3473
3486
...

result:

ok cost = 9808394

Test #2:

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

input:

10000 10000
-9867885 -6351277
3489722 8586294
-813430 9340951
2086219 9210082
8903276 -6786767
8717742 1297662
8333166 -3317203
7936341 4929952
4912513 9933563
-4537308 -9543067
7319834 8626975
-5937113 -4470138
3427489 -6194898
-7290157 -3404718
-3724079 2294733
7598186 6969998
-9934248 6924016
428...

output:

8061
3931
8964
8974
8169
8209
5519
8757
1366
4052
4419
5886
7429
1085
2969
3419
4642
4919
5629
6206
6457
7645
8573
9082
9820
9860
8352
9765
5312
85
2669
4892
6451
7171
2395
7952
3752
9157
1136
3644
9018
9305
5123
2383
12
49
395
456
457
560
597
619
662
692
702
960
999
1121
1198
1263
1382
1457
1568
15...

result:

ok cost = 9752056

Test #3:

score: 0
Accepted
time: 15ms
memory: 16876kb

input:

10000 10000
-660951 65490
-29833 2757177
-340846 10961
-7150119 33459
5136755 4278
25550 775750
5201020 -5199
75169 4666130
67597 1714309
-36541 -3114964
-4240048 31425
73017 2383801
-94770 -836461
7728250 65154
-62043 -9108010
49090 4597522
-6217034 -71671
-6369695 31577
31865 8971451
72473 9040891...

output:

9314
5956
6096
9806
5506
9110
8388
9354
1435
3066
6286
7762
9472
585
5393
2814
2987
5399
5549
8802
7364
413
828
1419
1454
1521
2554
3451
5415
5552
5642
5675
5677
6716
7358
7859
7863
8806
8813
8822
9229
9458
9490
9810
9908
823
9151
1091
3205
652
1566
4719
5486
7092
7435
7563
8675
6720
6263
274
1564
2...

result:

ok cost = 9600286

Test #4:

score: 0
Accepted
time: 18ms
memory: 16940kb

input:

9998 9990
7582 3856200
9459 4381
-5500354 -8064
3998 -8251368
3506 6715096
-8509 -321964
1725 -1322233
5849831 -1846
-5027 1011243
2596 1990975
-9353 -1004281
3956 -604279
8402459 6848
5419 -2187141
8567983 -2494
1683 4015848
-7337 8293412
-7173 7399645
3799 8763972
4228499 -1835
-8493 -2845008
-833...

output:

8760
1748
5627
2872
585
3878
4017
5276
7425
1805
4055
8675
170
5806
1209
3900
3218
8303
616
6207
2585
555
927
1050
1051
2184
2635
4074
4232
4368
4484
4781
5026
5326
6579
6814
6964
7384
7668
7851
9826
1699
3160
391
2387
7617
1844
506
2998
6255
6592
9695
949
1825
2096
6055
8959
7293
5539
531
807
824
1...

result:

ok cost = 9177680

Test #5:

score: 0
Accepted
time: 17ms
memory: 16108kb

input:

10000 10000
-9144786 9458431
9233721 -9868159
-9349753 -9965861
9814616 9358465
9750984 -9543095
-9665224 9051130
9964223 9790510
-9960351 9771782
9534798 9181687
-9569872 -9172559
9221230 -9786591
9879500 9613336
9830155 9270397
-9866671 -9417021
9337577 9481408
9668674 -9921731
-9817467 9225012
99...

output:

4717
8350
1077
2455
3296
3662
3702
8096
8457
2329
3827
5790
7245
360
2932
5148
8928
9719
9919
735
1133
2003
2668
2950
3467
3880
6099
6839
8905
579
2063
3869
3916
5268
5343
5914
6440
8795
9654
493
583
774
776
889
943
1483
2693
3644
3717
3854
4885
4937
4964
5766
5831
6194
6435
6592
7108
7391
7417
7906...

result:

ok cost = 7988764

Test #6:

score: 0
Accepted
time: 15ms
memory: 17296kb

input:

9990 9990
-967949 32827
-1626409 25231
3914913 -17371
-3340636 -33022
-5664776 7967173
-5125 -27879
4988706 -3540854
-9980324 -14749
2914084 -16185
-3231561 9522
1044674 19300
-3619589 16689
1056583 4919512
-141677 -29040
-2587777 -8824
8185554 -10101
-3482427 -1834
8972857 -3639730
-7063435 -8995
2...

output:

4104
2545
2849
1754
3906
4228
7699
5239
9476
6875
1699
5527
7829
3215
8753
9638
5331
4600
8401
271
409
504
777
1132
1155
1330
1753
2078
2219
2402
2629
2672
2756
2819
2885
3165
3243
3251
3363
3368
3612
3620
3766
3905
4012
4074
4233
4236
4257
4509
4632
4640
5146
5332
5396
5816
6095
6253
6601
6684
6738...

result:

ok cost = 8695635

Test #7:

score: 0
Accepted
time: 17ms
memory: 16196kb

input:

10000 10000
1968477 4944613
6286972 -9851737
-6437502 -4770833
1151523 -7901737
-3149643 9687929
-2205837 -376397
-1324393 5174345
3034439 6480824
-9341786 -7611299
8694184 -3435575
95532 -7378553
-428305 -2628108
263 -5693153
4995174 -4874425
-5093158 -5437311
5434124 6700984
-984539 2903531
293896...

output:

8192
1894
7235
9506
50
836
3231
6152
6660
2613
4129
4309
6339
284
307
977
3616
3961
5075
5323
6300
9535
9907
2461
2630
606
1519
1767
3221
4294
8311
8696
8737
9175
9862
1761
9915
4067
6517
7193
7986
191
4584
8782
5345
7788
9057
349
750
1328
1882
2004
4815
5135
5140
5400
5475
7275
7852
9324
9340
9798
...

result:

ok cost = 1387151

Test #8:

score: 0
Accepted
time: 14ms
memory: 15800kb

input:

10000 10000
-1326300 -7573500
7443150 -8520425
9706112 5114022
-2518500 -7674600
5016700 630200
9734400 8710400
3048966 -5268394
610442 -1407578
7055300 -101500
616523 3597946
-3141466 6983439
5742991 8144648
5661864 4435109
-2226200 -4249300
-5924600 -9402400
6799900 -3953000
6648000 -8833700
80689...

output:

1068
5323
1834
6805
7398
9417
1179
2449
7128
1140
8329
9187
4005
9300
1136
4076
5619
6944
8340
9934
720
1222
2764
3153
3248
4715
4888
5727
6351
8678
9182
9248
9580
1714
8052
1016
1467
2657
2890
3439
5270
5963
6874
8036
8117
8806
6254
1716
5446
6857
7388
9975
6730
5584
6035
115
2473
5740
6458
7660
81...

result:

ok cost = 9894363

Test #9:

score: 0
Accepted
time: 20ms
memory: 16532kb

input:

10000 10000
-2318095 2019446
-4035918 2985975
713901 -223858
3296173 -824906
-83732 1397407
-316288 128177
-1184337 -2715514
18449 -3918764
482679 -859441
2741883 -4078535
-5781803 1089808
-2596705 -3341805
-3283602 4287650
-204221 2840836
-1521345 -11681
5377933 4075120
-862909 -1012305
-616438 -64...

output:

1416
9168
1800
7852
1858
5325
3926
4511
8769
223
6903
5788
9344
548
5970
6346
6215
8240
4538
2330
3270
596
7410
4677
3038
5570
495
1100
2198
2500
2912
3515
3861
3933
4153
4888
5340
5833
6746
7185
7212
7471
7635
7817
8505
8507
9514
9608
7815
7186
3509
4242
7365
3944
8230
1602
5005
9044
9191
6482
6909...

result:

ok cost = 9908227

Test #10:

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

input:

10000 10000
30399 911905
6099694 -822955
-1970492 1924582
8133655 -2339409
1225483 -1771551
-578009 -1208298
-5626070 5251285
-3033849 -8699056
5626898 3642052
-2037392 -1207307
-6932083 -3926601
7017312 -2624958
-4505258 -3199363
3196125 4153290
5919593 3128640
-5235780 -3147933
-4493757 162244
573...

output:

6341
4220
1984
2468
2952
4724
4088
1164
1228
2452
2778
5040
8259
6420
5487
157
4917
9034
548
975
1746
3549
4228
4953
9196
2715
8349
7544
8939
1284
1994
3647
1050
6345
601
883
968
2444
2707
3523
3627
3674
4046
4089
4293
4615
5212
5393
5651
6452
7065
7188
8472
8520
9876
1274
3059
5704
1799
3048
4524
5...

result:

ok cost = 9915521

Subtask #2:

score: 0
Checker Time Limit Exceeded

Test #11:

score: 0
Checker Time Limit Exceeded

input:

100000 200000
-8961334 8961334
-7613572 -7613572
-3090937 3090937
8569374 8569374
-526841 526841
2030109 2030109
829999 -829999
6793124 6793124
-5100765 5100765
-4111697 4111697
5995701 5995701
-3387024 -3387024
1395655 -1395655
1161722 -1161722
7911524 7911524
307563 -307563
1112474 1112474
-131073...

output:

104180
86337
139405
156228
197464
3533
10156
29995
37899
44954
53742
76431
84604
95692
124761
144658
154802
160749
170994
171105
190575
15442
21297
29400
34720
34956
37264
43771
57713
73522
75427
92747
98105
104555
108040
136672
148472
158881
178459
179460
180932
189520
4317
19607
23612
32432
43651
...

result:


Subtask #3:

score: 0
Skipped

Dependency #1:

100%
Accepted

Dependency #2:

0%