結果

問題 No.51 やる気の問題
ユーザー etheriqaetheriqa
提出日時 2014-12-23 02:02:23
言語 C++11
(gcc 11.4.0)
結果
RE  
実行時間 -
コード長 858 bytes
コンパイル時間 1,198 ms
コンパイル使用メモリ 143,928 KB
実行使用メモリ 4,496 KB
最終ジャッジ日時 2023-09-02 21:35:00
合計ジャッジ時間 5,010 ms
ジャッジサーバーID
(参考情報)
judge14 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 RE -
testcase_01 RE -
testcase_02 RE -
testcase_03 RE -
testcase_04 RE -
testcase_05 RE -
testcase_06 RE -
testcase_07 RE -
testcase_08 RE -
testcase_09 RE -
testcase_10 RE -
testcase_11 RE -
testcase_12 RE -
testcase_13 RE -
testcase_14 RE -
testcase_15 RE -
testcase_16 RE -
testcase_17 RE -
testcase_18 RE -
testcase_19 RE -
testcase_20 RE -
testcase_21 RE -
testcase_22 RE -
権限があれば一括ダウンロードができます

ソースコード

diff #

#if defined(__GNUG__) && !defined(__clang__)
#include <bits/stdc++.h>
#endif

#define inf(T) (numeric_limits<T>::min())
#define sup(T) (numeric_limits<T>::max())
#define rep(i,n) for (int i = 0; i < (n); i++)
#define asc(c) (c).begin(), (c).end()
#define desc(c) (c).rbegin(), (c).rend()
#define mp(...) make_pair(__VA_ARGS__)
#define mt(...) make_tuple(__VA_ARGS__)

using namespace std;

using ll = long long;
using ld = long double;

template <class Key>          using uset = unordered_set<Key>;
template <class Key, class T> using umap = unordered_map<Key, T>;

int main()
{
  cin.tie(0);
  ios::sync_with_stdio(false);

  int x, y, l;
  cin >> x >> y >> l;
  int n_op;
  if (x == 0 && y >= 0) n_op = 0;
  else if (y >= 0) n_op = 1;
  else n_op = 2;
  n_op += (abs(x) + l - 1) / l;
  n_op += (abs(y) + l - 1) / l;
  cout << n_op << endl;

  return 0;
}
0