#include "ethereum.h"
#include <stdio.h>
excinfo GetExchangePrice() {
long long V1 = 100000000, V2 = 99999999;
excinfo A = Exchange(V1);
excinfo B = Exchange(V2);
long long X = A.ETH * B.BTC - A.BTC * B.ETH;
long long Y = B.BTC * V1 - A.BTC * V2;
long long ETH = Y / X;
long long BTC = (A.BTC != 0 ? (V1 - A.ETH * ETH) / A.BTC
: (V2 - B.ETH * ETH) / B.BTC);
excinfo ret; ret.BTC = BTC; ret.ETH = ETH;
return ret;
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
0 ms |
1120 KB |
Output is correct |
2 |
Correct |
0 ms |
1120 KB |
Output is correct |
3 |
Correct |
0 ms |
1120 KB |
Output is correct |
4 |
Correct |
0 ms |
1120 KB |
Output is correct |
5 |
Correct |
0 ms |
1120 KB |
Output is correct |
6 |
Correct |
0 ms |
1120 KB |
Output is correct |
7 |
Correct |
0 ms |
1120 KB |
Output is correct |
8 |
Correct |
0 ms |
1120 KB |
Output is correct |
9 |
Correct |
0 ms |
1120 KB |
Output is correct |
10 |
Correct |
0 ms |
1120 KB |
Output is correct |
11 |
Correct |
0 ms |
1120 KB |
Output is correct |
12 |
Correct |
0 ms |
1120 KB |
Output is correct |
13 |
Correct |
0 ms |
1120 KB |
Output is correct |
14 |
Correct |
0 ms |
1120 KB |
Output is correct |
15 |
Correct |
0 ms |
1120 KB |
Output is correct |
16 |
Correct |
0 ms |
1120 KB |
Output is correct |
17 |
Correct |
0 ms |
1120 KB |
Output is correct |
18 |
Correct |
0 ms |
1120 KB |
Output is correct |
19 |
Correct |
0 ms |
1120 KB |
Output is correct |
20 |
Correct |
0 ms |
1120 KB |
Output is correct |