QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#134166#2362. Contest StrugglesBUET_TEAM_ONE#AC ✓1ms3788kbC++20845b2023-08-03 11:32:492023-08-03 11:32:52

Judging History

This is the latest submission verdict.

  • [2023-08-10 23:21:45]
  • System Update: QOJ starts to keep a history of the judgings of all the submissions.
  • [2023-08-03 11:32:52]
  • Judged
  • Verdict: AC
  • Time: 1ms
  • Memory: 3788kb
  • [2023-08-03 11:32:49]
  • Submitted

answer

#include <bits/stdc++.h>

#define endl            '\n'
#define pb             push_back
#define fill(x, y)     memset(x, y, sizeof(x))
#define all(x)         (x).begin(), (x).end()
#define debug(x)       { cerr << #x << " = " << x << endl; }
#define IO	       { ios_base::sync_with_stdio(false); cin.tie(0); }
#define read(x)	       freopen(x, "r", stdin)
#define write(x)       freopen(x, "w", stdout)

using namespace std;

typedef long long      ll;
typedef pair<int, int> ii;
typedef vector<int>    vi;

const double inf = 1e18;
const double pi = acos(-1);

void solve() {
    double n, m; cin>> n>> m;
    double a, b; cin>> a>> b;
    double k = (a*n-b*m)/(n-m);
    (k<0 || k>100)? cout<< "impossible"<< endl : cout<< k<< endl;

}

int main() {
    IO;
    cout << fixed << setprecision(10);
    solve();
}

詳細信息

Test #1:

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

input:

319601 204125
91 83

output:

impossible

result:

ok 

Test #2:

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

input:

504174 251338
19 88

output:

impossible

result:

ok 

Test #3:

score: 0
Accepted
time: 1ms
memory: 3672kb

input:

476569 925
37 89

output:

36.8988739477

result:

ok 

Test #4:

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

input:

360918 171047
97 88

output:

impossible

result:

ok 

Test #5:

score: 0
Accepted
time: 1ms
memory: 3604kb

input:

503913 393658
18 57

output:

impossible

result:

ok 

Test #6:

score: 0
Accepted
time: 1ms
memory: 3544kb

input:

830842 701006
73 88

output:

impossible

result:

ok 

Test #7:

score: 0
Accepted
time: 1ms
memory: 3780kb

input:

375468 17258
84 38

output:

86.2162083694

result:

ok 

Test #8:

score: 0
Accepted
time: 1ms
memory: 3612kb

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: 1ms
memory: 3740kb

input:

856536 556401
46 61

output:

18.1924633915

result:

ok 

Test #11:

score: 0
Accepted
time: 1ms
memory: 3732kb

input:

1000000 1
100 100

output:

100.0000000000

result:

ok 

Test #12:

score: 0
Accepted
time: 1ms
memory: 3780kb

input:

2 1
0 0

output:

0.0000000000

result:

ok 

Test #13:

score: 0
Accepted
time: 1ms
memory: 3740kb

input:

1000000 1
1 0

output:

1.0000010000

result:

ok 

Test #14:

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

input:

1000000 1
0 1

output:

impossible

result:

ok 

Test #15:

score: 0
Accepted
time: 1ms
memory: 3612kb

input:

1000000 1
100 99

output:

impossible

result:

ok 

Test #16:

score: 0
Accepted
time: 1ms
memory: 3788kb

input:

1000000 1
99 100

output:

98.9999990000

result:

ok