結果
問題 | No.219 巨大数の概算 |
ユーザー | mban |
提出日時 | 2017-01-12 16:11:13 |
言語 | C#(csc) (csc 3.9.0) |
結果 |
AC
|
実行時間 | 77 ms / 1,500 ms |
コード長 | 2,518 bytes |
コンパイル時間 | 2,113 ms |
コンパイル使用メモリ | 110,900 KB |
実行使用メモリ | 32,556 KB |
最終ジャッジ日時 | 2024-07-18 12:19:09 |
合計ジャッジ時間 | 7,381 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge4 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 72 ms
30,264 KB |
testcase_01 | AC | 71 ms
28,600 KB |
testcase_02 | AC | 73 ms
28,208 KB |
testcase_03 | AC | 74 ms
30,384 KB |
testcase_04 | AC | 70 ms
26,296 KB |
testcase_05 | AC | 26 ms
24,368 KB |
testcase_06 | AC | 32 ms
24,048 KB |
testcase_07 | AC | 26 ms
24,304 KB |
testcase_08 | AC | 29 ms
24,052 KB |
testcase_09 | AC | 26 ms
24,108 KB |
testcase_10 | AC | 74 ms
30,256 KB |
testcase_11 | AC | 73 ms
28,080 KB |
testcase_12 | AC | 71 ms
30,516 KB |
testcase_13 | AC | 71 ms
28,352 KB |
testcase_14 | AC | 73 ms
28,600 KB |
testcase_15 | AC | 75 ms
28,216 KB |
testcase_16 | AC | 75 ms
30,384 KB |
testcase_17 | AC | 72 ms
28,472 KB |
testcase_18 | AC | 73 ms
30,520 KB |
testcase_19 | AC | 73 ms
30,516 KB |
testcase_20 | AC | 73 ms
30,260 KB |
testcase_21 | AC | 73 ms
30,516 KB |
testcase_22 | AC | 74 ms
32,308 KB |
testcase_23 | AC | 74 ms
30,128 KB |
testcase_24 | AC | 73 ms
28,228 KB |
testcase_25 | AC | 75 ms
26,040 KB |
testcase_26 | AC | 74 ms
30,392 KB |
testcase_27 | AC | 73 ms
28,600 KB |
testcase_28 | AC | 73 ms
30,396 KB |
testcase_29 | AC | 72 ms
28,220 KB |
testcase_30 | AC | 73 ms
30,260 KB |
testcase_31 | AC | 73 ms
28,464 KB |
testcase_32 | AC | 73 ms
30,272 KB |
testcase_33 | AC | 75 ms
30,252 KB |
testcase_34 | AC | 74 ms
30,400 KB |
testcase_35 | AC | 77 ms
30,396 KB |
testcase_36 | AC | 74 ms
30,380 KB |
testcase_37 | AC | 73 ms
28,480 KB |
testcase_38 | AC | 76 ms
30,528 KB |
testcase_39 | AC | 73 ms
28,356 KB |
testcase_40 | AC | 73 ms
28,596 KB |
testcase_41 | AC | 71 ms
26,292 KB |
testcase_42 | AC | 71 ms
28,604 KB |
testcase_43 | AC | 72 ms
28,096 KB |
testcase_44 | AC | 74 ms
30,520 KB |
testcase_45 | AC | 76 ms
30,380 KB |
testcase_46 | AC | 74 ms
30,520 KB |
testcase_47 | AC | 72 ms
28,344 KB |
testcase_48 | AC | 73 ms
28,600 KB |
testcase_49 | AC | 73 ms
30,256 KB |
testcase_50 | AC | 72 ms
32,556 KB |
testcase_51 | AC | 26 ms
26,280 KB |
コンパイルメッセージ
Microsoft (R) Visual C# Compiler version 3.9.0-6.21124.20 (db94f4cc) Copyright (C) Microsoft Corporation. All rights reserved.
ソースコード
using System; using System.Collections; using System.Collections.Generic; using System.Collections.Specialized; using System.Text; using System.Text.RegularExpressions; using System.Linq; using System.IO; class Program { static private Magatro M = new Magatro(); static private void Main(string[]args) { M.Scan(); M.Solve(); } } public class Scanner { private string[] S; private int Index; private char Separator; public Scanner(char separator = ' ') { Index = 0; Separator = separator; } private string[] Line() { return Console.ReadLine().Split(Separator); } public string Next() { string result; if (S == null || Index >= S.Length) { S = Line(); Index = 0; } result = S[Index]; Index++; return result; } public int NextInt() { return int.Parse(Next()); } public double NextDouble() { return double.Parse(Next()); } public long NextLong() { return long.Parse(Next()); } } public class Magatro { private int N; private Scanner Sc = new Scanner(); private double[,] Log = new double[10, 10]; public void Scan() { N = Sc.NextInt(); } private void Start() { for(int i = 1; i < 10; i++) { for(int j = 0; j < 10; j++) { Log[i, j] = Math.Log10(i + (double)j / 10); } } } public void Solve() { Start(); for (int i = 0; i < N; i++) { int a = Sc.NextInt(); int b = Sc.NextInt(); Console.WriteLine(Anser(a, b)); } } private string Anser(int a,int b) { double bLoga = Math.Log10(a) * b; long Z; Z = (long)bLoga; double shousu = bLoga - Z; return string.Join(" ", Check(shousu), Z); } private string Check(double shousu) { for(int i = 1; i < 10; i++) { for(int j = 0; j < 10; j++) { if (Log[i, j] > shousu) { if (j == 0) { return string.Join(" ", i - 1, 9); } else { return string.Join(" ", i, j - 1); } } } } return "9 9"; } }