結果

問題 No.1236 長針と短針
コンテスト
ユーザー YamaKasa
提出日時 2020-09-26 00:35:29
言語 C++14
(gcc 15.2.0 + boost 1.89.0)
コンパイル:
g++-15 -O2 -lm -std=c++14 -Wuninitialized -DONLINE_JUDGE -o a.out _filename_
実行:
./a.out
結果
WA  
実行時間 -
コード長 548 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 1,058 ms
コンパイル使用メモリ 183,496 KB
実行使用メモリ 7,848 KB
最終ジャッジ日時 2026-03-16 20:40:41
合計ジャッジ時間 1,744 ms
ジャッジサーバーID
(参考情報)
judge2_0 / judge3_0
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2 WA * 1
other AC * 15 WA * 5
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

#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 << (360 - (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