結果

問題 No.428 小数から逃げる夢
ユーザー tossytossy
提出日時 2016-10-02 22:27:17
言語 C++14
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 2 ms / 1,000 ms
コード長 943 bytes
コンパイル時間 726 ms
コンパイル使用メモリ 84,916 KB
実行使用メモリ 6,824 KB
最終ジャッジ日時 2024-11-21 13:12:40
合計ジャッジ時間 2,858 ms
ジャッジサーバーID
(参考情報)
judge3 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 100
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <cstdio>
#include <cstring>
#include <string>
#include <cmath>
#include <cassert>
#include <iostream>
#include <algorithm>
#include <stack>
#include <queue>
#include <vector>
#include <set>
#include <map>
#include <bitset>
using namespace std;

#define repl(i,a,b) for(int i=(int)(a);i<(int)(b);i++)
#define rep(i,n) repl(i,0,n)
#define mp(a,b) make_pair(a,b)
#define pb(a) push_back(a)
#define all(x) (x).begin(),(x).end()
#define dbg(x) cout<<#x"="<<x<<endl
#define fi first
#define se second

#define INF 2147483600


int main(){
  string s = "1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991";
  int n;
  cin>>n;

  int kuri=0;
  for(int i=s.size()-1; i>=0; i--){
    int nxt = ((s[i]-'0')*n+kuri);
    kuri = nxt/10;
    s[i] = nxt%10+'0';
  }
  cout<<kuri<<"."<<s<<endl;

  return 0;
}
0