結果
問題 | No.428 小数から逃げる夢 |
ユーザー | ziita |
提出日時 | 2017-06-27 19:32:46 |
言語 | Java21 (openjdk 21) |
結果 |
AC
|
実行時間 | 88 ms / 1,000 ms |
コード長 | 2,884 bytes |
コンパイル時間 | 2,418 ms |
コンパイル使用メモリ | 84,452 KB |
実行使用メモリ | 38,524 KB |
最終ジャッジ日時 | 2024-10-04 11:42:07 |
合計ジャッジ時間 | 11,940 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge2 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 75 ms
38,200 KB |
testcase_01 | AC | 71 ms
38,188 KB |
testcase_02 | AC | 88 ms
38,004 KB |
testcase_03 | AC | 73 ms
38,472 KB |
testcase_04 | AC | 73 ms
38,132 KB |
testcase_05 | AC | 70 ms
38,356 KB |
testcase_06 | AC | 72 ms
38,228 KB |
testcase_07 | AC | 73 ms
38,268 KB |
testcase_08 | AC | 71 ms
38,236 KB |
testcase_09 | AC | 73 ms
38,244 KB |
testcase_10 | AC | 74 ms
37,900 KB |
testcase_11 | AC | 74 ms
38,344 KB |
testcase_12 | AC | 74 ms
38,380 KB |
testcase_13 | AC | 73 ms
38,004 KB |
testcase_14 | AC | 73 ms
38,292 KB |
testcase_15 | AC | 74 ms
38,044 KB |
testcase_16 | AC | 74 ms
38,204 KB |
testcase_17 | AC | 76 ms
38,228 KB |
testcase_18 | AC | 73 ms
38,228 KB |
testcase_19 | AC | 70 ms
37,920 KB |
testcase_20 | AC | 73 ms
38,060 KB |
testcase_21 | AC | 70 ms
38,292 KB |
testcase_22 | AC | 73 ms
38,300 KB |
testcase_23 | AC | 74 ms
38,228 KB |
testcase_24 | AC | 69 ms
38,044 KB |
testcase_25 | AC | 74 ms
37,932 KB |
testcase_26 | AC | 70 ms
38,060 KB |
testcase_27 | AC | 74 ms
38,140 KB |
testcase_28 | AC | 69 ms
37,868 KB |
testcase_29 | AC | 73 ms
38,344 KB |
testcase_30 | AC | 79 ms
37,964 KB |
testcase_31 | AC | 69 ms
38,084 KB |
testcase_32 | AC | 71 ms
38,184 KB |
testcase_33 | AC | 72 ms
38,228 KB |
testcase_34 | AC | 71 ms
38,252 KB |
testcase_35 | AC | 75 ms
38,160 KB |
testcase_36 | AC | 73 ms
38,308 KB |
testcase_37 | AC | 76 ms
37,964 KB |
testcase_38 | AC | 73 ms
38,048 KB |
testcase_39 | AC | 73 ms
38,344 KB |
testcase_40 | AC | 72 ms
38,200 KB |
testcase_41 | AC | 72 ms
38,004 KB |
testcase_42 | AC | 71 ms
38,384 KB |
testcase_43 | AC | 69 ms
37,764 KB |
testcase_44 | AC | 70 ms
38,216 KB |
testcase_45 | AC | 71 ms
38,368 KB |
testcase_46 | AC | 74 ms
38,020 KB |
testcase_47 | AC | 72 ms
38,228 KB |
testcase_48 | AC | 72 ms
37,996 KB |
testcase_49 | AC | 72 ms
38,100 KB |
testcase_50 | AC | 75 ms
38,148 KB |
testcase_51 | AC | 74 ms
37,996 KB |
testcase_52 | AC | 74 ms
38,248 KB |
testcase_53 | AC | 70 ms
38,124 KB |
testcase_54 | AC | 70 ms
38,228 KB |
testcase_55 | AC | 72 ms
38,320 KB |
testcase_56 | AC | 74 ms
38,004 KB |
testcase_57 | AC | 73 ms
38,184 KB |
testcase_58 | AC | 74 ms
38,164 KB |
testcase_59 | AC | 69 ms
38,164 KB |
testcase_60 | AC | 72 ms
38,028 KB |
testcase_61 | AC | 72 ms
38,228 KB |
testcase_62 | AC | 74 ms
38,200 KB |
testcase_63 | AC | 71 ms
37,932 KB |
testcase_64 | AC | 73 ms
38,020 KB |
testcase_65 | AC | 71 ms
38,100 KB |
testcase_66 | AC | 74 ms
38,124 KB |
testcase_67 | AC | 72 ms
38,228 KB |
testcase_68 | AC | 74 ms
38,152 KB |
testcase_69 | AC | 75 ms
38,152 KB |
testcase_70 | AC | 71 ms
37,868 KB |
testcase_71 | AC | 71 ms
37,996 KB |
testcase_72 | AC | 71 ms
38,164 KB |
testcase_73 | AC | 75 ms
38,272 KB |
testcase_74 | AC | 75 ms
37,852 KB |
testcase_75 | AC | 73 ms
38,300 KB |
testcase_76 | AC | 73 ms
38,288 KB |
testcase_77 | AC | 75 ms
38,240 KB |
testcase_78 | AC | 75 ms
38,132 KB |
testcase_79 | AC | 75 ms
38,048 KB |
testcase_80 | AC | 71 ms
38,224 KB |
testcase_81 | AC | 70 ms
38,204 KB |
testcase_82 | AC | 72 ms
38,088 KB |
testcase_83 | AC | 74 ms
37,996 KB |
testcase_84 | AC | 75 ms
37,996 KB |
testcase_85 | AC | 75 ms
38,048 KB |
testcase_86 | AC | 73 ms
38,200 KB |
testcase_87 | AC | 72 ms
37,900 KB |
testcase_88 | AC | 71 ms
38,420 KB |
testcase_89 | AC | 71 ms
38,248 KB |
testcase_90 | AC | 70 ms
38,524 KB |
testcase_91 | AC | 72 ms
37,948 KB |
testcase_92 | AC | 75 ms
38,184 KB |
testcase_93 | AC | 73 ms
38,196 KB |
testcase_94 | AC | 73 ms
38,228 KB |
testcase_95 | AC | 71 ms
38,456 KB |
testcase_96 | AC | 73 ms
38,472 KB |
testcase_97 | AC | 71 ms
38,212 KB |
testcase_98 | AC | 72 ms
38,060 KB |
testcase_99 | AC | 69 ms
38,272 KB |
ソースコード
import java.io.ByteArrayInputStream; import java.io.IOException; import java.io.InputStream; import java.io.PrintWriter; import java.util.Arrays; import java.util.InputMismatchException; import java.io.OutputStream; import java.util.StringTokenizer; import java.io.BufferedReader; import java.io.InputStreamReader; import java.util.HashMap; import java.util.Map; import java.util.ArrayList; import java.util.List; import java.util.Scanner; import java.math.BigDecimal; /** * 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; InputReader in = new InputReader(inputStream); PrintWriter out = new PrintWriter(outputStream); Task solver = new Task(); solver.solve(1, in, out); out.close(); } static class Task { public void solve(int testNumber, InputReader in, PrintWriter out) { String D = "001234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991"; int N = in.nextInt(); int[] a = new int[192]; int first = N%10; int second = N/10; int c=0; for(int i=191; i>=0; i--){ a[i] = (D.charAt(i)-'0')*first+c; c=a[i]/10; a[i]=a[i]%10; } c=0; for(int i=190; i>=0; i--){ a[i] = (D.charAt(i+1)-'0')*second+a[i]+c; c=a[i]/10; a[i]=a[i]%10; } if(N==100){ for(int i=191; i>=2; i--){ a[i-2] = D.charAt(i)-'0'; } } if(a[0]!=0) out.print(a[0]); out.print(a[1]+"."); for(int i=2; i<192; i++){ out.print(a[i]); } } } static class InputReader { public BufferedReader reader; public StringTokenizer tokenizer; public InputReader(InputStream stream) { reader = new BufferedReader(new InputStreamReader(stream), 32768); tokenizer = null; } public String next() { while (tokenizer == null || !tokenizer.hasMoreTokens()) { try { tokenizer = new StringTokenizer(reader.readLine()); } catch (IOException e) { throw new RuntimeException(e); } } return tokenizer.nextToken(); } public int nextInt() { return Integer.parseInt(next()); } public long nextLong() { return Long.parseLong(next()); } } }