結果

問題 No.32 貯金箱の憂鬱
ユーザー curryudon08curryudon08
提出日時 2020-02-11 22:26:12
言語 C#(csc)
(csc 3.9.0)
結果
WA  
実行時間 -
コード長 824 bytes
コンパイル時間 4,367 ms
コンパイル使用メモリ 109,424 KB
実行使用メモリ 24,968 KB
最終ジャッジ日時 2024-04-08 16:00:13
合計ジャッジ時間 2,126 ms
ジャッジサーバーID
(参考情報)
judge13 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 27 ms
24,968 KB
testcase_01 AC 27 ms
24,968 KB
testcase_02 WA -
testcase_03 WA -
testcase_04 WA -
testcase_05 WA -
testcase_06 WA -
testcase_07 WA -
testcase_08 WA -
testcase_09 AC 26 ms
24,968 KB
testcase_10 WA -
testcase_11 WA -
権限があれば一括ダウンロードができます
コンパイルメッセージ
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.Linq;
using System.Collections.Generic;

namespace _0032
{
    class Program
    {
        static void Main(string[] args)
        {
            var coins = new int[4];
            coins[3] = 0;
            foreach(var i in Enumerable.Range(0,3)){
                coins[i] = int.Parse(Console.ReadLine());
            }
            
            var changes = new int[3]{25,4,10};
            foreach(var i in Enumerable.Range(0,3)){
                while(true){
                    if(coins[i] - changes[i] >= 0){
                        coins[i] -= changes[i];
                        coins[i+1] += 1;
                    }else{
                        break;
                    }
                }
            }

            Console.WriteLine(coins[0] + coins[1] + coins[2]);
        }
    }
}
0