結果
| 問題 |
No.1464 Number Conversion
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2024-04-29 09:02:17 |
| 言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 467 bytes |
| コンパイル時間 | 4,041 ms |
| コンパイル使用メモリ | 251,888 KB |
| 最終ジャッジ日時 | 2025-02-21 09:28:39 |
|
ジャッジサーバーID (参考情報) |
judge3 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 19 WA * 10 |
ソースコード
#include <bits/stdc++.h>
#include <atcoder/all>
using namespace std;
using namespace atcoder;
using ll = long long;
using ld = long double;
using mint = modint998244353;
int main() {
double x; cin >> x;
string s = to_string(x);
int pos = s.find('.');
int d = 0;
if (pos == -1) d = 0;
else d = s.size() - pos - 1;
ll a = pow(10, d);
double y = x * pow(10, d);
ll b = ll(y);
ll g = gcd(a, b);
cout << b / g << '/' << a / g << endl;
return 0;
}