結果

問題 No.688 E869120 and Constructing Array 2
ユーザー phsplsphspls
提出日時 2020-04-22 23:53:23
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 671 bytes
コンパイル時間 1,662 ms
コンパイル使用メモリ 165,404 KB
実行使用メモリ 6,948 KB
最終ジャッジ日時 2024-04-20 13:52:03
合計ジャッジ時間 3,436 ms
ジャッジサーバーID
(参考情報)
judge1 / judge3
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 WA -
testcase_02 WA -
testcase_03 WA -
testcase_04 WA -
testcase_05 WA -
testcase_06 WA -
testcase_07 WA -
testcase_08 WA -
testcase_09 WA -
testcase_10 WA -
testcase_11 WA -
testcase_12 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define llong long long

int main() {
    string n;
    cin >> n;

    int first = 0;
    rep(i, n.length()) {
        if(n[i] != '0') {
            first = i;
            break;
        }
    }
    int first2 = stoi(""s + n[first] + n[first+1]);
    if(n[first+2] == '5' || n[first+2] == '6' || n[first+2] == '7' || n[first+2] == '8' || n[first+2] == '9') {
        first2 += 1;
    }
    string first2str = to_string(first2);
    int expval = first2str.length() - 2 + n.length() - first - 1;
    cout << first2str[0] << "." << first2str[1] << "*10^" << expval << "\n";
}
0