# | Submission time | Handle | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
28181 | 2017-07-15T14:18:00 Z | (#1210, xdoju) | The Ethereum and The Bitcoin (FXCUP2_ethereum) | C++11 | 0 ms | 0 KB |
#include "ethereum.h" #include <stdio.h> excinfo GetExchangePrice() { long long V1 = 100000000, V2 = 99999999; excinfo A = Exchange(V1); excinfo B = Exchange(V2); long long BTC = 0, ETH = 0; 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; }