結果

問題 No.1236 長針と短針
ユーザー ninoinui
提出日時 2020-09-25 22:24:59
言語 C++17
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 4 ms / 2,000 ms
コード長 488 bytes
コンパイル時間 2,782 ms
コンパイル使用メモリ 192,312 KB
最終ジャッジ日時 2025-01-14 21:06:23
ジャッジサーバーID
(参考情報)
judge1 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 20
権限があれば一括ダウンロードができます

ソースコード

diff #

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

template <typename T, typename U> void cmin(T &a, U b) {
  if (a > b) a = b;
}
template <typename T, typename U> void cmax(T &a, U b) {
  if (a < b) a = b;
}

int main() {
  cin.tie(nullptr);
  ios_base::sync_with_stdio(false);

  int A, B;
  cin >> A >> B;
  if (A >= 12) A -= 12;
 
  long double H = 360 / 12 * A + 360.0 / 12 / 60 * B;
  long double M = 360 / 60 * B;
  if (H < M) H += 360.0;
  cout << floor((H - M) / 5.5 * 60) << "\n";
}
0