#include <bits/stdc++.h>
using namespace std;
int main()
{
ios::sync_with_stdio(0);
cin.tie(0);
int round, day, hour, minute;
cin >> round >> day >> hour >> minute;
vector<int> end_round = {2160, 3600, 5040, 6480, 9300};
int start_time = (day - 23) * 1440 + (hour - 12) * 60 + minute;
int change_time = 8040;
if (start_time >= 8040)
{
start_time -= 60;
}
int time_left = end_round[round - 1] - start_time;
cout << time_left << endl;
}
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 | #include <bits/stdc++.h> using namespace std; int main() { ios::sync_with_stdio(0); cin.tie(0); int round, day, hour, minute; cin >> round >> day >> hour >> minute; vector<int> end_round = {2160, 3600, 5040, 6480, 9300}; int start_time = (day - 23) * 1440 + (hour - 12) * 60 + minute; int change_time = 8040; if (start_time >= 8040) { start_time -= 60; } int time_left = end_round[round - 1] - start_time; cout << time_left << endl; } |
English