結果
| 問題 |
No.1464 Number Conversion
|
| コンテスト | |
| ユーザー |
arashin
|
| 提出日時 | 2021-04-02 23:46:47 |
| 言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 755 bytes |
| コンパイル時間 | 1,796 ms |
| コンパイル使用メモリ | 168,884 KB |
| 実行使用メモリ | 5,248 KB |
| 最終ジャッジ日時 | 2024-12-23 22:53:55 |
| 合計ジャッジ時間 | 2,702 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 18 WA * 11 |
ソースコード
#include<bits/stdc++.h>
using namespace std;
using u64 = uint_least64_t;
using s64 = int_least64_t;
using ll = uint_least64_t;
int main(){
string xs, us, ds;
cin >> xs;
int pos = xs.find(".");
// cout << pos << endl;
if (pos < 0){
cout << xs << "/1" << endl;
return 0;
}
us = xs.substr(0, pos);
// cout << "us=" << us << endl;
ds = xs.substr(pos + 1, xs.length() - pos-1);
// cout << "ds=" << ds << endl;
string ts = us + ds;
// cout << "ts=" << ts << endl;
u64 tsi = atoi(ts.c_str());
u64 b = pow(10, ds.length());
if (tsi % 2 == 0){
tsi /= 2;
b /= 2;
}
if (tsi % 5 == 0){
tsi /= 5;
b /= 5;
}
cout << tsi << "/"<< b << endl;
return 0;
}
arashin