結果
| 問題 |
No.428 小数から逃げる夢
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2018-05-20 13:24:25 |
| 言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 834 bytes |
| コンパイル時間 | 619 ms |
| コンパイル使用メモリ | 68,380 KB |
| 実行使用メモリ | 5,376 KB |
| 最終ジャッジ日時 | 2024-06-28 14:38:42 |
| 合計ジャッジ時間 | 3,236 ms |
|
ジャッジサーバーID (参考情報) |
judge2 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | WA * 100 |
ソースコード
#include<iostream>
#include<cstring>
using namespace std;
typedef long long ll;
string s = "0.1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991";
ll MAX = 1000000000;
int main(){
ll n;
cin >> n;
ll carry = 0;
string res = "";
for(int i = 18; i >= 0; i--){
ll part = (ll)(stoll(s.substr(i*10+2, 10)));
if(part < MAX) part *= 10;
part *= n;
part += carry;
carry = part/(10*MAX);
part %= (10*MAX);
string insert = to_string(part);
while(insert.length() != 10) insert = "0" + insert;
res = insert + res;
}
cout << carry << "." << res << endl;
return 0;
}