結果

問題 No.734 Careful Engineer
ユーザー ut0s
提出日時 2019-09-15 08:27:20
言語 C++14
(gcc 13.3.0 + boost 1.87.0)
結果
RE  
(最新)
AC  
(最初)
実行時間 -
コード長 691 bytes
コンパイル時間 1,297 ms
コンパイル使用メモリ 161,928 KB
実行使用メモリ 6,820 KB
最終ジャッジ日時 2025-01-18 00:08:13
合計ジャッジ時間 2,137 ms
ジャッジサーバーID
(参考情報)
judge4 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 4
other AC * 10 RE * 1
権限があれば一括ダウンロードができます

ソースコード

diff #

/**
  @file 734.cpp
  @title  No.734 Careful Engineer - yukicoder
  @url https://yukicoder.me/problems/no/734
**/

#include <bits/stdc++.h>
using namespace std;

typedef long long LL;
#define ALL(obj) (obj).begin(), (obj).end()
#define REP(i, N) for (int i = 0; i < (N); ++i)

int main() {
  LL A, B, C;
  cin >> A >> B >> C;

  if (60 * A < B) {
    cout << "-1" << endl;
  } else {
    // naive
    // for (LL X = 1;; X++) {
    //   LL by_hand = 60 * A * X;
    //   LL by_prog = B * X + C * 3600;
    //   if (by_hand >= by_prog) {
    //     cout << X << endl;
    //     break;
    //   }
    // }
    cout << ((C * 3600) + (60 * A - B) - 1) / (60 * A - B) << endl;
  }

  return 0;
}
0