結果

問題 No.32 貯金箱の憂鬱
コンテスト
ユーザー Maeda
提出日時 2025-03-07 13:11:12
言語 C
(gcc 15.2.0)
コンパイル:
gcc-15 -O2 -DONLINE_JUDGE -o a.out _filename_ -lm
実行:
./a.out
結果
RE  
実行時間 -
コード長 640 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 59 ms
コンパイル使用メモリ 37,248 KB
実行使用メモリ 5,888 KB
最終ジャッジ日時 2026-07-23 15:17:46
合計ジャッジ時間 1,230 ms
ジャッジサーバーID
(参考情報)
judge1_0 / judge3_0
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other RE * 12
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

#include <stdio.h>

void main(void){
	int l = 0 , m = 0 , n = 0 ;
	
	int input =  scanf("%d",&l);
	if(input == 2){
		printf("Lの入力ミス\n");
	}
	int total = 100*l;
	
	input =  scanf("%d",&m);
	if(input == 2){
		printf("Mの入力ミス\n");
	}
	total += m*25;
	
	input =  scanf("%d",&n);
	if(input == 2){
		printf("Nの入力ミス\n");
	}
	total += 1*n;
	int thousandYenBill = total / 1000;
	int remainingMoney = total - thousandYenBill;
	
	int coin = 0;
	while( remainingMoney >= 100 ){
		remainingMoney -= 100;
		coin++;
	}
	while( remainingMoney >= 25 ){
		remainingMoney -= 25;
		coin++;
	}
	printf("%d\n",coin+remainingMoney);
}
0