結果

問題 No.722 100×100=1000
ユーザー keymoon
提出日時 2020-02-05 14:50:05
言語 C#(csc)
(csc 3.9.0)
結果
AC  
実行時間 34 ms / 2,000 ms
コード長 972 bytes
コンパイル時間 4,198 ms
コンパイル使用メモリ 106,496 KB
実行使用メモリ 19,456 KB
最終ジャッジ日時 2024-12-29 19:51:24
合計ジャッジ時間 4,129 ms
ジャッジサーバーID
(参考情報)
judge3 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 4
other AC * 27
権限があれば一括ダウンロードができます
コンパイルメッセージ
Microsoft (R) Visual C# Compiler version 3.9.0-6.21124.20 (db94f4cc)
Copyright (C) Microsoft Corporation. All rights reserved.

ソースコード

diff #

using System;
using System.IO;
using System.Linq;
using System.Collections;
using System.Collections.Generic;
using System.Numerics;
using System.Diagnostics;
using System.Text;
using System.Text.RegularExpressions;
using System.Threading.Tasks;
using static System.Math;
using MethodImplOptions = System.Runtime.CompilerServices.MethodImplOptions;
using MethodImplAttribute = System.Runtime.CompilerServices.MethodImplAttribute;


static class P
{
    static void Main()
    {
        var ab = Console.ReadLine().Split().Select(long.Parse).ToList();
        if (IsEasyNum(ab[0]) && IsEasyNum(ab[1])) Console.WriteLine(ab[0] * ab[1] / 10);
        else Console.WriteLine(Abs(ab[0] * ab[1]) <= 99999999 ? (ab[0] * ab[1]).ToString() : "E");
    }

    static bool IsEasyNum(long num)
    {
        var log = num.ToString().Reverse().TakeWhile(x => x == '0').Count();
        var pow = Pow(10, log);
        var d = num / pow;
        return log >= 2 && Abs(d) < 10;
    }
}
0