結果
問題 |
No.48 ロボットの操縦
|
ユーザー |
![]() |
提出日時 | 2018-06-21 16:07:33 |
言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 379 bytes |
コンパイル時間 | 99 ms |
コンパイル使用メモリ | 22,400 KB |
実行使用メモリ | 5,376 KB |
最終ジャッジ日時 | 2024-06-30 17:36:27 |
合計ジャッジ時間 | 879 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 19 WA * 6 |
コンパイルメッセージ
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(X != 0) order += 1; if(Y < 0) order += 2; if(X < 0) X = -X; if(Y < 0) Y = -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; }