結果
| 問題 | No.428 小数から逃げる夢 |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2026-10-20 11:18:14 |
| 言語 | C++23(gcc16) (gcc 16.2.0 + boost 1.92.0 + ACL) |
| 結果 |
AC
不安定
|
| 実行時間 | 1 ms / 1,000 ms |
| + 877µs | |
| コード長 | 732 bytes |
| 記録 | |
| コンパイル時間 | 3,346 ms |
| コンパイル使用メモリ | 177,664 KB |
| 実行使用メモリ | 9,920 KB |
| 最終ジャッジ日時 | 2026-10-20 11:18:48 |
| 合計ジャッジ時間 | 7,560 ms |
|
ジャッジサーバーID (参考情報) |
judge4_0 / judge6_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 100 |
ソースコード
#include <algorithm>
#include <iostream>
#include <vector>
int main() {
using namespace std;
int n;
cin >> n;
string d = "001234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991";
reverse(d.begin(), d.end());
string ans = "";
int c = 0;
for (char di : d) {
int m = (di - '0') * n + c;
ans.push_back('0' + (m % 10));
c = m / 10;
}
ans.insert(ans.begin() + 190, '.');
while (ans.back() == '0') { ans.pop_back(); }
if (ans.back() == '.') { ans.push_back('0'); }
reverse(ans.begin(), ans.end());
cout << ans << endl;
}