結果
問題 |
No.48 ロボットの操縦
|
ユーザー |
![]() |
提出日時 | 2025-03-11 15:52:35 |
言語 | C (gcc 13.3.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 347 bytes |
コンパイル時間 | 314 ms |
コンパイル使用メモリ | 24,576 KB |
実行使用メモリ | 7,328 KB |
最終ジャッジ日時 | 2025-03-11 15:52:37 |
合計ジャッジ時間 | 1,294 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 3 WA * 22 |
コンパイルメッセージ
main.c: In function ‘main’: main.c:5:5: warning: ignoring return value of ‘scanf’ declared with attribute ‘warn_unused_result’ [-Wunused-result] 5 | scanf("%d\n%d\n%d",&x,&y,&l); | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
ソースコード
#include <stdio.h> void main(void){ int x = 0 , y = 0 , l = 0; scanf("%d\n%d\n%d",&x,&y,&l); int turn = 0; if(y < 0 && x >= 0){ y *= -1; turn = 1 + x/l + 1 + y/l + 1 ; }else if(y >= 0 && x != 0){ turn = y/l + 1 + x/l; }else if(y >= 0 && x == 0){ turn = y/l; } printf("%d",turn); }