#include "ethereum.h"
#include <algorithm>
using namespace std;
long long det(long long p, long long q, long long r, long long s)
{
return p * s - q * r;
}
excinfo GetExchangePrice() {
excinfo A = Exchange(100000000);
excinfo B = Exchange(99999999);
long long p = det(100000000,A.ETH,99999999,B.ETH);
long long q = det(A.BTC,100000000,B.BTC,99999999);
long long r = det(A.BTC,A.ETH,B.BTC,B.ETH);
return {p/r,q/r};
}
Compilation message
ethereum.cpp: In function 'excinfo GetExchangePrice()':
ethereum.cpp:18:9: warning: extended initializer lists only available with -std=c++11 or -std=gnu++11
return {p/r,q/r};
^
# |
결과 |
실행 시간 |
메모리 |
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 |