結果
問題 |
No.428 小数から逃げる夢
|
ユーザー |
|
提出日時 | 2016-10-08 12:31:25 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 2 ms / 1,000 ms |
コード長 | 1,224 bytes |
コンパイル時間 | 1,859 ms |
コンパイル使用メモリ | 167,784 KB |
実行使用メモリ | 5,248 KB |
最終ジャッジ日時 | 2024-11-21 20:27:19 |
合計ジャッジ時間 | 3,599 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 100 |
ソースコード
#define _CRT_SECURE_NO_WARNINGS #define _USE_MATH_DEFINES #include "bits/stdc++.h" #define REP(i,a,b) for(int i=a;i<b;++i) #define rep(i,n) REP(i,0,n) #define ll long long #define ull unsigned ll typedef long double ld; #define ALL(a) begin(a),end(a) #define ifnot(a) if(not (a)) #define dump(x) cerr << #x << " = " << (x) << endl using namespace std; // #define int ll #ifdef _MSC_VER const bool test = true; #else const bool test = false; #endif int dx[] = { 0,1,0,-1 }; int dy[] = { 1,0,-1,0 }; #define INF (1 << 28) ull mod = (int)1e9 + 7; //..................... #define MAX (int)1e5 + 5 double H, W; signed main() { string d = "0.1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991"; string res; int N; cin >> N; int v = 0; reverse(ALL(d)); int mode = 0; rep(i, 540) { if (mode == 0) { if (d[i] == '.') { mode = 1; res += "."; continue; } v += (d[i] - '0')*N; } else { if (v == 0) { break; } } res += v % 10 + '0'; v /= 10; } if (res.back() == '.') res += '0'; reverse(ALL(res)); cout << res << endl; return 0; }