UOJ Logo

NOI.AC

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#209264#3770. 三角形zhuangmingyi10017ms1344kbC++11421b2024-08-04 08:38:512024-08-04 12:02:39

answer

#include <bits/stdc++.h>
using namespace std;
long double a[5];
int main()
{
    int T;
    cin >> T;
    while (T--)
    {
        cin >> a[1] >> a[2] >> a[3];
        sort(a + 1, a + 4);
        if (a[1] * a[1] + a[2] * a[2] > a[3] * a[3]) cout << 0 << endl;
        else if (a[1] * a[1] + a[2] * a[2] < a[3] * a[3]) cout << 1 << endl;
        else printf("%.5llf\n", a[1] / a[3]);
    }
    return 0;
}

详细

小提示:点击横条可展开更详细的信息

Test #1:

score: 10
Accepted
time: 0ms
memory: 1304kb

input:

10
34 27 17
12 9 17
31 73 46
91 22 82
12 8 8
20 7 21
74 98 46
51 68 43
76 47 37
5 6 7

output:

1
1
1
1
1
0
1
1
1
0

result:

ok 10 tokens

Test #2:

score: 10
Accepted
time: 0ms
memory: 1300kb

input:

100
95 31 94
95 35 70
36 81 69
14 28 39
23 21 35
17 7 11
70 87 91
97 24 82
81 49 87
25 9 33
5 6 10
8...

output:

0
1
1
1
1
1
0
1
0
1
1
1
1
1
0
0
1
0
0
1
1
1
0
0
0
0
1
1
1
0
1
1
1
1
0
1
1
1
0
1
1
1
1
0
1
1
1
0
1
0
...

result:

ok 100 tokens

Test #3:

score: 10
Accepted
time: 0ms
memory: 1304kb

input:

20
56 9 63
1 22 22
47 23 30
72 88 65
28 44 68
51 83 34
13 6 9
78 23 62
56 7 51
1 1 1
54 47 29
47 16 ...

output:

1
0
1
0
1
1
1
1
1
0
0
1
1
1
0
0
1
1
1
1

result:

ok 20 tokens

Test #4:

score: 10
Accepted
time: 0ms
memory: 1304kb

input:

99
5 2 5
48 66 42
71 84 86
7 7 5
20 32 15
13 10 7
41 52 12
18 13 23
20 17 4
78 75 36
25 7 21
2 1 2
6...

output:

0
1
0
0
1
1
1
1
1
0
1
0
1
0
1
0
0
0
1
1
1
0
0
0
1
1
1
0
1
0
0
1
0
1
0
0
0
1
0
1
0
1
0
1
0
1
1
1
0
1
...

result:

ok 99 tokens

Test #5:

score: 10
Accepted
time: 0ms
memory: 1344kb

input:

10
85 40 75
45 36 27
2 5 5
64 92 94
13 29 37
68 51 85
60 68 32
45 70 65
40 75 85
76 95 57

output:

0.47059
0.60000
0
0
1
0.60000
0.47059
0
0.47059
0.60000

result:

ok 10 tokens

Test #6:

score: 10
Accepted
time: 0ms
memory: 1340kb

input:

100
40 9 41
18 8 15
12 41 34
78 14 75
40 15 40
30 78 72
24 51 45
3 6 6
91 84 35
32 60 68
21 32 41
75...

output:

0.21951
1
1
1
0
0.38462
0.47059
0
0.38462
0.47059
1
0
0.47059
0.21951
0.60000
1
1
0.38462
1
1
0.6000...

result:

ok 100 tokens

Test #7:

score: 10
Accepted
time: 0ms
memory: 1344kb

input:

1000
65 52 39
451 99 440
996 990 9
315 350 208
476 224 420
10 47 53
410 90 400
344 731 645
456 760 6...

output:

0.60000
0.21951
1
0
0.47059
1
0.21951
0.47059
0.60000
1
1
0.21951
0.47059
0.38462
0
0.47059
0.47059
...

result:

ok 1000 tokens

Test #8:

score: 10
Accepted
time: 7ms
memory: 1340kb

input:

800
1781245 4992399 4882112
3505904 6573570 7450046
2162898 9853202 9612880
4249032 9029193 7966935
...

output:

0
0.47059
0.21951
0.47059
0.21951
0
1
0
0.21951
0.21951
0
1
0.38462
0
0.60000
0.60000
1
0
1
1
0.6000...

result:

ok 800 tokens

Test #9:

score: 10
Accepted
time: 6ms
memory: 1340kb

input:

1000
270622804 199429949 189169997
401450115 111937951 336898080
381770117 155202254 255039280
73493...

output:

0
1
1
1
0
0.21951
0.38462
0
0.21951
0.60000
1
0.47059
0
1
1
1
0.38462
1
0.38462
1
0.38462
1
1
0.3846...

result:

ok 1000 tokens

Test #10:

score: 10
Accepted
time: 4ms
memory: 1340kb

input:

2000
601063395 320567144 681205181
307111520 737067648 798489952
515659944 687546592 859433240
82618...

output:

0.47059
0.38462
0.60000
1
0.38462
1
1
1
1
0
0.47059
0
0.38462
0
1
1
0.38462
1
0.21951
1
0
1
0.47059
...

result:

ok 2000 tokens

Extra Test:

score: 0
Extra Test Passed