알고리즘

[알고리즘] 백준 5928 - Contest Timing (C++)

blueberrysoda 2025. 2. 22. 23:52

[문제 링크] : https://www.acmicpc.net/problem/5928

#include <iostream>
using namespace std;

int D, H, M;

int main(){
    cin >> D >> H >> M;
    
    int tmp = 11 + 11 * 60 + 11 * 60 * 24;
    int Ans = M + H * 60 + D * 60 * 24 - tmp;

    if(Ans < 0){
        cout << -1 <<"\n";
    }
    else{
        cout << Ans <<"\n";
    }
    return 0;
}