結果
問題 | No.1236 長針と短針 |
ユーザー |
![]() |
提出日時 | 2020-09-25 22:23:56 |
言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 3 ms / 2,000 ms |
コード長 | 2,061 bytes |
コンパイル時間 | 2,342 ms |
コンパイル使用メモリ | 194,416 KB |
最終ジャッジ日時 | 2025-01-14 21:05:37 |
ジャッジサーバーID (参考情報) |
judge2 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 20 |
ソースコード
#define _USE_MATH_DEFINES #include <bits/stdc++.h> using namespace std; #define FOR(i,m,n) for(int i=(m);i<(n);++i) #define REP(i,n) FOR(i,0,n) #define ALL(v) (v).begin(),(v).end() using ll = long long; constexpr int INF = 0x3f3f3f3f; constexpr ll LINF = 0x3f3f3f3f3f3f3f3fLL; constexpr double EPS = 1e-8; constexpr int MOD = 1000000007; // constexpr int MOD = 998244353; constexpr int dy[] = {1, 0, -1, 0}, dx[] = {0, -1, 0, 1}; constexpr int dy8[] = {1, 1, 0, -1, -1, -1, 0, 1}, dx8[] = {0, -1, -1, -1, 0, 1, 1, 1}; template <typename T, typename U> inline bool chmax(T &a, U b) { return a < b ? (a = b, true) : false; } template <typename T, typename U> inline bool chmin(T &a, U b) { return a > b ? (a = b, true) : false; } struct IOSetup { IOSetup() { cin.tie(nullptr); ios_base::sync_with_stdio(false); cout << fixed << setprecision(20); } } iosetup; int main() { int a, b; cin >> a >> b; a %= 12; int t = a * 60 * 60 + b * 60; if (t == 0) { cout << 0 << '\n'; } else if (t <= 1 * 60 * 60 + 5 * 60 + 27) { cout << 1 * 60 * 60 + 5 * 60 + 27 - t << '\n'; } else if (t <= 2 * 60 * 60 + 10 * 60 + 54) { cout << 2 * 60 * 60 + 10 * 60 + 54 - t << '\n'; } else if (t <= 3 * 60 * 60 + 16 * 60 + 21) { cout << 3 * 60 * 60 + 16 * 60 + 21 - t << '\n'; } else if (t <= 4 * 60 * 60 + 21 * 60 + 49) { cout << 4 * 60 * 60 + 21 * 60 + 49 - t << '\n'; } else if (t <= 5 * 60 * 60 + 27 * 60 + 16) { cout << 5 * 60 * 60 + 27 * 60 + 16 - t << '\n'; } else if (t <= 6 * 60 * 60 + 32 * 60 + 43) { cout << 6 * 60 * 60 + 32 * 60 + 43 - t << '\n'; } else if (t <= 7 * 60 * 60 + 38 * 60 + 10) { cout << 7 * 60 * 60 + 38 * 60 + 10 - t << '\n'; } else if (t <= 8 * 60 * 60 + 43 * 60 + 38) { cout << 8 * 60 * 60 + 43 * 60 + 38 - t << '\n'; } else if (t <= 9 * 60 * 60 + 49 * 60 + 5) { cout << 9 * 60 * 60 + 49 * 60 + 5 - t << '\n'; } else if (t <= 10 * 60 * 60 + 54 * 60 + 32) { cout << 10 * 60 * 60 + 54 * 60 + 32 - t << '\n'; } else { cout << 12 * 60 * 60 - t << '\n'; } return 0; }