結果
問題 | No.1464 Number Conversion |
ユーザー |
|
提出日時 | 2021-04-02 22:08:51 |
言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 2 ms / 2,000 ms |
コード長 | 346 bytes |
コンパイル時間 | 1,817 ms |
コンパイル使用メモリ | 195,900 KB |
最終ジャッジ日時 | 2025-01-20 09:23:01 |
ジャッジサーバーID (参考情報) |
judge2 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 29 |
ソースコード
#include<bits/stdc++.h> #define int long long using namespace std; signed main(){ string X;cin>>X; int f=X.end()-find(X.begin(),X.end(),'.')-1; if(f==-1)X+='.',f++; for(int i=f;i<8;i++)X+='0'; X.erase(find(X.begin(),X.end(),'.')); int x=stoll(X),y=100000000; int n=gcd(x,y); x/=n;y/=n; cout<<x<<'/'<<y<<endl; }