結果

問題 No.668 6.0*10^23
ユーザー sekiya9311sekiya9311
提出日時 2018-03-23 23:18:24
言語 Java21
(openjdk 21)
結果
WA  
実行時間 -
コード長 1,576 bytes
コンパイル時間 3,899 ms
コンパイル使用メモリ 76,112 KB
実行使用メモリ 61,756 KB
最終ジャッジ日時 2023-09-12 17:36:43
合計ジャッジ時間 17,161 ms
ジャッジサーバーID
(参考情報)
judge13 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 AC 254 ms
60,248 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 161 ms
56,972 KB
testcase_10 WA -
testcase_11 AC 248 ms
59,848 KB
testcase_12 AC 186 ms
56,880 KB
testcase_13 WA -
testcase_14 AC 248 ms
60,796 KB
testcase_15 WA -
testcase_16 WA -
testcase_17 AC 254 ms
60,428 KB
testcase_18 WA -
testcase_19 AC 186 ms
56,780 KB
testcase_20 AC 251 ms
58,312 KB
testcase_21 AC 218 ms
57,512 KB
testcase_22 WA -
testcase_23 AC 229 ms
57,620 KB
testcase_24 WA -
testcase_25 AC 252 ms
59,560 KB
testcase_26 AC 174 ms
56,980 KB
testcase_27 WA -
testcase_28 WA -
testcase_29 AC 215 ms
56,996 KB
testcase_30 AC 252 ms
60,532 KB
testcase_31 AC 225 ms
57,588 KB
testcase_32 AC 179 ms
54,880 KB
testcase_33 WA -
testcase_34 WA -
testcase_35 WA -
testcase_36 WA -
testcase_37 AC 255 ms
59,712 KB
testcase_38 WA -
testcase_39 AC 232 ms
57,248 KB
testcase_40 AC 256 ms
61,756 KB
testcase_41 WA -
testcase_42 WA -
testcase_43 WA -
testcase_44 AC 252 ms
60,932 KB
testcase_45 AC 165 ms
56,968 KB
testcase_46 AC 162 ms
56,632 KB
testcase_47 AC 164 ms
56,708 KB
testcase_48 AC 163 ms
56,904 KB
testcase_49 AC 163 ms
56,832 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