結果
問題 | No.32 貯金箱の憂鬱 |
ユーザー | SagToki |
提出日時 | 2018-06-08 14:38:33 |
言語 | C#(csc) (csc 3.9.0) |
結果 |
AC
|
実行時間 | 56 ms / 5,000 ms |
コード長 | 1,407 bytes |
コンパイル時間 | 2,113 ms |
コンパイル使用メモリ | 105,288 KB |
実行使用メモリ | 22,848 KB |
最終ジャッジ日時 | 2023-09-30 13:12:15 |
合計ジャッジ時間 | 3,541 ms |
ジャッジサーバーID (参考情報) |
judge11 / judge13 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 56 ms
20,760 KB |
testcase_01 | AC | 56 ms
20,696 KB |
testcase_02 | AC | 56 ms
20,728 KB |
testcase_03 | AC | 55 ms
18,644 KB |
testcase_04 | AC | 56 ms
20,764 KB |
testcase_05 | AC | 56 ms
22,756 KB |
testcase_06 | AC | 56 ms
22,756 KB |
testcase_07 | AC | 56 ms
22,728 KB |
testcase_08 | AC | 56 ms
22,744 KB |
testcase_09 | AC | 56 ms
22,848 KB |
testcase_10 | AC | 55 ms
18,644 KB |
testcase_11 | AC | 56 ms
22,832 KB |
コンパイルメッセージ
Microsoft (R) Visual C# Compiler version 3.9.0-6.21124.20 (db94f4cc) Copyright (C) Microsoft Corporation. All rights reserved.
ソースコード
using System; namespace Yukicorder_032 { class Program { static void Main(string[] args) { int L = Input(0, 1000); int M = Input(0, 1000); int N = Input(0, 1000); int Result = Processing(L, M, N); Console.WriteLine(Result); } static int Input(int Min , int Max) { int Number = 0; try { Number = int.Parse(Console.ReadLine()); if(Number < Min || Number > Max) { Console.WriteLine(Min + "以上" + Max + "以下で入力してください"); } }catch(FormatException e) { Console.WriteLine("数字を入力してください"); }catch(Exception E) { Console.WriteLine("予期せぬエラーです"); } return Number; } static int Processing(int L , int M , int N) { int Count = 0; if(N >= 25) { Count += N % 25; M += N / 25; }else{ Count += N; } if(M >= 4) { Count += M % 4; L += M / 4; }else{ Count += M; } if(L >= 10) { Count += L % 10; } return Count; } } }