QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#863218#9869. Horizon ScanningCocoderRE 21ms4352kbC++14775b2025-01-19 14:41:262025-01-19 14:41:28

Judging History

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

  • [2025-01-19 14:41:28]
  • 评测
  • 测评结果:RE
  • 用时:21ms
  • 内存:4352kb
  • [2025-01-19 14:41:26]
  • 提交

answer

#include <bits/stdc++.h>
#define ll long long
#define endl '\n'
#define pi 3.14159265358979
using namespace std;

const int N=2e5+10;
double deg[N];
int n,k;
void solve()
{
    cin>>n>>k;
    for(int i=1;i<=n;i++)
    {
        int x,y;
        cin>>x>>y;
        deg[i]=atan2(y,x);
    }
    sort(deg+1,deg+n+1);
    for(int i=1;i<=n;i++)
        deg[i+n]=deg[i]+2*pi;
    int l=1,r=k+1;
    double ans=0,tmp,lastans=0;
    while(l<=n)
    {
        tmp=deg[r]-deg[l];
        ans=max(ans,tmp);
        l++;
        r++;
    }
    cout<<fixed<<setprecision(8);
    cout<<ans<<endl;
    return ;
}
signed main()
{
    ios::sync_with_stdio(0),cin.tie(0),cout.tie(0);
    int o=1;
    cin>>o;
    while(o--) solve();
    return 0;
}


Details

Tip: Click on the bar to expand more detailed information

Test #1:

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

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.28318531
1.57079633
5.49778714
3.14159265
3.14159265

result:

ok 5 numbers

Test #2:

score: 0
Accepted
time: 18ms
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.69299150
2.57486344
4.65275827
2.77263311
5.74276581
4.85769899
3.41989231
2.81279996
6.28318531
6.28318531
5.11728077
6.14678270
3.84208902
2.34249672
3.46334321
6.28318531
5.96143475
3.32470347
5.26277493
5.67245934
1.67387794
1.11419085
2.40877755
6.28318531
5.35589009
3.79986062
4.19324287
4.0...

result:

ok 10000 numbers

Test #3:

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

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.92699082
6.28318531
3.36026160
2.67794504
3.77038894
1.76258447
3.84025248
5.49778714
2.03444394
1.81577499
4.34718753
6.14128825
5.17603659
5.46554026
5.76903915
4.36625302
5.99475575
4.89224248
4.17196948
5.67764064
5.96143475
3.50679410
4.54297594
5.30039158
4.49372003
3.14159265
6.28318531
6.2...

result:

ok 10000 numbers

Test #4:

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

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.90978454
1.97568811
1.98686083
3.92699082
3.69775888
6.28318531
6.14128825
6.19387131
5.80535425
6.25289155
5.72887781
3.09009184
1.89254688
5.63418975
2.89661399
6.28318531
2.91479381
6.14765759
1.95130270
5.56435531
5.49778714
3.09814176
4.39063843
3.90944876
2.64152391
6.15883031
5.87829352
6.2...

result:

ok 10000 numbers

Test #5:

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

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.23931956
5.27570524
5.30039158
5.38712992
5.88839419
4.11731936
1.13838855
1.51529782
6.14765759
6.15883031
2.57486344
5.94016137
1.60851428
4.60994513
5.07115965
4.23455793
3.79058821
4.03764804
3.91600225
1.06369782
4.28098825
5.85725565
3.40784470
5.42101525
2.95624470
1.67046498
5.86985490
4.3...

result:

ok 10000 numbers

Test #6:

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

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.13787530
6.28318531
6.11803663
3.20034848
2.65375621
6.25378202
3.60524026
3.55981698
1.50914616
5.92754942
6.25879990
2.62244654
4.39383330
5.49778714
4.24874137
5.49778714
4.62924775
3.54648444
6.00488565
1.19675190
2.88544127
6.20004408
1.92378671
5.66293582
5.74276581
4.51499342
3.72959526
5.0...

result:

ok 10000 numbers

Test #7:

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

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.27130940
6.28318531
5.22251472
6.00306570
3.92587214
5.54652900
3.21031492
3.03993005
4.22753178
3.03201967
2.19121523
3.03900809
4.33132715
6.28318531
5.11000227
2.94631403
5.17603659
5.69918357
2.06117987
6.28318531
2.22788979
6.17077486
6.28318531
6.28318531
6.28234000
2.71933400
6.28318531
6.2...

result:

ok 10000 numbers

Test #8:

score: 0
Accepted
time: 16ms
memory: 4224kb

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.58911263
2.97975522
0.28379411
2.03502771
4.88798114
1.00406711
4.74570998
5.32559633
4.31027496
5.60338368
1.57980509
4.32964547
5.54722210
1.46013911
1.53104455
2.87167493
2.63257897
3.12405059
0.68052122
5.42016564
4.77895714
2.40303520
4.27998120
4.67850365
4.00376271
3.76707769
4.58268644
1.3...

result:

ok 100 numbers

Test #9:

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

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.91151100
3.74386852
2.53848286
2.15996736
4.29503771
4.77167447
4.68240781
5.07898439
1.60080182
3.34040255
3.36879253
2.11301603
4.85539941
4.32400105
0.10785356
0.17982112
5.37665476
4.44956602
4.39440167
2.93818487

result:

ok 20 numbers

Test #10:

score: -100
Runtime Error

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:


result: