結果

問題 No.668 6.0*10^23
ユーザー sekiya9311sekiya9311
提出日時 2018-03-23 23:04:58
言語 Java21
(openjdk 21)
結果
WA  
実行時間 -
コード長 1,408 bytes
コンパイル時間 5,288 ms
コンパイル使用メモリ 75,260 KB
実行使用メモリ 48,220 KB
最終ジャッジ日時 2023-09-12 17:34:45
合計ジャッジ時間 17,115 ms
ジャッジサーバーID
(参考情報)
judge12 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 147 ms
43,268 KB
testcase_01 WA -
testcase_02 AC 220 ms
42,260 KB
testcase_03 AC 187 ms
41,540 KB
testcase_04 AC 208 ms
42,212 KB
testcase_05 AC 173 ms
40,716 KB
testcase_06 AC 210 ms
42,664 KB
testcase_07 AC 144 ms
40,692 KB
testcase_08 AC 143 ms
40,668 KB
testcase_09 AC 141 ms
40,808 KB
testcase_10 AC 173 ms
40,924 KB
testcase_11 WA -
testcase_12 AC 171 ms
40,932 KB
testcase_13 AC 243 ms
43,012 KB
testcase_14 AC 240 ms
42,448 KB
testcase_15 AC 163 ms
40,804 KB
testcase_16 AC 167 ms
41,000 KB
testcase_17 AC 240 ms
43,172 KB
testcase_18 AC 209 ms
42,832 KB
testcase_19 AC 167 ms
40,928 KB
testcase_20 AC 222 ms
41,732 KB
testcase_21 AC 205 ms
43,632 KB
testcase_22 AC 227 ms
41,772 KB
testcase_23 AC 217 ms
42,360 KB
testcase_24 AC 166 ms
41,112 KB
testcase_25 AC 224 ms
41,720 KB
testcase_26 AC 158 ms
40,524 KB
testcase_27 AC 225 ms
42,052 KB
testcase_28 AC 229 ms
42,088 KB
testcase_29 AC 186 ms
41,428 KB
testcase_30 AC 250 ms
43,912 KB
testcase_31 AC 217 ms
42,188 KB
testcase_32 AC 166 ms
40,772 KB
testcase_33 AC 240 ms
42,440 KB
testcase_34 AC 174 ms
41,500 KB
testcase_35 AC 173 ms
41,096 KB
testcase_36 AC 225 ms
42,260 KB
testcase_37 AC 241 ms
43,252 KB
testcase_38 AC 209 ms
42,232 KB
testcase_39 WA -
testcase_40 AC 220 ms
42,640 KB
testcase_41 AC 222 ms
42,228 KB
testcase_42 AC 207 ms
42,292 KB
testcase_43 AC 230 ms
42,112 KB
testcase_44 AC 252 ms
43,264 KB
testcase_45 AC 145 ms
40,956 KB
testcase_46 AC 142 ms
40,476 KB
testcase_47 AC 142 ms
40,480 KB
testcase_48 AC 146 ms
40,756 KB
testcase_49 AC 144 ms
40,632 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.Scanner;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 */
public class Main {
    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        Scanner in = new Scanner(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        No668 solver = new No668();
        solver.solve(1, in, out);
        out.close();
    }

    static class No668 {
        public void solve(int testNumber, Scanner in, PrintWriter out) {
            char[] N = in.next().toCharArray();
            int c = 0;
            for (int i = N.length - 1; i > 0; i--) {
                N[i] += c;
                if (N[i] - '0' >= 5) {
                    c = 1;
                } else {
                    c = 0;
                }
            }
            int L = N.length - 1;
            if (N[1] - '0' == 10) {
                N[1] = '0';
                N[0]++;
                //L++;
            }
            if (N[0] - '0' == 10) {
                N[1] = (char) ('0' + (N[0] - '0') % 10);
                N[0] = (char) ('0' + (N[0] - '0') / 10);
                L++;
            }
            out.println((N[0] - '0') + "." + (N[1] - '0') + "*10^" + L);
        }

    }
}

0