結果

問題 No.1236 長針と短針
ユーザー YamaKasa
提出日時 2020-09-26 00:42:47
言語 C++14
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 2 ms / 2,000 ms
コード長 548 bytes
コンパイル時間 1,568 ms
コンパイル使用メモリ 165,324 KB
実行使用メモリ 5,376 KB
最終ジャッジ日時 2024-06-28 08:43:11
合計ジャッジ時間 2,339 ms
ジャッジサーバーID
(参考情報)
judge1 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 20
権限があれば一括ダウンロードができます

ソースコード

diff #

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

int main() {
    int A, B;
    cin >> A >> B;
    A %= 12;
    double t1 = (6 * B) % 360;
    double t2 = (30 * A) % 360 + (double)B / 2.0;
    //cout << t1 << " " << t2 << "\n";
    int f1 = 2 * 6 * B;
    int f2 = 2 * 30 * A + B;
    if (t1 > t2) {
        cout << (720 - (f1 - f2)) * 60 / 11 << "\n";
    } else {
        cout << (f2 - f1) * 60 / 11 << "\n";
    }
    // cout << (360 - (f1 - f2)) * 60 / 11 << "\n";
    // cout << (f2 - f1) * 60 / 11 << "\n";
    return 0;
}
0