結果
| 問題 | 
                            No.48 ロボットの操縦
                             | 
                    
| コンテスト | |
| ユーザー | 
                             AQUA16573837
                         | 
                    
| 提出日時 | 2018-03-31 20:11:25 | 
| 言語 | C++11(廃止可能性あり)  (gcc 13.3.0)  | 
                    
| 結果 | 
                             
                                AC
                                 
                             
                            
                         | 
                    
| 実行時間 | 1 ms / 5,000 ms | 
| コード長 | 342 bytes | 
| コンパイル時間 | 218 ms | 
| コンパイル使用メモリ | 37,084 KB | 
| 実行使用メモリ | 5,376 KB | 
| 最終ジャッジ日時 | 2024-06-26 03:42:39 | 
| 合計ジャッジ時間 | 999 ms | 
| 
                            ジャッジサーバーID (参考情報)  | 
                        judge3 / judge5 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| other | AC * 25 | 
コンパイルメッセージ
main.cpp: In function ‘int main()’:
main.cpp:9:14: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
    9 |         scanf("%d %d %d", &y, &x, &l);
      |         ~~~~~^~~~~~~~~~~~~~~~~~~~~~~~
            
            ソースコード
#include <stdio.h>
#include <algorithm>
#include <deque>
using namespace std;
using ll = long long;
int main() {
	int x, y, l;
	scanf("%d %d %d", &y, &x, &l);
	int opes = 0;
	opes += (max(0, x) + l - 1) / l;
	opes += x < 0 || y != 0;
	opes += (abs(y) + l - 1) / l;
	opes += x < 0;
	opes += (max(0, -x) + l - 1) / l;
	printf("%d\n", opes);
}
            
            
            
        
            
AQUA16573837