結果
問題 | No.46 はじめのn歩 |
ユーザー |
|
提出日時 | 2017-10-21 15:46:38 |
言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
結果 |
AC
|
実行時間 | 1 ms / 5,000 ms |
コード長 | 556 bytes |
コンパイル時間 | 280 ms |
コンパイル使用メモリ | 30,464 KB |
実行使用メモリ | 6,820 KB |
最終ジャッジ日時 | 2024-11-21 12:30:59 |
合計ジャッジ時間 | 1,069 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 10 |
コンパイルメッセージ
main.cpp: In function ‘int main()’: main.cpp:14:14: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result] 14 | scanf("%d %d", &in_a, &in_b); | ~~~~~^~~~~~~~~~~~~~~~~~~~~~~
ソースコード
#include <stdio.h> #include <math.h> #define DEF_INPUT_MIN (1) #define DEF_INPUT_MAX (pow(10, 9)) int main(void) { int amari = 0; int in_a = 0; int in_b = 0; int out = 0; while(1) { scanf("%d %d", &in_a, &in_b); if(in_a < DEF_INPUT_MIN) { continue; } if(in_b > DEF_INPUT_MAX) { continue; } amari = in_b % in_a; if(amari > 0) { out += 1; } out += in_b / in_a; printf("%d\n", out); break; } return 0; }