結果
問題 |
No.428 小数から逃げる夢
|
ユーザー |
![]() |
提出日時 | 2016-10-02 22:54:18 |
言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 826 bytes |
コンパイル時間 | 766 ms |
コンパイル使用メモリ | 60,900 KB |
実行使用メモリ | 5,248 KB |
最終ジャッジ日時 | 2024-11-21 13:25:35 |
合計ジャッジ時間 | 2,841 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 2 WA * 98 |
ソースコード
#include <cstdio> #include <algorithm> #include <iostream> #include <cmath> using namespace std; typedef long long ll; int N; int main(int argc, char const *argv[]) { cin >> N; if (N == 100) { printf("12.34567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991\n"); return 0; } int d[101]; d[0] = N % 10; int res1 = N / 10; int res2; for (int i = 99; i >= 10; i--) { res2 = i * N + res1; d[100-i] = res2 % 100; res1 = res2 / 100; } int j = 1; for (int i = 89; i > 0; i-=22) { res2 = i * N + res1; d[90+j] = res2 % 100; res1 = res2 / 100; j++; } cout << d[95]/10 << '.' << d[95]%10; for (int i = 94; i >= 0; i--) { cout << d[i]; } cout << endl; return 0; }