結果
問題 | No.668 6.0*10^23 |
ユーザー |
👑 |
提出日時 | 2018-03-31 20:52:47 |
言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
結果 |
AC
|
実行時間 | 4 ms / 2,000 ms |
コード長 | 839 bytes |
コンパイル時間 | 413 ms |
コンパイル使用メモリ | 56,748 KB |
実行使用メモリ | 6,944 KB |
最終ジャッジ日時 | 2024-06-30 05:43:24 |
合計ジャッジ時間 | 1,627 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 50 |
ソースコード
#include <iostream> #include <list> #include <string> #include <stdint.h> using namespace std; using uint = unsigned int; using int64 = int64_t; using uint64 = uint64_t; int main() { string s; cin >> s; char a = '0'; char b = '0'; uint c = 0; uint L = s.size(); for( uint i = 0 ; i < L ; i++ ){ if( i == 0 ){ a = s[i]; } if( i == 1 ){ b = s[i]; c += 1; } if( i == 2 ){ if( s[i] == '5' || s[i] == '6' || s[i] == '7' || s[i] == '8' || s[i] == '9' ){ if( b == '9' ){ b = '0'; if( a == '9' ){ a = '1'; c += 1; } else { a += 1; } } else { b += 1; } } c += 1; } if( i > 2 ){ c += 1; } } cout << a << "." << b << "*" << "10^" << c << "\n"; }