結果

問題 No.668 6.0*10^23
コンテスト
ユーザー Bwambocos
提出日時 2018-03-23 22:59:14
言語 C++14
(gcc 15.2.0 + boost 1.89.0)
コンパイル:
g++-15 -O2 -lm -std=c++14 -Wuninitialized -DONLINE_JUDGE -o a.out _filename_
実行:
./a.out
結果
AC  
実行時間 4 ms / 2,000 ms
コード長 467 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 1,156 ms
コンパイル使用メモリ 181,056 KB
実行使用メモリ 7,848 KB
最終ジャッジ日時 2026-03-19 23:36:52
合計ジャッジ時間 2,585 ms
ジャッジサーバーID
(参考情報)
judge1_1 / judge2_1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 50
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

#include "bits/stdc++.h"
#define in std::cin
#define out std::cout
#define rep(i,N) for(int i=0;i<N;++i)
typedef long long int LL;

std::string N;
int powcou;

int main()
{
	in >> N;
	powcou = N.length() - 1;
	auto tmp2 = N.substr(0, 3);
	long double head = std::stoi(tmp2);
	head /= 100;
	head += 0.05;
	if (head > 10)
	{
		++powcou;
		head /= 10;
	}
	auto tmp3 = std::to_string(head);
	out << tmp3[0] << "." << tmp3[2] << "*10^" << powcou << std::endl;
	return 0;
}
0