結果

問題 No.668 6.0*10^23
ユーザー uafr_csuafr_cs
提出日時 2018-03-23 22:34:49
言語 Java21
(openjdk 21)
結果
AC  
実行時間 251 ms / 2,000 ms
コード長 944 bytes
コンパイル時間 2,340 ms
コンパイル使用メモリ 76,360 KB
実行使用メモリ 60,908 KB
最終ジャッジ日時 2023-09-12 17:18:27
合計ジャッジ時間 15,260 ms
ジャッジサーバーID
(参考情報)
judge15 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 157 ms
57,140 KB
testcase_01 AC 247 ms
60,480 KB
testcase_02 AC 220 ms
57,356 KB
testcase_03 AC 210 ms
58,892 KB
testcase_04 AC 209 ms
56,760 KB
testcase_05 AC 178 ms
56,680 KB
testcase_06 AC 206 ms
57,068 KB
testcase_07 AC 155 ms
56,872 KB
testcase_08 AC 157 ms
56,920 KB
testcase_09 AC 155 ms
56,560 KB
testcase_10 AC 184 ms
56,852 KB
testcase_11 AC 247 ms
60,312 KB
testcase_12 AC 181 ms
56,908 KB
testcase_13 AC 247 ms
59,988 KB
testcase_14 AC 248 ms
58,404 KB
testcase_15 AC 175 ms
56,860 KB
testcase_16 AC 181 ms
54,708 KB
testcase_17 AC 244 ms
60,908 KB
testcase_18 AC 212 ms
57,004 KB
testcase_19 AC 179 ms
56,588 KB
testcase_20 AC 216 ms
57,364 KB
testcase_21 AC 218 ms
58,024 KB
testcase_22 AC 240 ms
60,408 KB
testcase_23 AC 223 ms
57,364 KB
testcase_24 AC 178 ms
56,684 KB
testcase_25 AC 243 ms
60,448 KB
testcase_26 AC 170 ms
56,748 KB
testcase_27 AC 248 ms
58,544 KB
testcase_28 AC 249 ms
60,676 KB
testcase_29 AC 206 ms
57,024 KB
testcase_30 AC 250 ms
60,036 KB
testcase_31 AC 232 ms
58,220 KB
testcase_32 AC 174 ms
56,968 KB
testcase_33 AC 249 ms
58,504 KB
testcase_34 AC 185 ms
57,008 KB
testcase_35 AC 184 ms
57,012 KB
testcase_36 AC 249 ms
58,332 KB
testcase_37 AC 249 ms
59,264 KB
testcase_38 AC 209 ms
57,012 KB
testcase_39 AC 219 ms
57,160 KB
testcase_40 AC 244 ms
60,152 KB
testcase_41 AC 251 ms
56,652 KB
testcase_42 AC 210 ms
57,020 KB
testcase_43 AC 247 ms
60,280 KB
testcase_44 AC 243 ms
60,752 KB
testcase_45 AC 158 ms
56,744 KB
testcase_46 AC 157 ms
56,836 KB
testcase_47 AC 160 ms
56,820 KB
testcase_48 AC 158 ms
56,624 KB
testcase_49 AC 157 ms
57,036 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Arrays;
import java.util.LinkedList;
import java.util.Scanner;

public class Main {
	
	public static final long MOD = 1000000007;
	
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		
		final char[] chs = sc.next().toCharArray();
		
		int begin = 0;
		while(chs[begin] == 0){ begin++; }
		
		int size = 0;
		int[] ans = new int[3];
		ans[0] = Character.getNumericValue(chs[begin + 0]);
		ans[1] = Character.getNumericValue(chs[begin + 1]);
		ans[2] = Character.getNumericValue(chs[begin + 2]);
		
		if(ans[2] >= 5){
			ans[begin + 2] = 0;
			ans[begin + 1] += 1;
		}
		if(ans[1] >= 10){
			ans[begin + 1] %= 10;
			ans[begin + 0] += 1;
		}
		if(ans[0] >= 10){
			ans[begin + 1] = ans[begin] % 10;
			ans[begin + 0] /= 10;
			size++;
		}
		
		size += (chs.length - (begin + 1));
		
		//System.out.println(Arrays.toString(ans));
		System.out.println(ans[0] + "." + ans[1] + "*10^" + size);
		
	}
}
0