#include <cstdio>
using namespace std;
int fin[5] = {24, 25, 26, 27, 29};
int main(void){
int x, d, h, m;
scanf("%d%d%d%d", &x, &d, &h, &m);
x--;
int z = (fin[x] - d)*24*60 + (23-h)*60 + (60-m);
if (x == 4 && (d < fin[x] || h < 2)) z -= 60;
printf("%d\n", z);
return 0;
}
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 | #include <cstdio> using namespace std; int fin[5] = {24, 25, 26, 27, 29}; int main(void){ int x, d, h, m; scanf("%d%d%d%d", &x, &d, &h, &m); x--; int z = (fin[x] - d)*24*60 + (23-h)*60 + (60-m); if (x == 4 && (d < fin[x] || h < 2)) z -= 60; printf("%d\n", z); return 0; } |
English