結果
問題 | No.858 わり算 |
ユーザー |
|
提出日時 | 2019-08-09 23:29:13 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 2 ms / 2,000 ms |
コード長 | 996 bytes |
コンパイル時間 | 1,212 ms |
コンパイル使用メモリ | 159,940 KB |
実行使用メモリ | 6,820 KB |
最終ジャッジ日時 | 2025-01-07 14:50:10 |
合計ジャッジ時間 | 1,715 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 2 |
other | AC * 9 |
ソースコード
#include <bits/stdc++.h> using namespace std; typedef long double ld; typedef long long ll; typedef unsigned long long ull; #define endl "\n" #define MP make_pair #define FOR(i,a,b) for(int i=(a);i<=(b);i++) #define FORR(x,arr) for(auto& x:arr) #define PII pair<int, int> #define FI first #define SE second #define ALL(x) (x).begin(), (x).end() const int INF=1<<30; const ll LINF=1LL<<60; const ll mod=1e9+7; const int NIL = -1; template<class T>inline bool chmax(T &a, const T &b) { if (a<b) { a = b; return 1; } return 0; } template<class T>inline bool chmin(T &a, const T &b) { if (b<a) { a = b; return 1; } return 0; } //------------------- int main(){ ll a,b; cin >> a >> b; /* ld la = (long double)a; ld lb = (long double)b; cout << fixed << setprecision(50) << (long double) a/b << endl; */ cout << a/b; ll cur = a%b; cout << '.'; int ten = 1; FOR(i,1,50){ cur *= 10; cout << cur/b; cur %= b; } //cout << fixed << setprecision(50) << ans << endl; return 0; }