結果
| 問題 |
No.32 貯金箱の憂鬱
|
| コンテスト | |
| ユーザー |
jolly_gliscor
|
| 提出日時 | 2018-02-20 18:12:31 |
| 言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
| 結果 |
AC
|
| 実行時間 | 1 ms / 5,000 ms |
| コード長 | 507 bytes |
| コンパイル時間 | 487 ms |
| コンパイル使用メモリ | 37,468 KB |
| 実行使用メモリ | 5,376 KB |
| 最終ジャッジ日時 | 2024-07-23 07:04:05 |
| 合計ジャッジ時間 | 843 ms |
|
ジャッジサーバーID (参考情報) |
judge2 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 12 |
コンパイルメッセージ
main.cpp: In function ‘int main()’:
main.cpp:31:8: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
31 | scanf("%d",&a);
| ~~~~~^~~~~~~~~
main.cpp:32:8: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
32 | scanf("%d",&b);
| ~~~~~^~~~~~~~~
main.cpp:33:8: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
33 | scanf("%d",&c);
| ~~~~~^~~~~~~~~
ソースコード
#include <cstdlib>
#include <cstdio>
#include <vector>
#include <algorithm>
#define L 1000
#define M 100
#define N 25
void CountTotalCoins(int x, int y, int z)
{
int sum, c1000, c100, c25, c1;
sum = M*x + N*y + z;
c1000 = sum / L;
sum -= L * c1000;
c100 = sum / M;
sum -= M * c100;
c25 = sum / N;
sum -= N * c25;
c1 = sum;
printf("%d\n",c100+c25+c1);
}
int main(void)
{
int a,b,c;
scanf("%d",&a);
scanf("%d",&b);
scanf("%d",&c);
CountTotalCoins(a,b,c);
return 0;
}
jolly_gliscor