CSES - Datatähti Open 2019 - Results
Submission details
Task:Function
Sender:DovydasVad
Submission time:2019-01-19 19:44:13 +0200
Language:C++
Status:READY
Result:0
Feedback
groupverdictscore
#10
#20
Test results
testverdicttimegroup
#10.02 s1details
#20.02 s1details
#30.02 s1details
#40.03 s1details
#50.29 s1details
#60.06 s1details
#70.04 s1details
#80.07 s1details
#90.04 s1details
#100.03 s2details
#110.03 s2details
#120.02 s2details
#130.01 s2details
#140.30 s2details
#150.31 s2details
#160.30 s2details
#170.30 s2details
#180.22 s2details
#190.22 s2details
#200.20 s2details
#210.01 s2details
#22--2details
#23--2details
#24--2details
#25--2details
#26--2details
#27--2details
#28--2details
#29--2details
#300.02 s2details
#310.02 s2details
#320.03 s2details
#330.02 s2details
#340.30 s2details
#35--2details

Code

#include <bits/stdc++.h>

using namespace std;

int main()
{
    ios::sync_with_stdio(false);
    int t, n, g1, g2, g3, g4;
    long double X0, Y0, X, Y, l, r, L, R, pi=3.14159265;
    cin >> t;
    for (int i = 0; i < t; i++)
    {
        g1 = 1;
        g2 = 1;
        g3 = 1;
        g4 = 1;
        cin >> n;
        cin >> X0 >> Y0;
        L = -4*pi;
        R = 4*pi;
        for (int y = 1; y < n; y++)
        {
            cin >> X >> Y;
            if (X-X0 == 0)
            {
                if (Y > Y0)
                {
                    g1 = 0;
                    l = 0;
                }
                else
                {
                    g2 = 0;
                    l = -2*pi;
                }
            }
            else if (Y-Y0 == 0)
            {
                if (X > X0)
                {
                    l = -1*pi;
                    g3 = 0;
                }
                else
                {
                    l = pi;
                    g4 = 0;
                }
            }
            else
                l = fabs(atan(fabs(Y-Y0)/fabs(X-X0)));
            if (Y > Y0 && X > X0)
            {
                l -= pi;
            }
            else if (Y < Y0 && X > X0)
            {
                l -= 2*pi;
            }
            else if (Y < Y0 && X < X0)
            {
                l -= 2*pi + (pi - l);
            }
            else if (Y > Y0 && X < X0)
            {
                l -= 3*pi + (pi - l);
            }
            if (l < -4*pi)
            {
                l += 4*pi;
            }
            r = l + 2*pi;
            L = max(L,l);
            R = min(R,r);
            X0 = X;
            Y0 = Y;
            cout << l << " " << r << endl;
        }
        if (g3 == 0 && g4 == 0)
        {
            cout << "NO";
        }
        else if (L < R && (g1 == 1 || g2 == 1))
        {
            cout << "YES";
        }
        else
        {
            cout << "NO";
        }
        cout << "\n";
    }
    return 0;
}

Test details

Test 1

Group: 1

Verdict:

input
12
2
0 0
1 1
5
...

correct output
YES
YES
NO
YES
YES
...

user output
-2.35619 3.92699
YES
-1.67046 4.61272
-4.81206 1.47113
-1.67046 4.61272
...
Truncated

Test 2

Group: 1

Verdict:

input
100
2
92 30
22 44
2
...

correct output
YES
YES
YES
YES
YES
...

user output
-12.1716 -5.88839
YES
-3.13493 3.14826
YES
-2.85554 3.42764
...
Truncated

Test 3

Group: 1

Verdict:

input
100
3
-55 -98
-59 -55
-2 88
...

correct output
YES
YES
YES
YES
YES
...

user output
-9.61029 -3.32711
-1.9501 4.33309
NO
-8.29815 -2.01496
-6.07779 0.205395
...
Truncated

Test 4

Group: 1

Verdict:

input
100
4
87 81
-84 42
18 -46
...

correct output
YES
YES
YES
YES
YES
...

user output
-8.97631 -2.69312
-5.57134 0.711847
-12.1716 -5.88839
NO
-6.04207 0.241118
...
Truncated

Test 5

Group: 1

Verdict:

input
100
1000
-81 38
92 -21
-10 -65
...

correct output
NO
NO
NO
NO
NO
...

user output
-5.95451 0.328671
-8.61027 -2.32708
-1.673 4.61018
-2.61082 3.67237
-11.6458 -5.36262
...
Truncated

Test 6

Group: 1

Verdict:

input
100
110
-99 -9
-98 -9
-96 -8
...

correct output
NO
NO
NO
NO
NO
...

user output
-3.14159 3.14159
-2.67795 3.60524
-6.28319 0
-2.81984 3.46334
-3.14159 3.14159
...
Truncated

Test 7

Group: 1

Verdict:

input
100
78
-100 95
-99 96
-98 95
...

correct output
NO
NO
NO
NO
NO
...

user output
-2.35619 3.92699
-5.49779 0.785398
-3.14159 3.14159
-6.03821 0.244979
-2.67795 3.60524
...
Truncated

Test 8

Group: 1

Verdict:

input
100
201
-100 97
-100 96
-99 99
...

correct output
NO
NO
NO
NO
NO
...

user output
-6.28319 0
-1.89255 4.39064
-6.28319 0
-3.14159 3.14159
-5.81954 0.463648
...
Truncated

Test 9

Group: 1

Verdict:

input
100
45
-100 89
-100 90
-97 90
...

correct output
YES
NO
NO
NO
NO
...

user output
0 6.28319
-3.14159 3.14159
0 6.28319
-3.14159 3.14159
-5.81954 0.463648
...
Truncated

Test 10

Group: 2

Verdict:

input
13
2
0 0
1 1
5
...

correct output
YES
YES
NO
YES
YES
...

user output
-2.35619 3.92699
YES
-1.67046 4.61272
-4.81206 1.47113
-1.67046 4.61272
...
Truncated

Test 11

Group: 2

Verdict:

input
100
2
-517113909 -39540276
-209411537 -831819487
2
...

correct output
YES
YES
YES
YES
YES
...

user output
-5.08283 1.20035
YES
-1.93667 4.34652
YES
-4.99458 1.28861
...
Truncated

Test 12

Group: 2

Verdict:

input
100
3
-991349544 139282777
646238126 16140762
-4488261 817588303
...

correct output
YES
YES
YES
YES
YES
...

user output
-6.20813 0.0750559
-10.7887 -4.50555
YES
-7.14436 -0.861177
-2.40465 3.87853
...
Truncated

Test 13

Group: 2

Verdict:

input
100
4
891187584 -889373775
-453505448 -469134344
-683807769 8725517
...

correct output
YES
NO
YES
NO
NO
...

user output
-11.9606 -5.67738
-10.323 -4.03979
-1.98143 4.30176
NO
-10.2346 -3.95141
...
Truncated

Test 14

Group: 2

Verdict:

input
100
1000
-866614983 -994037153
775605588 -328510132
390868551 927606059
...

correct output
NO
NO
NO
NO
NO
...

user output
-2.75656 3.52663
-10.0192 -3.73603
-7.45809 -1.17491
-5.70669 0.576496
-11.6138 -5.33065
...
Truncated

Test 15

Group: 2

Verdict:

input
100
1000
-911073332 -1000000000
-905159999 -1000000000
-904949593 -999999999
...

correct output
YES
YES
YES
NO
NO
...

user output
-3.14159 3.14159
-3.14159 3.1416
-6.28318 2.04229e-06
-3.14159 3.14159
-3.14159 3.14159
...
Truncated

Test 16

Group: 2

Verdict:

input
100
1000
-1000000000 950042028
-946551105 -1000000000
-940508390 -1000000000
...

correct output
NO
YES
YES
YES
NO
...

user output
-4.73979 1.54339
-3.14159 3.14159
-3.14159 3.14159
-9.48642 -3.20323
-4.74686 1.53633
...
Truncated

Test 17

Group: 2

Verdict:

input
100
1000
-949977239 -1000000000
-948279892 -1000000000
-947497811 -999999999
...

correct output
YES
YES
YES
YES
YES
...

user output
-3.14159 3.14159
-3.14159 3.14159
-6.28318 3.22043e-07
-3.14159 3.14159
-3.14159 3.14159
...
Truncated

Test 18

Group: 2

Verdict:

input
100
806
-899 -1000
-898 -1000
-896 -999
...

correct output
NO
NO
NO
NO
NO
...

user output
-3.14159 3.14159
-2.67795 3.60524
-6.08579 0.197396
-3.14159 3.14159
-2.67795 3.60524
...
Truncated

Test 19

Group: 2

Verdict:

input
100
777
-1000 914
-1000 915
-999 916
...

correct output
NO
NO
NO
NO
NO
...

user output
0 6.28319
-2.35619 3.92699
3.14159 9.42478
-6.28319 0
-2.03444 4.24874
...
Truncated

Test 20

Group: 2

Verdict:

input
100
775
-999 998
-995 -1000
-994 -1000
...

correct output
NO
NO
NO
NO
NO
...

user output
-4.71439 1.56879
-3.14159 3.14159
0 6.28319
-6.03821 0.244979
-9.42678 -3.14359
...
Truncated

Test 21

Group: 2

Verdict:

input
13
2
0 0
1 1
5
...

correct output
YES
YES
NO
YES
YES
...

user output
-2.35619 3.92699
YES
-1.67046 4.61272
-4.81206 1.47113
-1.67046 4.61272
...
Truncated

Test 22

Group: 2

Verdict:

input
1
999748
-995394098 -1000000000
-995392159 -1000000000
-995386584 -999999999
...

correct output
NO

user output
(empty)

Test 23

Group: 2

Verdict:

input
1
1000000
-954368893 -1000000000
-954366895 -1000000000
-954364896 -999999999
...

correct output
YES

user output
(empty)

Test 24

Group: 2

Verdict:

input
1
1000000
-1000000000 928772368
-1000000000 928772506
-999999999 928772642
...

correct output
YES

user output
(empty)

Test 25

Group: 2

Verdict:

input
1
999754
-901705699 -1000000000
-901702695 -1000000000
-901702062 -999999999
...

correct output
NO

user output
(empty)

Test 26

Group: 2

Verdict:

input
100
10000
-1000000000 919783772
-918885599 -1000000000
-918825263 -1000000000
...

correct output
NO
YES
YES
NO
NO
...

user output
(empty)

Test 27

Group: 2

Verdict:

input
10
99998
-997024120 -77018772
-997011201 -77017738
-996986132 -77015834
...

correct output
YES
YES
NO
YES
YES
...

user output
(empty)

Test 28

Group: 2

Verdict:

input
100
7934
-10000 9905
-10000 9906
-9999 9906
...

correct output
NO
NO
NO
NO
NO
...

user output
(empty)

Test 29

Group: 2

Verdict:

input
100
9710
-99754 -6983
-99786 -6055
-99751 -6548
...

correct output
YES
NO
NO
NO
NO
...

user output
(empty)

Test 30

Group: 2

Verdict:

input
100
2
802396401 -641287652
30956766 -527704723
2
...

correct output
YES
YES
YES
YES
YES
...

user output
-12.274 -5.99082
YES
-6.15021 0.132976
YES
-9.88621 -3.60302
...
Truncated

Test 31

Group: 2

Verdict:

input
100
3
755025461 -953536159
-402145543 137775005
-700733185 821755784
...

correct output
YES
YES
YES
YES
YES
...

user output
-11.0541 -4.77095
-10.248 -3.96481
YES
-1.93965 4.34354
-7.60745 -1.32426
...
Truncated

Test 32

Group: 2

Verdict:

input
100
4
-673213071 571383249
-963633735 -859013318
-591788323 791136643
...

correct output
NO
NO
NO
NO
YES
...

user output
-6.68381 -0.400624
-1.79243 4.49075
-7.06932 -0.78613
YES
-7.03399 -0.750808
...
Truncated

Test 33

Group: 2

Verdict:

input
100
5
-124483012 623794901
233757283 -234519096
-987338502 737259422
...

correct output
NO
NO
YES
NO
NO
...

user output
-5.10778 1.1754
-11.222 -4.93881
-5.68937 0.593819
-10.286 -4.00281
YES
...
Truncated

Test 34

Group: 2

Verdict:

input
100
1000
154383911 872030445
-9594726 190227899
908758769 -9615631
...

correct output
NO
NO
NO
NO
NO
...

user output
-6.75523 -0.47205
-6.06892 0.21427
-11.589 -5.30582
-5.50262 0.780564
-1.82823 4.45496
...
Truncated

Test 35

Group: 2

Verdict:

input
100
10000
642800667 -694556052
-343795089 -341227394
800920828 676674460
...

correct output
NO
NO
NO
NO
NO
...

user output
(empty)