結果
問題 | No.48 ロボットの操縦 |
ユーザー |
![]() |
提出日時 | 2018-06-04 16:18:24 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 2 ms / 5,000 ms |
コード長 | 556 bytes |
コンパイル時間 | 213 ms |
コンパイル使用メモリ | 31,616 KB |
実行使用メモリ | 6,944 KB |
最終ジャッジ日時 | 2024-06-30 09:41:24 |
合計ジャッジ時間 | 1,160 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 25 |
ソースコード
#include <stdio.h>#include <stdlib.h>int main(){long long int EW, NS;long long int dt, cnt = 0;scanf("%lld %lld %lld", &EW, &NS, &dt);if(NS >= 0 && EW != 0){cnt++;}else if(NS < 0){cnt += 2;}else if(NS == 0 && EW == 0){;}if(NS%dt == 0){cnt += llabs(NS)/dt;}else{cnt += llabs(NS)/dt + 1;}//if(EW != 0) cnt++;if(EW%dt == 0){cnt += llabs(EW)/dt;}else{cnt += llabs(EW)/dt + 1;}printf("%lld\n", cnt);return 0;}