結果
| 問題 |
No.722 100×100=1000
|
| コンテスト | |
| ユーザー |
バカらっく
|
| 提出日時 | 2018-08-04 22:45:04 |
| 言語 | C#(csc) (csc 3.9.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 1,979 bytes |
| コンパイル時間 | 1,039 ms |
| コンパイル使用メモリ | 113,264 KB |
| 実行使用メモリ | 29,468 KB |
| 最終ジャッジ日時 | 2024-10-12 10:51:35 |
| 合計ジャッジ時間 | 2,982 ms |
|
ジャッジサーバーID (参考情報) |
judge2 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 WA * 1 |
| other | AC * 21 WA * 6 |
コンパイルメッセージ
Microsoft (R) Visual C# Compiler version 3.9.0-6.21124.20 (db94f4cc) Copyright (C) Microsoft Corporation. All rights reserved.
ソースコード
using System;
using System.IO;
using System.Linq;
using System.Collections.Generic;
using System.Text;
public class Program
{
public void Proc()
{
int[] inpt = Reader.ReadLine().Split(' ').Select(a => int.Parse(a)).ToArray();
if(IsAnsan(inpt)) {
long ans = inpt[0] * inpt[1] / 10;
Console.WriteLine(ans);
} else {
long ans = inpt[0] * inpt[1];
if(Math.Abs(ans)> 99999999) {
Console.WriteLine("E");
} else {
Console.WriteLine(ans);
}
}
}
private bool IsAnsan(int[] inpt) {
foreach(int item in inpt) {
if(item == 0) {
return false;
}
string nokori;
if(item < 0) {
nokori = item.ToString().Substring(2);
} else {
nokori = item.ToString().Substring(1);
}
if(nokori.Length < 1) {
return false;
}
if(nokori.Any(a=>a!='0')) {
return false;
}
}
return true;
}
private int[] GetIntArray() {
return Reader.ReadLine().Trim().Split(' ').Select(a => int.Parse(a)).ToArray();
}
public class Reader
{
static StringReader sr;
public static bool IsDebug = false;
public static string ReadLine()
{
if (IsDebug)
{
if (sr == null)
{
sr = new StringReader(InputText.Trim());
}
return sr.ReadLine();
}
else
{
return Console.ReadLine();
}
}
private static string InputText = @"
-123 -456
";
}
public static void Main(string[] args)
{
#if DEBUG
Reader.IsDebug = true;
#endif
Program prg = new Program();
prg.Proc();
}
}
バカらっく