結果

問題 No.1464 Number Conversion
ユーザー Example0911Example0911
提出日時 2021-04-02 21:39:04
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
RE  
実行時間 -
コード長 522 bytes
コンパイル時間 2,163 ms
コンパイル使用メモリ 196,988 KB
実行使用メモリ 4,504 KB
最終ジャッジ日時 2023-08-25 11:45:28
合計ジャッジ時間 3,681 ms
ジャッジサーバーID
(参考情報)
judge13 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 RE -
testcase_01 RE -
testcase_02 WA -
testcase_03 AC 2 ms
4,380 KB
testcase_04 WA -
testcase_05 WA -
testcase_06 WA -
testcase_07 WA -
testcase_08 WA -
testcase_09 WA -
testcase_10 WA -
testcase_11 WA -
testcase_12 WA -
testcase_13 WA -
testcase_14 WA -
testcase_15 WA -
testcase_16 WA -
testcase_17 WA -
testcase_18 WA -
testcase_19 WA -
testcase_20 WA -
testcase_21 WA -
testcase_22 WA -
testcase_23 WA -
testcase_24 WA -
testcase_25 WA -
testcase_26 WA -
testcase_27 WA -
testcase_28 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

#include "bits/stdc++.h"
//#define int long long
using namespace std;
using ll = long long;
using P = pair<ll, ll>;
const ll INF = (1LL << 61);
ll mod = 1000000007;
ll gcd(ll a, ll b) {
	if (b == 0)return a;
	return gcd(b, a % b);
}
ll lcm(ll a, ll b) {
	ll g = gcd(a, b);
	return a / g * b;
}
signed main() {
	ios::sync_with_stdio(false);
	cin.tie(0);
	double x; cin >> x;
	ll now = (ll)(x * 100000000 + 0.5);
	ll tmp = 100000000;
	ll l = lcm(now, tmp);
	now /= l; tmp /= l;
	cout << now<<"/" << tmp << endl;
	return 0;
}
0