QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#184986 | #4345. hpmo / 赫露艾斯塔 | do_while_true | 50 | 329ms | 18868kb | C++20 | 2.2kb | 2023-09-21 15:21:38 | 2024-04-15 21:10:59 |
Judging History
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;
}
Details
Tip: Click on the bar to expand more detailed information
Subtask #1:
score: 20
Accepted
Test #1:
score: 20
Accepted
time: 19ms
memory: 12684kb
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 903 3047 4922 7 25 7947 7811 1075 1106 6948 8010 8766 9286 233 2796 6699 7474 2619 3783 1033 1389 1613 2871 3408 3474 4055 4295 6599 8839 9116 9491 6509 3849 4121 4429 5741 7365 8356 9871 8902 2051 3247 6049 8964 6104 6215 7822 5380 471 2608 4855 6158 9703 32 65 353 388 460 977 1...
result:
ok AC
Test #2:
score: 0
Accepted
time: 19ms
memory: 12648kb
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:
9638 8061 971 3137 3931 8974 8169 8209 5519 6665 8757 1366 2410 2803 4052 4419 5886 6177 7429 1085 2969 3419 4642 4919 5629 6206 6457 7645 8573 9082 9820 9860 9079 8352 5312 85 2669 4892 6451 7171 2395 3260 7952 3752 9157 1136 3644 9018 5123 12 49 395 456 457 560 597 619 662 692 702 960 999 1121 119...
result:
ok AC
Test #3:
score: 0
Accepted
time: 18ms
memory: 12588kb
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 8715 2684 7190 5506 9110 8578 8388 9354 1435 3066 6286 7762 9472 585 4494 2814 2987 3694 5399 5549 5816 8802 2451 7560 8702 7364 8652 413 828 1419 1454 1521 3451 5415 5552 5642 5675 5677 6716 7358 7859 7863 8806 8813 8822 9229 9458 9490 9810 9908 9151 1091 3205 652 1566 4719 5486...
result:
ok AC
Test #4:
score: 0
Accepted
time: 14ms
memory: 14560kb
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:
4710 9620 317 9912 6300 9231 8760 1748 5627 2872 585 3878 4017 7425 1805 4055 8675 170 5806 1209 3900 3218 8303 616 6207 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 9032 949 1825 2096 8959 7293...
result:
ok AC
Test #5:
score: 0
Accepted
time: 13ms
memory: 12664kb
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 AC
Test #6:
score: 0
Accepted
time: 13ms
memory: 12600kb
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:
2545 2849 1754 6083 3906 4228 7699 9487 5239 9476 1699 5527 7829 3215 8753 9638 5331 4600 8401 271 409 457 504 777 1132 1155 1753 2078 2219 2402 2629 2672 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 6792 ...
result:
ok AC
Test #7:
score: 0
Accepted
time: 17ms
memory: 14756kb
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 AC
Test #8:
score: 0
Accepted
time: 15ms
memory: 14552kb
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:
1723 5323 1834 9417 1179 2449 8252 1140 8329 9187 9300 4076 5619 6944 9934 1222 2764 3153 4715 5727 6351 8678 9182 9248 9580 8052 1016 8337 5077 2890 3439 5963 6874 8806 635 5226 3122 6857 9975 5584 6035 6190 115 2473 6458 8138 4516 7334 3464 4720 8589 137 142 546 707 717 747 802 984 999 1018 1152 1...
result:
ok AC
Test #9:
score: 0
Accepted
time: 16ms
memory: 12648kb
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:
8967 2106 942 6089 9168 9741 1800 7852 1858 5325 4511 8769 6903 5788 9344 5847 2123 548 6346 6215 4538 6779 2330 3270 5280 7410 3142 1100 3515 3933 5833 6746 7471 7635 7817 8505 9608 8494 7447 5825 8399 1260 3286 5184 9840 1170 2965 3353 7480 6966 5935 2885 9187 5012 422 987 1460 1750 2479 3288 5024...
result:
ok AC
Test #10:
score: 0
Accepted
time: 15ms
memory: 12596kb
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:
2468 8861 579 2952 4724 4088 1164 1228 2452 2778 5040 7506 8259 6420 5487 157 4917 7595 3835 5915 275 548 975 1746 3549 4228 4835 4953 2715 8349 7544 5242 2505 8939 1284 3647 8210 1050 6345 4328 2040 601 883 968 1502 2444 2510 2707 2834 3523 3627 3674 4046 4089 4293 4319 4401 4450 4615 4710 5212 539...
result:
ok AC
Subtask #2:
score: 30
Accepted
Test #11:
score: 30
Accepted
time: 301ms
memory: 18644kb
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:
59610 116750 3533 37899 44954 76431 84604 95692 124761 144658 154802 170994 171105 190575 15442 21297 29400 34720 34956 37264 43771 57713 73522 98105 104555 108040 123296 124995 136672 148472 158881 178459 179460 180932 189520 190453 4317 19607 23612 29915 32432 43651 43764 46627 57852 84166 90846 9...
result:
ok AC
Test #12:
score: 0
Accepted
time: 303ms
memory: 16944kb
input:
99995 199993 -6901477 6901477 -1845889 1845889 934067 934067 4499968 4499968 -7373617 -7373617 9655283 9655283 9909636 9909636 3781678 3781678 8382976 -8382976 9572634 9572634 5961770 5961770 -6817835 -6817835 1707317 1707317 8703130 8703130 3783006 -3783006 -4869514 4869514 -5733646 5733646 -418580...
output:
165316 189629 175061 63750 99006 5987 45361 45685 71976 89507 113357 116031 118058 128361 147638 165868 171594 174539 183769 13066 26055 34716 43490 44517 53710 53977 59121 62628 63428 68243 70828 85534 90244 113775 122608 132811 142826 155888 162173 164056 166089 175910 176294 188360 192896 102304 ...
result:
ok AC
Test #13:
score: 0
Accepted
time: 295ms
memory: 16788kb
input:
99992 199994 88614 88614 7096410 -7096410 3894885 -3894885 67776 -67776 -8727157 -8727157 -29896 29896 8541631 8541631 -15653 -15653 -2318947 2318947 1990132 1990132 -7126 -7126 -2096941 2096941 87950 87950 -40903 -40903 -19865 19865 9066395 9066395 -8750432 8750432 -14428 14428 8790520 8790520 -466...
output:
185432 116947 82096 93643 188266 58236 82534 6425 178641 134841 76319 86137 196853 12105 26937 186968 48796 39807 22809 35811 95624 106734 8817 14274 51195 57198 67643 102530 109888 112719 123407 136530 146738 151229 177689 193502 194368 197214 3558 22453 171118 8479 120791 57293 60319 62186 133830 ...
result:
ok AC
Test #14:
score: 0
Accepted
time: 301ms
memory: 17264kb
input:
100000 199990 -2262 2262 9855799 9855799 8873539 8873539 4744 -4744 -5302050 5302050 -5359476 5359476 -5002234 -5002234 -8027512 8027512 -6100 -6100 6259671 6259671 4922 4922 7251 7251 -4096997 -4096997 -693 693 -9210010 -9210010 -1651967 1651967 3644 3644 -5324 -5324 1949 -1949 7733 7733 -1155 1155...
output:
59489 352 42830 138816 142699 151517 159369 171313 182314 188732 193273 4724 9771 38738 52962 61952 62721 104257 128583 143749 151138 158269 451 1543 4599 22949 23285 23753 34782 49103 51188 74842 90039 91048 94263 101002 118194 124446 132668 145275 151122 167673 173583 887 12354 16212 24027 27050 3...
result:
ok AC
Test #15:
score: 0
Accepted
time: 183ms
memory: 16072kb
input:
100000 200000 9046132 -9046132 -9036450 9036450 -9419376 -9419376 9775641 -9775641 -9561024 -9561024 9314457 -9314457 -9542725 -9542725 9441387 9441387 -9331034 -9331034 -9653540 9653540 -9914585 9914585 9434612 9434612 -9219316 9219316 9124798 9124798 9841837 9841837 -9145939 -9145939 9317396 93173...
output:
1589 4514 6244 8115 11151 12294 12746 14514 15528 16850 17584 18224 18896 19912 23802 29178 31312 32763 33821 38837 39710 47210 47585 53439 54997 57073 61966 63794 67248 67656 67864 71986 74452 88789 94015 98801 100969 106564 107289 109151 110788 119882 120665 124223 129962 133512 135841 140720 1424...
result:
ok AC
Test #16:
score: 0
Accepted
time: 296ms
memory: 16744kb
input:
99994 199994 4956621 4956621 -4358823 -4358823 1056343 1056343 -9986 -9986 -7565 7565 3063855 3063855 -15131 15131 -943318 -943318 20729 20729 4624729 -4624729 2636623 -2636623 -19923 19923 3883762 3883762 -7257661 7257661 8029 -8029 23678 23678 -20009 20009 -7424 7424 -5431 -5431 -32667 -32667 4562...
output:
178042 174344 147823 167630 31731 48498 68799 73187 112988 146935 72808 105555 111752 111917 119213 140162 150533 151584 157823 159969 174076 177849 179026 193548 193576 195 2897 38440 40745 41585 41902 49212 50820 57762 61766 146095 146889 153839 169401 174250 184440 195775 197889 15584 34753 35899...
result:
ok AC
Test #17:
score: 0
Accepted
time: 292ms
memory: 18560kb
input:
100000 200000 -4834102 -4834102 5022121 5022121 6712316 -6712316 501609 501609 -6567565 -6567565 2112388 2112388 135850 135850 9040818 9040818 -7430373 -7430373 -280592 280592 -7143119 7143119 8061435 -8061435 7982642 7982642 4434783 -4434783 6517450 6517450 -1450938 1450938 5380539 -5380539 -467314...
output:
1091 87930 160873 178274 2597 25060 33256 40447 87153 124543 147676 164732 174613 176531 22397 32269 64411 68956 69146 105323 107100 117693 137259 143924 145622 159046 183714 188574 188700 3729 11345 21689 58181 58647 61957 63058 64141 67871 77109 82190 84034 99623 108996 131562 149119 150771 154347...
result:
ok AC
Test #18:
score: 0
Accepted
time: 300ms
memory: 16904kb
input:
100000 200000 -4054600 4054600 -7279300 7279300 -7314500 7314500 -7425563 -7425563 9683145 -9683145 5107500 -5107500 8673600 -8673600 -5867000 5867000 -5227842 5227842 157100 -157100 -9963728 9963728 9768949 -9768949 -5435576 5435576 3784700 -3784700 4851500 -4851500 1340500 1340500 126129 -126129 -...
output:
111122 131410 117601 137024 26868 156428 32438 151446 86185 1314 1382 4413 9986 21624 34927 43121 73341 95891 101371 145198 172484 186262 151037 115028 18707 23749 28888 34861 43051 57191 58701 73883 89514 92604 97496 107586 123210 133276 153556 160168 168081 169087 171525 177104 87268 178525 113181...
result:
ok AC
Test #19:
score: 0
Accepted
time: 318ms
memory: 18868kb
input:
100000 200000 862879 862879 1706435 1706435 3765244 3765244 -308612 -308612 -1794479 1794479 -2257534 2257534 -723517 723517 -3244580 3244580 887265 887265 -1954969 -1954969 1397202 -1397202 -318905 -318905 -4927517 -4927517 -1328060 -1328060 3126144 3126144 -2144656 2144656 1433235 1433235 3902973 ...
output:
159231 160944 190104 101640 138906 198216 4541 29952 21803 1351 87175 122964 183732 196719 35295 102710 148652 84468 33049 158064 78806 5351 6123 11237 44005 104861 110736 118927 157010 144975 127935 150647 21552 44381 45046 46943 63704 167057 75835 162945 61048 36711 157889 158930 175528 48545 9174...
result:
ok AC
Test #20:
score: 0
Accepted
time: 316ms
memory: 17036kb
input:
100000 200000 3759321 -3759321 3655283 3655283 -3682409 3682409 5518887 -5518887 127820 -127820 357474 357474 -2169485 -2169485 -6574572 6574572 -6166766 6166766 -2287638 -2287638 6842868 -6842868 6145121 -6145121 1834545 -1834545 -4493202 -4493202 -2423151 2423151 -5017153 -5017153 -1814368 -181436...
output:
44111 89684 182233 183996 165141 31218 11766 67156 91384 103914 141362 163710 129819 16069 143280 120992 185752 194704 149827 37254 140762 151066 193880 19141 69841 108405 142044 114917 152446 36220 43321 65370 177829 59501 167702 58438 165192 2608 110865 145719 164881 174422 139371 189009 197804 13...
result:
ok AC
Subtask #3:
score: 0
Wrong Answer
Dependency #1:
100%
Accepted
Dependency #2:
100%
Accepted
Test #21:
score: 0
Wrong Answer
time: 329ms
memory: 16824kb
input:
99995 199999 5320759 3219017 -7891980 -7312757 2180279 9474165 5031926 -4436871 -7629930 762411 -9918337 2445040 7782870 -3248418 5660195 -6031840 -3452958 -2244908 9268868 -3566739 8119257 -3126185 6361275 -4963409 1043913 -6959661 7088913 -5089638 -9265623 -9227310 2423735 8343518 -4698952 8406424...
output:
111580 184150 60437 93941 115915 136545 161873 173516 181188 182427 190825 43071 52648 93283 97706 124100 162586 168571 187185 9798 29815 43154 51604 54883 95019 98851 101639 140530 161316 199609 31286 36358 46720 71122 79614 112374 132802 166517 168489 171902 173535 179924 186936 196239 197717 1185...
result:
wrong answer cost > 1.8e8