結果

問題 No.2681 ゲームセンターの両替
ユーザー Maeda
提出日時 2025-04-02 17:08:37
言語 C#
(.NET 8.0.404)
結果
AC  
実行時間 69 ms / 2,000 ms
コード長 782 bytes
コンパイル時間 8,975 ms
コンパイル使用メモリ 171,816 KB
実行使用メモリ 187,156 KB
最終ジャッジ日時 2025-04-02 17:08:49
合計ジャッジ時間 11,859 ms
ジャッジサーバーID
(参考情報)
judge3 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 23
権限があれば一括ダウンロードができます
コンパイルメッセージ
  復元対象のプロジェクトを決定しています...
  /home/judge/data/code/main.csproj を復元しました (116 ミリ秒)。
  main -> /home/judge/data/code/bin/Release/net8.0/main.dll
  main -> /home/judge/data/code/bin/Release/net8.0/publish/

ソースコード

diff #

    class Program
    {
        static void Main(string[] args)
        {
            string[] coinMoney = Console.ReadLine().Split(' ');
            if (int.Parse(coinMoney[1])/100 < int.Parse(coinMoney[0]))
            {
                Console.WriteLine("can't exchange");
            }
            else
            {
                if ((int.Parse(coinMoney[1]) % 500 / 100) >= int.Parse(coinMoney[0]) && int.Parse(coinMoney[0])  <  5)
                {
                    Console.WriteLine("no exchange");
                }else
                {
                    int remaining = int.Parse(coinMoney[1]) - (int.Parse(coinMoney[0]) * 100);
                    Console.WriteLine(int.Parse(coinMoney[0]) +  (remaining %500/100));
                }
            }
        }
    }
0