結果

問題 No.428 小数から逃げる夢
ユーザー mogurocker
提出日時 2016-10-02 22:44:59
言語 C++11(廃止可能性あり)
(gcc 13.3.0)
結果
WA  
実行時間 -
コード長 548 bytes
コンパイル時間 663 ms
コンパイル使用メモリ 60,868 KB
実行使用メモリ 5,248 KB
最終ジャッジ日時 2024-11-21 13:22:35
合計ジャッジ時間 2,787 ms
ジャッジサーバーID
(参考情報)
judge2 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 2 WA * 98
権限があれば一括ダウンロードができます

ソースコード

diff #

#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;
	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;
	}
	for (int i = 9; i > 0; i--) {
		res2 = i * N + res1;
		d[100-i] = res2 % 10;
		res1 = res2 / 10;
	}
	cout << res1 << '.';
	for (int i = 99; i >= 0; i--) {
		cout << d[i];
	}
	cout << endl;
	return 0;
}
0