QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#817325#2362. Contest StrugglesSGColinAC ✓0ms3948kbC++20315b2024-12-16 21:43:192024-12-16 21:43:23

Judging History

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

  • [2024-12-16 21:43:23]
  • 评测
  • 测评结果:AC
  • 用时:0ms
  • 内存:3948kb
  • [2024-12-16 21:43:19]
  • 提交

answer

#include <bits/stdc++.h>
using namespace std;

int main() {
	int n, m, d, s;
	scanf("%d%d%d%d", &n, &m, &d, &s);
	int tot = n * d;
	int nw = m * s;
	if (nw > tot || tot > nw + (n - m) * 100) {puts("impossible"); return 0;}
	double ans = 1.0 * (tot - nw) / (n - m);
	printf("%.10lf\n", ans);
	return 0;
}

详细

Test #1:

score: 100
Accepted
time: 0ms
memory: 3696kb

input:

319601 204125
91 83

output:

impossible

result:

ok 

Test #2:

score: 0
Accepted
time: 0ms
memory: 3760kb

input:

504174 251338
19 88

output:

impossible

result:

ok 

Test #3:

score: 0
Accepted
time: 0ms
memory: 3880kb

input:

476569 925
37 89

output:

36.8988739477

result:

ok 

Test #4:

score: 0
Accepted
time: 0ms
memory: 3712kb

input:

360918 171047
97 88

output:

impossible

result:

ok 

Test #5:

score: 0
Accepted
time: 0ms
memory: 3764kb

input:

503913 393658
18 57

output:

impossible

result:

ok 

Test #6:

score: 0
Accepted
time: 0ms
memory: 3572kb

input:

830842 701006
73 88

output:

impossible

result:

ok 

Test #7:

score: 0
Accepted
time: 0ms
memory: 3840kb

input:

375468 17258
84 38

output:

86.2162083694

result:

ok 

Test #8:

score: 0
Accepted
time: 0ms
memory: 3628kb

input:

7714 7645
55 72

output:

impossible

result:

ok 

Test #9:

score: 0
Accepted
time: 0ms
memory: 3712kb

input:

138901 100560
95 10

output:

impossible

result:

ok 

Test #10:

score: 0
Accepted
time: 0ms
memory: 3888kb

input:

856536 556401
46 61

output:

18.1924633915

result:

ok 

Test #11:

score: 0
Accepted
time: 0ms
memory: 3948kb

input:

1000000 1
100 100

output:

100.0000000000

result:

ok 

Test #12:

score: 0
Accepted
time: 0ms
memory: 3940kb

input:

2 1
0 0

output:

0.0000000000

result:

ok 

Test #13:

score: 0
Accepted
time: 0ms
memory: 3936kb

input:

1000000 1
1 0

output:

1.0000010000

result:

ok 

Test #14:

score: 0
Accepted
time: 0ms
memory: 3756kb

input:

1000000 1
0 1

output:

impossible

result:

ok 

Test #15:

score: 0
Accepted
time: 0ms
memory: 3756kb

input:

1000000 1
100 99

output:

impossible

result:

ok 

Test #16:

score: 0
Accepted
time: 0ms
memory: 3892kb

input:

1000000 1
99 100

output:

98.9999990000

result:

ok