結果
問題 |
No.48 ロボットの操縦
|
ユーザー |
|
提出日時 | 2018-05-01 23:25:59 |
言語 | C (gcc 13.3.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 250 bytes |
コンパイル時間 | 163 ms |
コンパイル使用メモリ | 29,312 KB |
実行使用メモリ | 6,948 KB |
最終ジャッジ日時 | 2024-06-28 00:15:35 |
合計ジャッジ時間 | 1,075 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 11 WA * 14 |
コンパイルメッセージ
main.c: In function 'main': main.c:8:13: warning: implicit declaration of function 'abs' [-Wimplicit-function-declaration] 8 | t = abs(x) + abs(y); | ^~~ main.c:3:1: note: include '<stdlib.h>' or provide a declaration of 'abs' 2 | #include <math.h> +++ |+#include <stdlib.h> 3 |
ソースコード
#include <stdio.h> #include <math.h> int main(void) { int x, y, l, s = 0, t; scanf("%d\n%d\n%d", &x, &y, &l); t = abs(x) + abs(y); x != 0 ? s++ : 0; y < 0 ? s += 2 : 0; s += t / l; t%l ? s++ : 0; printf("%d\n", s); return 0; }