結果
| 問題 |
No.32 貯金箱の憂鬱
|
| コンテスト | |
| ユーザー |
bayashiko_r
|
| 提出日時 | 2018-10-30 00:13:23 |
| 言語 | C#(csc) (csc 3.9.0) |
| 結果 |
AC
|
| 実行時間 | 23 ms / 5,000 ms |
| コード長 | 732 bytes |
| コンパイル時間 | 853 ms |
| コンパイル使用メモリ | 109,304 KB |
| 実行使用メモリ | 25,804 KB |
| 最終ジャッジ日時 | 2024-07-23 07:18:17 |
| 合計ジャッジ時間 | 1,666 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 12 |
コンパイルメッセージ
Microsoft (R) Visual C# Compiler version 3.9.0-6.21124.20 (db94f4cc) Copyright (C) Microsoft Corporation. All rights reserved.
ソースコード
using System;
class Program {
static void Main(string[] args) {
//100円玉の枚数
int L = int.Parse(Console.ReadLine());
//25円玉の枚数
int M = int.Parse(Console.ReadLine());
//1円玉の枚数
int N = int.Parse(Console.ReadLine());
//合計金額
int sum = L * 100 + M * 25 + N;
//1000円札の枚数
int O_result = sum / 1000;
//100円玉の枚数
int L_result = (sum - O_result * 1000) / 100;
//25円玉の枚数
int M_result = (sum - O_result * 1000 - L_result * 100) / 25;
//1円玉の枚数
int N_result = sum % 25;
Console.WriteLine(L_result + M_result + N_result);
}
}
bayashiko_r