結果
問題 | No.379 五円硬貨 |
ユーザー |
![]() |
提出日時 | 2016-06-17 23:27:01 |
言語 | C++11 (gcc 13.3.0) |
結果 |
AC
|
実行時間 | 1 ms / 1,000 ms |
コード長 | 321 bytes |
コンパイル時間 | 115 ms |
コンパイル使用メモリ | 23,296 KB |
実行使用メモリ | 6,820 KB |
最終ジャッジ日時 | 2024-10-09 17:09:03 |
合計ジャッジ時間 | 758 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 2 |
other | AC * 16 |
コンパイルメッセージ
main.cpp: In function ‘void div(long long int, long long int)’: main.cpp:9:26: warning: format ‘%d’ expects argument of type ‘int’, but argument 2 has type ‘long long int’ [-Wformat=] 9 | printf("%d", x / y); | ~^ ~~~~~ | | | | int long long int | %lld main.cpp: In function ‘int main()’: main.cpp:19:14: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result] 19 | scanf("%lld%lld%lld", &n, &g, &v); | ~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~
ソースコード
#include <stdio.h>void div(long long int x, long long int y) {printf("%lld.", x / y);x %= y;for(int i = 0; i < 12; i++) {x *= 10;printf("%d", x / y);x %= y;}printf("\n");return;}int main() {long long int n, g, v;scanf("%lld%lld%lld", &n, &g, &v);div(n / 5 * g, v);return 0;}