QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#126908 | #2362. Contest Struggles | KKT89 | AC ✓ | 1ms | 3800kb | C++14 | 855b | 2023-07-19 09:47:02 | 2023-07-19 09:47:03 |
Judging History
answer
#pragma GCC optimize("Ofast")
#include <iostream>
#include <vector>
#include <algorithm>
#include <map>
#include <queue>
#include <cstdio>
#include <ctime>
#include <assert.h>
#include <chrono>
#include <random>
#include <numeric>
#include <set>
#include <deque>
#include <stack>
#include <sstream>
#include <utility>
using namespace std;
typedef long long int ll;
typedef unsigned long long ull;
mt19937_64 rng(chrono::steady_clock::now().time_since_epoch().count());
ll myRand(ll B) {
return (ull)rng() % B;
}
int main(){
cin.tie(nullptr);
ios::sync_with_stdio(false);
ll n,k; cin >> n >> k;
ll d,s; cin >> d >> s;
ll sum = n*d - k*s;
ll m = n-k;
if(0<=sum and sum<=100LL*m){
printf("%.10f\n",(double)sum/(double)m);
}
else{
printf("impossible\n");
}
}
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 100
Accepted
time: 0ms
memory: 3516kb
input:
319601 204125 91 83
output:
impossible
result:
ok
Test #2:
score: 0
Accepted
time: 1ms
memory: 3500kb
input:
504174 251338 19 88
output:
impossible
result:
ok
Test #3:
score: 0
Accepted
time: 1ms
memory: 3676kb
input:
476569 925 37 89
output:
36.8988739477
result:
ok
Test #4:
score: 0
Accepted
time: 0ms
memory: 3652kb
input:
360918 171047 97 88
output:
impossible
result:
ok
Test #5:
score: 0
Accepted
time: 0ms
memory: 3528kb
input:
503913 393658 18 57
output:
impossible
result:
ok
Test #6:
score: 0
Accepted
time: 1ms
memory: 3528kb
input:
830842 701006 73 88
output:
impossible
result:
ok
Test #7:
score: 0
Accepted
time: 1ms
memory: 3644kb
input:
375468 17258 84 38
output:
86.2162083694
result:
ok
Test #8:
score: 0
Accepted
time: 1ms
memory: 3544kb
input:
7714 7645 55 72
output:
impossible
result:
ok
Test #9:
score: 0
Accepted
time: 1ms
memory: 3652kb
input:
138901 100560 95 10
output:
impossible
result:
ok
Test #10:
score: 0
Accepted
time: 0ms
memory: 3640kb
input:
856536 556401 46 61
output:
18.1924633915
result:
ok
Test #11:
score: 0
Accepted
time: 1ms
memory: 3624kb
input:
1000000 1 100 100
output:
100.0000000000
result:
ok
Test #12:
score: 0
Accepted
time: 0ms
memory: 3764kb
input:
2 1 0 0
output:
0.0000000000
result:
ok
Test #13:
score: 0
Accepted
time: 1ms
memory: 3800kb
input:
1000000 1 1 0
output:
1.0000010000
result:
ok
Test #14:
score: 0
Accepted
time: 0ms
memory: 3472kb
input:
1000000 1 0 1
output:
impossible
result:
ok
Test #15:
score: 0
Accepted
time: 1ms
memory: 3516kb
input:
1000000 1 100 99
output:
impossible
result:
ok
Test #16:
score: 0
Accepted
time: 1ms
memory: 3736kb
input:
1000000 1 99 100
output:
98.9999990000
result:
ok