結果
| 問題 | No.428 小数から逃げる夢 |
| コンテスト | |
| ユーザー |
dnish
|
| 提出日時 | 2018-06-14 16:24:22 |
| 言語 | C++14 (gcc 13.3.0 + boost 1.89.0) |
| 結果 |
AC
|
| 実行時間 | 2 ms / 1,000 ms |
| コード長 | 796 bytes |
| 記録 | |
| コンパイル時間 | 1,597 ms |
| コンパイル使用メモリ | 169,960 KB |
| 実行使用メモリ | 6,944 KB |
| 最終ジャッジ日時 | 2024-06-30 14:23:42 |
| 合計ジャッジ時間 | 4,433 ms |
|
ジャッジサーバーID (参考情報) |
judge2 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 100 |
ソースコード
#include "bits/stdc++.h"
#define REP(i,n,N) for(ll i=(n); i<(N); i++)
#define RREP(i,n,N) for(ll i=(N-1); i>=n; i--)
#define CK(n,a,b) (a)<=(n)&&(n)<(b)
#define ALL(v) (v).begin(),(v).end()
#define p(s) cout<<(s)<<endl
typedef long long ll;
using namespace std;
const ll inf =1e18;
int N;
int main(){
while(cin>>N){
string s="1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991";
int n=s.size();
string ans;
int next = 0;
RREP(i,0,n){
next += (s[i] - '0')*N;
ans += ('0' + next%10);
next/=10;
}
reverse(ALL(ans));
p(to_string(next)+"."+ans);
}
}
dnish