-
Codeforces Round #457 (Div. 2) - A. Jamie and Alarm Snooze코드포스(CodeForce) 2018. 8. 17. 17:34반응형
1. 문제
2. 알고리즘
키워드 -
3. 코드
123456789101112131415161718192021222324252627282930313233343536#include <cstdio>#include <cmath>#include <queue>#include <cstring>#include <iostream>#include <algorithm>using namespace std;typedef long long ll;char s[5010];int len;int main(){int x;cin>>x;int h, m;cin >> h >> m;int count = 0;while (h % 10 != 7 && m % 10 != 7) {if (m < x) {m = (m + 60 - x) % 60;h = (h == 0) ? 23 : --h;} else {m -= x;}count++;}cout << count << endl;return 0;}cs 반응형'코드포스(CodeForce)' 카테고리의 다른 글