QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#805335 | #9869. Horizon Scanning | ucup-team135# | AC ✓ | 71ms | 15148kb | C++20 | 2.1kb | 2024-12-08 15:50:30 | 2024-12-08 15:50:30 |
Judging History
answer
#include <iostream>
#include <cstdio>
#include <cstdlib>
#include <algorithm>
#include <cmath>
#include <vector>
#include <set>
#include <map>
#include <unordered_set>
#include <unordered_map>
#include <queue>
#include <ctime>
#include <cassert>
#include <complex>
#include <string>
#include <cstring>
#include <chrono>
#include <random>
#include <bitset>
#include <fstream>
#include <array>
#include <functional>
#include <stack>
#include <memory>
using namespace std;
#define int long long
#define ii pair <int, int>
#define app push_back
#define bp __builtin_popcountll
#define ll long long
#define mp make_pair
#define x first
#define y second
#define Time (double)clock()/CLOCKS_PER_SEC
#define munq(a) sort(all(a)); a.resize(unique(all(a))-a.begin())
#define sz(a) ((int)a.size())
const int p=998244353;
int po(int a,int b) {if(b==0) return 1; if(b==1) return a; if(b%2==0) {int u=po(a,b/2);return (u*1LL*u)%p;} else {int u=po(a,b-1);return (a*1LL*u)%p;}}
int inv(int x) {return po(x,p-2);}
mt19937 rnd;
#define all(x) (x).begin(),(x).end()
#ifdef LOCAL
#define debug(...) [](auto...a){ ((cout << a << ' '), ...) << endl;}(#__VA_ARGS__, ":", __VA_ARGS__)
#define debugv(v) do {cout<< #v <<" : {"; for(int izxc=0;izxc<v.size();++izxc) {cout << v[izxc];if(izxc+1!=v.size()) cout << ","; }cout <<"}"<< endl;} while(0)
#else
#define debug(...)
#define debugv(v)
#endif
#define lob(a,x) lower_bound(all(a),x)
#define upb(a,x) upper_bound(all(a),x)
double pi=acos(-1);
int32_t main()
{
ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0);
int t;cin>>t;
while(t--)
{
int n,k;cin>>n>>k;
vector<double> v;
pair<int,int> a[n];for(int i=0;i<n;++i) {cin>>a[i].first>>a[i].second;}
for(int i=0;i<n;++i) {double phi=atan2(a[i].first,a[i].second);v.app(phi-2*pi);v.app(phi);v.app(phi+2*pi);}
sort(all(v));
double res=0;
for(int i=0;i+k<v.size();++i)
{
res=max(res,v[i+k]-v[i]);
}
cout<<setprecision(25)<<res<<'\n';
}
return 0;
}
这程序好像有点Bug,我给组数据试试?
详细
Test #1:
score: 100
Accepted
time: 0ms
memory: 4108kb
input:
5 1 1 0 1 8 2 1 0 1 1 0 1 -1 1 -1 0 -1 -1 0 -1 1 -1 4 2 -1 1 0 1 0 2 1 1 4 2 -1000000000 0 -998244353 1 998244353 1 1000000000 0 3 1 0 1 0 2 0 -1
output:
6.283185307179586231995927 1.570796326794896557998982 5.497787143782137952996436 3.141592654591551792009341 3.141592653589793115997963
result:
ok 5 numbers
Test #2:
score: 0
Accepted
time: 31ms
memory: 4224kb
input:
10000 16 1 -10 -6 -5 -6 -4 9 -2 5 -2 10 1 -7 1 -5 1 6 3 1 4 -9 6 -10 6 -3 6 1 8 -5 8 -4 9 -4 17 4 -9 2 -8 -4 -8 -3 -8 -1 -6 -2 -6 -1 -6 8 -5 -8 -5 10 -4 8 -2 -8 4 -9 4 0 5 -3 8 -5 9 -2 10 10 10 6 -7 2 -4 6 -2 -7 -2 -1 -1 7 1 -9 1 8 3 -4 7 -4 9 -2 14 3 -9 10 -8 -10 -8 -8 -6 -7 -6 -5 -1 -7 -1 -2 0 -1 ...
output:
1.692991497486251439852367 2.574863436066286759285049 4.652758267253521040629494 2.772633107383937201007029 5.74276580690900217973649 4.85769899102039204308312 3.419892312594904559830411 2.812799962084838956144495 6.283185307179587120174347 6.283185307179586231995927 5.117280766669773051091852 6.146...
result:
ok 10000 numbers
Test #3:
score: 0
Accepted
time: 30ms
memory: 4260kb
input:
10000 19 7 -10 -6 -10 5 -3 0 -2 -5 -1 1 -1 6 0 3 0 7 1 9 3 -3 3 3 3 8 4 -1 5 8 6 -3 7 -5 7 4 8 10 9 -5 15 15 -9 -1 -8 6 -7 9 -6 -3 -4 -9 -1 -3 -1 8 1 -8 1 -7 3 -2 3 1 6 -9 7 -10 7 0 10 -9 10 3 -7 -1 -6 -2 -6 10 -5 2 -4 2 -3 -7 -2 -9 1 -3 3 4 7 7 15 4 -8 -8 -8 8 -7 0 -7 10 -6 -7 -5 6 -1 -3 -1 0 1 -2 ...
output:
3.926990816987241394997454 6.283185307179587120174347 3.36026159946373503828454 2.677945044588986966971333 3.770388940005226174889685 1.762584468781602353715243 3.840252478311255934784185 5.497787143782137952996436 2.034443935795703595204031 1.815774989921760784739035 4.347187530596516857883671 6.14...
result:
ok 10000 numbers
Test #4:
score: 0
Accepted
time: 30ms
memory: 4344kb
input:
10000 18 12 -10 -4 -10 7 -8 -10 -7 -4 -6 5 -6 7 -5 0 -2 -7 -1 2 -1 10 0 2 1 1 3 -2 5 3 5 5 6 -3 8 -3 9 -2 10 1 -10 -9 -7 -7 -5 2 -4 -7 -3 1 3 1 3 3 5 -4 9 2 9 6 11 2 -8 1 -8 6 -7 -2 -6 0 -5 0 -1 -9 2 -8 3 5 6 0 10 -2 10 6 20 9 -10 -6 -10 6 -9 -8 -7 5 -6 -4 -4 -8 -2 -10 -2 -3 -2 4 -1 1 2 -5 3 -2 5 -6...
output:
4.909784540234571004191366 1.975688113079979935093888 1.986860832518719366390769 3.926990816987241394997454 3.697758883710245747522549 6.283185307179586231995927 6.141288252575422212942158 6.193871314186363719045403 5.805354252187472141599756 6.252891547260810867214786 5.728877810978034723632391 3.0...
result:
ok 10000 numbers
Test #5:
score: 0
Accepted
time: 26ms
memory: 4284kb
input:
10000 19 7 -10 -1 -8 2 -7 -10 -6 6 -4 7 -3 -5 -3 1 -3 8 -2 4 -1 -7 0 -8 0 9 1 -10 2 1 2 3 3 5 6 -4 10 2 10 3 14 10 -8 2 -6 0 -5 -10 -5 10 -4 7 -3 -6 -2 -6 1 4 1 6 2 -1 3 -6 8 -4 9 -10 10 -1 12 8 -9 5 -7 2 -4 2 0 -2 0 5 1 6 3 2 4 9 5 5 7 -6 9 -9 9 2 19 12 -10 -10 -10 2 -9 -6 -8 2 -7 -5 -6 8 -4 1 -1 -...
output:
3.239319560948511700360086 5.275705241876657680677454 5.300391583932257510980435 5.387129922608242083015284 5.888394187479825347963924 4.117319356679148611988239 1.138388551224359002134179 1.51529782154918013503675 6.147657593194085556831396 6.158830312632824544039067 2.574863436066286759285049 5.94...
result:
ok 10000 numbers
Test #6:
score: 0
Accepted
time: 34ms
memory: 4216kb
input:
10000 11 10 -10 -1 -9 4 -9 10 -7 -7 -5 4 -4 -1 -2 -10 0 -7 0 5 3 3 3 5 12 12 -9 6 -9 8 -3 -2 -2 2 0 -4 1 0 2 -3 3 5 5 -2 7 -1 10 3 10 9 14 12 -10 0 -9 -3 -9 1 -9 10 -8 -1 -8 7 -6 -1 -1 -6 -1 2 1 -1 3 -7 4 9 9 -3 10 1 10 4 -9 -3 -7 -1 -6 -10 -3 -2 -3 7 2 -2 2 3 5 2 6 9 9 6 10 2 -9 -9 -9 6 -8 3 -5 -9 ...
output:
6.137875296543883862909752 6.283185307179586231995927 6.118036629764959322130835 3.200348476305515887929687 2.653756214930151013930981 6.253782018975581280528786 3.605240262590599265024593 3.559816983169023174582435 1.509146156155637630291722 5.927549422878826135274721 6.258799898006867756805605 2.6...
result:
ok 10000 numbers
Test #7:
score: 0
Accepted
time: 31ms
memory: 4220kb
input:
10000 14 1 -100 13 -96 -31 -82 -92 -77 -98 -50 1 -14 -57 -14 -31 -11 64 -8 75 9 68 25 100 54 -36 59 13 93 31 19 19 -76 -39 -60 95 -51 18 -39 11 -21 -46 -6 -94 -5 83 -3 -34 -3 72 0 -55 3 79 14 17 23 -88 32 37 50 70 61 -5 62 -43 84 -100 97 -50 13 7 -99 -63 -68 -87 -24 62 -20 -18 -2 -66 7 -49 13 -21 15...
output:
1.271309397461279466767792 6.283185307179587120174347 5.222514720736498361475242 6.003065703568918110022423 3.925872135464679058003412 5.546528995092069536099189 3.210314923711722556731729 3.03993004992372295447467 4.227531781794427345744225 3.032019665736877200856725 2.191215233818191165937606 3.03...
result:
ok 10000 numbers
Test #8:
score: 0
Accepted
time: 28ms
memory: 4360kb
input:
100 1413 755 -30 -30 -30 -28 -30 -27 -30 -26 -30 -21 -30 -12 -30 -10 -30 -8 -30 -5 -30 -1 -30 2 -30 4 -30 7 -30 9 -30 17 -30 19 -30 20 -30 23 -30 24 -30 30 -29 -29 -29 -23 -29 -15 -29 0 -29 4 -29 5 -29 9 -29 10 -29 11 -29 12 -29 14 -29 16 -29 17 -29 22 -29 27 -29 28 -28 -28 -28 -25 -28 -23 -28 -22 -...
output:
3.589112628746963018500082 2.979755222351370136379956 0.2837941092083280381075383 2.035027706891093135510573 4.887981142334870021670667 1.004067109271390201286067 4.745709976262936891089339 5.325596329259198569161526 4.310274964732927038824073 5.603383679413830087412407 1.579805092085313500405164 4....
result:
ok 100 numbers
Test #9:
score: 0
Accepted
time: 39ms
memory: 4572kb
input:
20 9045 8319 -1000 -986 -1000 -683 -1000 -430 -1000 -292 -1000 53 -1000 667 -999 -855 -999 -350 -999 -174 -999 -51 -999 -43 -999 235 -999 465 -999 530 -998 -997 -998 -311 -998 21 -998 44 -998 182 -997 -313 -997 -195 -997 -13 -997 412 -997 425 -996 -542 -996 -348 -996 -126 -996 -59 -996 -40 -996 84 -...
output:
5.911511003904026395616711 3.74386851513771201638292 2.538482858315347812094842 2.159967358857886932099746 4.295037709572344652997344 4.771674474796182785496512 4.68240781260193550394888 5.078984394174574035218939 1.600801821410663849931666 3.340402545636705688991697 3.3687925282503492496744 2.11301...
result:
ok 20 numbers
Test #10:
score: 0
Accepted
time: 49ms
memory: 11312kb
input:
1 166347 18723 -1000 -979 -1000 -975 -1000 -928 -1000 -914 -1000 -898 -1000 -889 -1000 -876 -1000 -873 -1000 -858 -1000 -840 -1000 -838 -1000 -801 -1000 -783 -1000 -744 -1000 -738 -1000 -733 -1000 -713 -1000 -712 -1000 -695 -1000 -689 -1000 -680 -1000 -675 -1000 -671 -1000 -646 -1000 -643 -1000 -608...
output:
0.8514491789805163080018247
result:
ok found '0.8514492', expected '0.8514492', error '0.0000000'
Test #11:
score: 0
Accepted
time: 46ms
memory: 10264kb
input:
1 154903 84960 -1000 -979 -1000 -965 -1000 -956 -1000 -945 -1000 -920 -1000 -901 -1000 -878 -1000 -860 -1000 -858 -1000 -709 -1000 -693 -1000 -648 -1000 -619 -1000 -602 -1000 -579 -1000 -474 -1000 -473 -1000 -454 -1000 -443 -1000 -427 -1000 -407 -1000 -403 -1000 -384 -1000 -351 -1000 -279 -1000 -244...
output:
3.538926685383166237386376
result:
ok found '3.5389267', expected '3.5389267', error '0.0000000'
Test #12:
score: 0
Accepted
time: 42ms
memory: 10476kb
input:
1 158037 96343 -1000 -1000 -1000 -905 -1000 -881 -1000 -833 -1000 -804 -1000 -803 -1000 -782 -1000 -775 -1000 -765 -1000 -759 -1000 -756 -1000 -748 -1000 -722 -1000 -674 -1000 -669 -1000 -630 -1000 -610 -1000 -573 -1000 -443 -1000 -411 -1000 -409 -1000 -403 -1000 -388 -1000 -366 -1000 -349 -1000 -33...
output:
3.972028778325880971067363
result:
ok found '3.9720288', expected '3.9720288', error '0.0000000'
Test #13:
score: 0
Accepted
time: 40ms
memory: 4192kb
input:
10000 17 12 -853202371 684059854 -659446544 -924219854 -418025687 117998679 -399757126 -365708913 -331597239 -270896799 -204989763 869548983 -118492298 963842298 -77481232 672198731 45930201 -58234380 52605147 -900097542 78371985 940503934 235210685 595759114 391284089 234315077 416229789 -827244230...
output:
5.398525110034352536558799 5.373907874856422850484705 1.173578172874161662520009 1.544365259508385879172465 3.778288649403068966137198 3.570471586852504763953675 6.282974858836158915664782 5.095925202815100085729227 2.987578246550850025187174 2.305566505801528887076302 3.390784164182034654544395 5.7...
result:
ok 10000 numbers
Test #14:
score: 0
Accepted
time: 39ms
memory: 4368kb
input:
1000 133 108 -994106086 710243426 -991027749 -548437545 -983318226 -917527783 -943673956 -368162275 -935819096 616077188 -928022346 487569673 -924213856 -369318351 -914827619 426646545 -883935180 590882141 -870015071 -270471333 -834927107 -211343853 -829266515 354007200 -788041913 -60481736 -7822837...
output:
5.742801792143195527273747 1.915364239841793825291916 3.804345798108007326021607 1.791916270531130006560261 3.169520670635203707377059 6.078646214615601728326055 3.786067459510641164399658 3.665969072687856211700819 6.226583452970444909624348 5.90215219261038992470958 5.944315709295675986822971 0.71...
result:
ok 1000 numbers
Test #15:
score: 0
Accepted
time: 44ms
memory: 4296kb
input:
100 1367 924 -999416811 990355566 -997656126 346133696 -997071616 -657387469 -996176051 12622726 -995720693 334093112 -995478093 891631278 -994503890 341858449 -994297596 499383911 -993234202 533518057 -991636838 -4170504 -990563582 -407186200 -989454027 653116272 -989132124 -780605454 -988073521 -1...
output:
4.505153490617689548969338 2.712558932627478824883838 5.839678580981966682372786 6.022977111452615162079383 0.46160604310141595263417 0.9869912332125236886781749 1.321970848834324030462994 1.925841745838059448914237 5.508608353349910835561332 4.646355331297879587282296 2.287677410207706873990219 2.1...
result:
ok 100 numbers
Test #16:
score: 0
Accepted
time: 52ms
memory: 5208kb
input:
10 13806 4955 -999669776 933068103 -999542354 721337508 -999499427 357140594 -999429088 -925180511 -999334813 -145726169 -999291694 -886327684 -999281647 811188099 -999145269 860687107 -998961821 -979442436 -998769313 446186367 -998591455 658309173 -998539751 -569480843 -998479467 279850955 -9984754...
output:
2.417080468033978135622419 6.161192229078727322644227 3.960020376842235734216047 3.994361792904594032904697 2.551550836155520141090847 0.5227238367809992070078806 4.097843827854229736828984 6.210382663158928728819319 5.981728029253966738565396 0.7772236858906000911417777
result:
ok 10 numbers
Test #17:
score: 0
Accepted
time: 44ms
memory: 11144kb
input:
1 112596 94970 -999980219 399324466 -999932413 952114487 -999894556 -951211102 -999891030 -996222974 -999864824 412806264 -999853190 -269700371 -999845814 -23906803 -999841507 -459154880 -999825178 716247149 -999761774 -154047106 -999729655 -171480333 -999709604 -666447277 -999704754 -22442485 -9996...
output:
5.442593879343851526186882
result:
ok found '5.4425939', expected '5.4425939', error '0.0000000'
Test #18:
score: 0
Accepted
time: 55ms
memory: 11472kb
input:
1 161568 13252 -999991243 -113889211 -999976572 -361096764 -999970140 -505012445 -999960654 600963873 -999959339 -269932510 -999956568 734634576 -999941447 716485764 -999940305 64397798 -999939982 746532931 -999939921 995002380 -999932747 185078659 -999927136 585216518 -999914684 898656539 -99990452...
output:
0.6424745906864974820393854
result:
ok found '0.6424746', expected '0.6424746', error '0.0000000'
Test #19:
score: 0
Accepted
time: 71ms
memory: 15148kb
input:
1 186192 126483 -999998234 974001047 -999976292 -133179660 -999967957 112862981 -999957851 70030467 -999951528 743907713 -999931316 66002112 -999907988 888991267 -999905412 470798211 -999903986 -103943462 -999900422 255729004 -999898174 917068198 -999884392 -183592605 -999880179 -650076162 -99987469...
output:
4.401245684119009737855777
result:
ok found '4.4012457', expected '4.4012457', error '0.0000000'
Test #20:
score: 0
Accepted
time: 31ms
memory: 4288kb
input:
1000 133 9 -10 -839744900 -10 -620593257 -10 -322048342 -10 578093727 -10 898998949 -9 -833794004 -9 -704882916 -9 -570204575 -9 -506146571 -9 -109555290 -9 309734100 -9 396668416 -8 -928874025 -8 376566668 -8 596463598 -8 600491164 -8 894775141 -7 -281322833 -7 49984651 -7 154512939 -7 205573228 -7...
output:
3.141592582887779983025212 6.283185248213678519846326 3.141592614424979501563939 3.141591174081442172649759 6.283185270291752999582968 6.283185295316327412251667 3.14159264922942593756261 6.283185303670099308703811 3.141592640161558591671564 6.283185250675927591146319 6.283185281648258069253643 3.14...
result:
ok 1000 numbers
Test #21:
score: 0
Accepted
time: 31ms
memory: 6052kb
input:
5 23120 8224 -10 -999575056 -10 -997485895 -10 -995458183 -10 -986953157 -10 -985268102 -10 -983223383 -10 -980910524 -10 -980404283 -10 -973605147 -10 -972441960 -10 -972440422 -10 -969122114 -10 -965754004 -10 -964812113 -10 -964558462 -10 -963159275 -10 -962972564 -10 -962085557 -10 -961552443 -1...
output:
3.141592642351389130794814 3.141592631242442923422686 3.141592606800783116227649 3.141592649395319014615779 6.283185272206923244198151
result:
ok 5 numbers
Test #22:
score: 0
Accepted
time: 23ms
memory: 9896kb
input:
1 99995 60000 1 100001 1 100002 1 100003 1 100004 1 100005 1 100006 1 100007 1 100008 1 100009 1 100010 1 100011 1 100012 1 100013 1 100014 1 100015 1 100016 1 100017 1 100018 1 100019 1 100020 1 100021 1 100022 1 100023 1 100024 1 100025 1 100026 1 100027 1 100028 1 100029 1 100030 1 100031 1 10003...
output:
6.283185306901818201197329
result:
ok found '6.2831853', expected '6.2831853', error '0.0000000'
Extra Test:
score: 0
Extra Test Passed