#include <bits/stdc++.h>
using namespace std;
int main() {
int x, d, h, m;
scanf("%d%d%d%d", &x, &d, &h, &m);
int ed = 23+x;
if (x == 5)
ed = 29;
int base = (ed-d)*24*60 + (24-h) * 60 - m;
if (x == 5) {
if (d == 29 && h > 2) {}
else
base -= 60;
}
printf("%d\n", base);
return 0;
}
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 | #include <bits/stdc++.h> using namespace std; int main() { int x, d, h, m; scanf("%d%d%d%d", &x, &d, &h, &m); int ed = 23+x; if (x == 5) ed = 29; int base = (ed-d)*24*60 + (24-h) * 60 - m; if (x == 5) { if (d == 29 && h > 2) {} else base -= 60; } printf("%d\n", base); return 0; } |
English