結果
問題 |
No.48 ロボットの操縦
|
ユーザー |
![]() |
提出日時 | 2018-06-21 16:03:43 |
言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 365 bytes |
コンパイル時間 | 114 ms |
コンパイル使用メモリ | 22,912 KB |
実行使用メモリ | 6,948 KB |
最終ジャッジ日時 | 2024-06-30 17:36:24 |
合計ジャッジ時間 | 969 ms |
ジャッジサーバーID (参考情報) |
judge5 / 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("%d", &X); | ~~~~~^~~~~~~~~~ main.cpp:8:8: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result] 8 | scanf("%d", &Y); | ~~~~~^~~~~~~~~~ main.cpp:9:8: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result] 9 | scanf("%d", &L); | ~~~~~^~~~~~~~~~
ソースコード
#include<stdio.h> int main(void){ int X, Y, L; int order = 0; scanf("%d", &X); scanf("%d", &Y); scanf("%d", &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("%d\n", order); return 0; }