結果
| 問題 |
No.48 ロボットの操縦
|
| コンテスト | |
| ユーザー |
AQUA16573837
|
| 提出日時 | 2018-03-31 20:10:29 |
| 言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 332 bytes |
| コンパイル時間 | 248 ms |
| コンパイル使用メモリ | 36,936 KB |
| 実行使用メモリ | 6,948 KB |
| 最終ジャッジ日時 | 2024-06-26 03:42:37 |
| 合計ジャッジ時間 | 1,328 ms |
|
ジャッジサーバーID (参考情報) |
judge5 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 5 WA * 20 |
コンパイルメッセージ
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;
opes += x < 0;
opes += (max(0, -x) + l - 1) / l;
printf("%d\n", opes);
}
AQUA16573837