結果

問題 No.668 6.0*10^23
ユーザー sekiya9311sekiya9311
提出日時 2018-03-23 23:19:57
言語 Java21
(openjdk 21)
結果
WA  
実行時間 -
コード長 1,576 bytes
コンパイル時間 3,066 ms
コンパイル使用メモリ 76,148 KB
実行使用メモリ 61,860 KB
最終ジャッジ日時 2023-09-12 17:38:40
合計ジャッジ時間 14,552 ms
ジャッジサーバーID
(参考情報)
judge12 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 AC 249 ms
60,156 KB
testcase_02 WA -
testcase_03 WA -
testcase_04 WA -
testcase_05 WA -
testcase_06 WA -
testcase_07 WA -
testcase_08 WA -
testcase_09 AC 154 ms
57,016 KB
testcase_10 WA -
testcase_11 AC 251 ms
59,220 KB
testcase_12 AC 180 ms
56,684 KB
testcase_13 WA -
testcase_14 AC 249 ms
60,772 KB
testcase_15 WA -
testcase_16 WA -
testcase_17 AC 249 ms
59,748 KB
testcase_18 WA -
testcase_19 AC 178 ms
57,180 KB
testcase_20 AC 218 ms
58,316 KB
testcase_21 AC 208 ms
56,788 KB
testcase_22 WA -
testcase_23 AC 237 ms
58,476 KB
testcase_24 WA -
testcase_25 AC 249 ms
61,072 KB
testcase_26 AC 167 ms
57,136 KB
testcase_27 WA -
testcase_28 WA -
testcase_29 AC 208 ms
57,252 KB
testcase_30 AC 249 ms
60,108 KB
testcase_31 AC 226 ms
58,596 KB
testcase_32 AC 175 ms
56,592 KB
testcase_33 WA -
testcase_34 WA -
testcase_35 WA -
testcase_36 WA -
testcase_37 AC 251 ms
59,680 KB
testcase_38 WA -
testcase_39 AC 248 ms
58,108 KB
testcase_40 AC 250 ms
59,768 KB
testcase_41 WA -
testcase_42 WA -
testcase_43 WA -
testcase_44 AC 253 ms
57,620 KB
testcase_45 AC 157 ms
56,976 KB
testcase_46 AC 155 ms
56,572 KB
testcase_47 AC 156 ms
58,384 KB
testcase_48 AC 154 ms
56,720 KB
testcase_49 AC 153 ms
57,012 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--) {
                if (N[i] - '0' >= 5 && i > 1) N[i]++;
                N[i] += c;
                if (N[i] - '0' >= 10) {
                    c = 1;
                    N[i] = (char) ((N[i] - '0') % 10 + '0');
                } else {
                    c = 0;
                }
            }
            int L = N.length - 1;
            if (N[1] - '0' >= 10) {
                N[1] = (char) ((N[1] - '0') % 10 + '0');
                N[0]++;
                //L++;
            }
            N[0] += c;
            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