結果

問題 No.1236 長針と短針
ユーザー Rayhan AhmadRayhan Ahmad
提出日時 2020-09-26 00:58:23
言語 C++17(clang)
(17.0.6 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 751 bytes
コンパイル時間 4,574 ms
コンパイル使用メモリ 133,220 KB
実行使用メモリ 4,384 KB
最終ジャッジ日時 2023-09-10 17:41:53
合計ジャッジ時間 5,993 ms
ジャッジサーバーID
(参考情報)
judge15 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

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

ソースコード

diff #

#include<bits/stdc++.h>
using namespace std;
int main()
{
    vector<int>arr;
    arr.push_back(3600+5*60+27);
    arr.push_back(2*3600+10*60+55);
    arr.push_back(3*3600+21*60+22);
    arr.push_back(4*3600+21*60+49);
    arr.push_back(5*3600+27*60+17);
    arr.push_back(6*3600+32*60+44);
    arr.push_back(7*3600+38*60+11);
    arr.push_back(8*3600+43*60+38);
    arr.push_back(9*3600+49*60+6);
    arr.push_back(10*3600+54*60+33);
    arr.push_back(0);
    int ans = 1e9;
    int a, b;
    cin >> a >> b;
    a = a % 12;
    int total = a*3600 + b * 60;
    //cout << total << endl;
    for(int i=0; i<arr.size(); i++)
    {
        if(arr[i]-total>=0)
        {
            ans = min(ans,arr[i]-total);
        }
    }
    cout << ans << endl;
}
0