結果
問題 |
No.48 ロボットの操縦
|
ユーザー |
|
提出日時 | 2017-03-08 20:19:19 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 285 bytes |
コンパイル時間 | 595 ms |
コンパイル使用メモリ | 67,768 KB |
実行使用メモリ | 6,948 KB |
最終ジャッジ日時 | 2024-06-23 19:26:15 |
合計ジャッジ時間 | 1,422 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 19 WA * 6 |
ソースコード
#include<iostream> #include<cmath> using namespace std; int main(){ int x, y, l; cin >> x >> y >> l; int xl = abs(x)/l, yl = abs(y)/l; if(x%l != 0) xl += 1; if(y%l != 0) yl += 1; int dir = 0; if(y < 0) dir += 2; if(x != 0) dir += 1; cout << dir + xl + yl << endl; }