結果

問題 No.668 6.0*10^23
ユーザー uafr_csuafr_cs
提出日時 2018-03-23 22:37:07
言語 Java21
(openjdk 21)
結果
AC  
実行時間 253 ms / 2,000 ms
コード長 946 bytes
コンパイル時間 2,266 ms
コンパイル使用メモリ 78,640 KB
実行使用メモリ 61,180 KB
最終ジャッジ日時 2023-09-12 17:19:09
合計ジャッジ時間 14,292 ms
ジャッジサーバーID
(参考情報)
judge13 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 156 ms
56,624 KB
testcase_01 AC 241 ms
60,604 KB
testcase_02 AC 221 ms
57,432 KB
testcase_03 AC 210 ms
57,196 KB
testcase_04 AC 212 ms
58,224 KB
testcase_05 AC 182 ms
56,968 KB
testcase_06 AC 208 ms
57,016 KB
testcase_07 AC 151 ms
57,080 KB
testcase_08 AC 155 ms
56,956 KB
testcase_09 AC 155 ms
56,788 KB
testcase_10 AC 184 ms
57,312 KB
testcase_11 AC 253 ms
58,248 KB
testcase_12 AC 180 ms
54,708 KB
testcase_13 AC 247 ms
60,584 KB
testcase_14 AC 252 ms
58,824 KB
testcase_15 AC 177 ms
56,748 KB
testcase_16 AC 180 ms
56,968 KB
testcase_17 AC 250 ms
60,496 KB
testcase_18 AC 208 ms
56,568 KB
testcase_19 AC 177 ms
56,516 KB
testcase_20 AC 228 ms
58,352 KB
testcase_21 AC 217 ms
57,352 KB
testcase_22 AC 248 ms
60,236 KB
testcase_23 AC 218 ms
57,228 KB
testcase_24 AC 173 ms
56,724 KB
testcase_25 AC 240 ms
61,180 KB
testcase_26 AC 169 ms
57,020 KB
testcase_27 AC 246 ms
56,676 KB
testcase_28 AC 247 ms
61,072 KB
testcase_29 AC 208 ms
57,172 KB
testcase_30 AC 248 ms
60,776 KB
testcase_31 AC 224 ms
57,108 KB
testcase_32 AC 179 ms
56,776 KB
testcase_33 AC 249 ms
58,824 KB
testcase_34 AC 184 ms
56,972 KB
testcase_35 AC 182 ms
56,936 KB
testcase_36 AC 242 ms
58,536 KB
testcase_37 AC 247 ms
58,768 KB
testcase_38 AC 210 ms
56,796 KB
testcase_39 AC 240 ms
58,676 KB
testcase_40 AC 247 ms
60,936 KB
testcase_41 AC 244 ms
58,940 KB
testcase_42 AC 211 ms
57,212 KB
testcase_43 AC 252 ms
60,440 KB
testcase_44 AC 246 ms
59,784 KB
testcase_45 AC 155 ms
56,904 KB
testcase_46 AC 158 ms
56,920 KB
testcase_47 AC 158 ms
57,000 KB
testcase_48 AC 159 ms
57,100 KB
testcase_49 AC 156 ms
56,692 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