結果
問題 |
No.48 ロボットの操縦
|
ユーザー |
![]() |
提出日時 | 2018-09-17 21:48:11 |
言語 | C (gcc 13.3.0) |
結果 |
RE
|
実行時間 | - |
コード長 | 878 bytes |
コンパイル時間 | 124 ms |
コンパイル使用メモリ | 28,672 KB |
実行使用メモリ | 6,948 KB |
最終ジャッジ日時 | 2024-07-18 07:50:28 |
合計ジャッジ時間 | 3,220 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | RE * 25 |
ソースコード
#include <stdio.h> #include <stdlib.h> int inscal(int x,int y,int l); int main() { int x,y,l; int instruction=0; int absx,absy; absx=abs(x); absy=abs(y); instruction=inscal(absx,absy,l); if(y>=0){ instruction++; } else{ instruction+=2; } printf("%d",instruction); return 0; } int inscal(int x,int y,int l) { int instruction=0; if(x<l){ instruction++; } else{ if(x%l==0){ instruction+=x/l; } else{ instruction+=x/l+1; } } if(y<l){ instruction++; } else{ if(y%l==0){ instruction+=y/l; } else{ instruction+=y/l+1; } } return instruction; }