QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#390740 | #4345. hpmo / 赫露艾斯塔 | Crysfly | 20 | 405ms | 19372kb | C++17 | 2.3kb | 2024-04-15 20:51:13 | 2024-04-15 20:51:15 |
Judging History
answer
//test
#include<bits/stdc++.h>
#define mp make_pair
#define mt make_tuple
#define eb emplace_back
#define pb push_back
#define pc putchar
#define chkmx(a,b) (a)=max((a),(b))
#define chkmn(a,b) (a)=min((a),(b))
#define fi first
#define se second
using namespace std;
template<class T>
void read(T&x){x=0;char c=getchar();bool f=0;for(;!isdigit(c);c=getchar())f^=c=='-';for(;isdigit(c);c=getchar())x=x*10+c-'0';if(f)x=-x;}
template<class T,class ...ARK>void read(T&x,ARK&...ark){read(x);read(ark...);}
template<class T>void write(T x){if(x<0)pc('-'),x=-x;if(x>=10)write(x/10);pc(x%10+'0');}
template<class T,class ...ARK>void write(T x,ARK...ark){write(x);pc(' ');write(ark...);}
template<class ...ARK>void writeln(ARK...ark){write(ark...);pc('\n');}
typedef long long ll;
const int mod=998244353;
struct mint{
int x;mint(int o=0){x=o;}mint&operator+=(mint a){return(x+=a.x)%=mod,*this;}mint&operator-=(mint a){return(x+=mod-a.x)%=mod,*this;}
mint&operator*=(mint a){return(x=1ll*x*a.x%mod),*this;}mint&operator^=( int b){mint a=*this;x=1;while(b)(b&1)&&(*this*=a,1),a*=a,b>>=1;return*this;}
mint&operator/=(mint a){return*this*=(a^=mod-2);}friend mint operator+(mint a,mint b){return a+=b;}friend mint operator-(mint a,mint b){return a-=b;}
friend mint operator*(mint a,mint b){return a*=b;}friend mint operator/(mint a,mint b){return a/=b;}friend mint operator^(mint a, int b){return a^=b;}
mint operator-(){return 0-*this;}bool operator==(const mint b)const{return x==b.x;}
};
mt19937 rnd(chrono::steady_clock::now().time_since_epoch().count());
int rint(int l,int r){return uniform_int_distribution<int>(l,r)(rnd);}
#define lowbit(x) ((x)&-(x))
#define mid ((l+r)>>1)
#define lc (x<<1)
#define rc (x<<1|1)
const int N=2e5+10;
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(){
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&&(!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])writeln(j.se);
}
return 0;
}
详细
Subtask #1:
score: 20
Accepted
Test #1:
score: 20
Accepted
time: 14ms
memory: 9536kb
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 7 25 7947 1075 1106 6948 8010 8766 9286 233 2796 6699 7474 2619 3783 1895 1389 2871 3408 3474 4055 4295 8839 9116 6509 3849 4121 4429 5741 7365 8356 9871 8902 2051 3247 6049 8964 6215 5380 471 2608 6158 9703 32 65 353 388 460 977 1187 1234 1414 1590 1849 1954 2187 2231 2...
result:
ok AC
Test #2:
score: 0
Accepted
time: 22ms
memory: 9540kb
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 971 3931 8974 8169 8209 5519 8757 1366 2803 4052 2873 4419 5886 6177 7429 1085 2969 3419 4642 4919 5629 6206 6457 7645 8573 9082 9820 9860 8352 5312 85 2669 4892 6451 7171 2395 7952 7000 3752 9157 1136 3644 9018 2701 5123 2179 12 49 395 456 457 560 597 619 662 692 702 960 999 1121 1198 1263 138...
result:
ok AC
Test #3:
score: 0
Accepted
time: 22ms
memory: 9288kb
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 2814 2987 5399 5549 8802 7560 7364 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 7092 7435 8675 2701 7349 9414 1061 6435 6837 9549...
result:
ok AC
Test #4:
score: 0
Accepted
time: 21ms
memory: 9480kb
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 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 6870 1699 3160 391 9644 6215 2387 7617 1189 1844 506 2998 6255 6592 9695 949 1825 2096 4234 8959 2600 7293 553...
result:
ok AC
Test #5:
score: 0
Accepted
time: 17ms
memory: 9356kb
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: 17ms
memory: 9540kb
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:
3142 1754 4228 1699 7114 9638 5331 4133 271 409 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 4509 4632 4640 5146 5332 5396 5816 6095 6253 6601 6684 6738 6792 6794 7286 7314 7608 7611 7641 7796 8200 8222 8240 8313 8507 8555...
result:
ok AC
Test #7:
score: 0
Accepted
time: 21ms
memory: 9300kb
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: 22ms
memory: 9388kb
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:
5323 1834 9417 1179 2449 1140 8329 9187 4076 6594 6944 9934 1222 2764 3153 4715 5727 6351 8678 9182 9248 9580 8052 5047 2890 3439 5963 6874 8806 8504 3729 6857 9975 6035 2473 6458 4516 7334 3464 4720 4087 137 546 707 717 747 802 984 999 1018 1152 1293 1338 1381 1507 1532 1624 1731 1804 1866 2141 217...
result:
ok AC
Test #9:
score: 0
Accepted
time: 19ms
memory: 9280kb
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:
942 4285 9168 7852 4511 9503 5788 9344 6346 682 1203 6215 4538 2330 3270 2815 7410 1475 1100 2198 2912 3515 3933 4888 5340 5833 6746 7471 7635 7817 8505 8507 9514 9608 7815 7186 3509 4242 3944 156 5005 9044 9191 4053 7447 8780 2608 3041 5332 5825 8208 4524 3791 3286 3846 5184 1170 2965 5935 9906 987...
result:
ok AC
Test #10:
score: 0
Accepted
time: 22ms
memory: 9420kb
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:
4220 4302 2468 2952 4724 5585 4088 1164 1228 2452 2778 5040 6130 8259 6420 5487 157 4917 3335 548 975 1746 3401 3549 4228 4953 2715 8349 7544 8939 1284 285 854 2368 3647 5598 6326 9917 6497 1050 7554 6345 4328 1276 2040 601 883 968 1502 1813 2444 2510 2707 2834 3523 3627 3674 4046 4089 4293 4319 440...
result:
ok AC
Subtask #2:
score: 0
Wrong Answer
Test #11:
score: 0
Wrong Answer
time: 405ms
memory: 19372kb
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:
7085 176001 156867 64927 3533 37899 44954 76431 84604 95692 124761 144658 154802 170994 171105 190575 15442 21297 29400 34720 34956 37264 43771 57713 73522 98105 104555 108040 136672 148472 158881 178459 179460 180932 189520 76203 4317 19607 23612 32432 43651 46627 57208 57852 84166 90846 94172 9495...
result:
wrong answer cost > 1.8e8
Subtask #3:
score: 0
Skipped
Dependency #1:
100%
Accepted
Dependency #2:
0%