結果
問題 |
No.48 ロボットの操縦
|
ユーザー |
![]() |
提出日時 | 2018-06-21 16:12:24 |
言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 391 bytes |
コンパイル時間 | 116 ms |
コンパイル使用メモリ | 22,656 KB |
実行使用メモリ | 6,944 KB |
最終ジャッジ日時 | 2024-06-30 17:36:38 |
合計ジャッジ時間 | 822 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 22 WA * 3 |
コンパイルメッセージ
main.cpp: In function ‘int main()’: main.cpp:7:8: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result] 7 | scanf("%ld", &X); | ~~~~~^~~~~~~~~~~ main.cpp:8:8: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result] 8 | scanf("%ld", &Y); | ~~~~~^~~~~~~~~~~ main.cpp:9:8: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result] 9 | scanf("%ld", &L); | ~~~~~^~~~~~~~~~~
ソースコード
#include<stdio.h> int main(void){ long int X, Y, L; long int order = 0; scanf("%ld", &X); scanf("%ld", &Y); scanf("%ld", &L); if(Y < 0) order += 2; else if(X < 0) order += 1; if(X < 0) X = -1 * X; if(Y < 0) Y = -1 * Y; if(X % L) order += X / L + 1; else order += X / L; if(Y % L) order += Y / L + 1; else order += Y / L; printf("%ld\n", order); return 0; }