結果
| 問題 |
No.46 はじめのn歩
|
| コンテスト | |
| ユーザー |
sasa
|
| 提出日時 | 2025-03-03 14:54:47 |
| 言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
AC
|
| 実行時間 | 382 ms / 5,000 ms |
| コード長 | 239 bytes |
| コンパイル時間 | 308 ms |
| コンパイル使用メモリ | 27,904 KB |
| 実行使用メモリ | 6,820 KB |
| 最終ジャッジ日時 | 2025-03-03 14:54:48 |
| 合計ジャッジ時間 | 1,542 ms |
|
ジャッジサーバーID (参考情報) |
judge5 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 10 |
コンパイルメッセージ
main.cpp: In function ‘int main()’:
main.cpp:6:14: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
6 | scanf("%d",&step);
| ~~~~~^~~~~~~~~~~~
main.cpp:8:14: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
8 | scanf("%d",&distance);
| ~~~~~^~~~~~~~~~~~~~~~
ソースコード
#include <stdio.h>
#include <stdlib.h>
int main(void){
int step = 0;
scanf("%d",&step);
int distance = 0;
scanf("%d",&distance);
int tmp = 0;
int count = 0;
while(tmp < distance){
tmp += step;
count++;
}
printf("%d",count);
}
sasa