#include "bits/stdc++.h"
#define all(v) (v).begin(), (v).end()
#define st first
#define nd second
#define printv(a) { for(auto u : a) cout<<u<<" "; cout<<"\n"; }
#define debug(x) cerr << #x << " = " << x << '\n';
using namespace std;
using ll = long long;
using pii = pair<int,int>;
using vi = vector<int>;
using si = set<int>;
using mii = map<int,int>;
const int H = 60, D = 1440;
vector<int> kon = {2880, 4320, 5760, 7200, 7200 + D*2 - 60};
int main(){
ios_base::sync_with_stdio(0);
cin.tie(0);
int x,d,h,m;
cin>>x>>d>>h>>m;
int k = kon[x-1];
int p = (d - 23) * D;
p += h * H;
p += m;
if(d == 29 && h > 2) p -= 60;
cout<<k - p<<endl;
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 24 25 26 27 28 29 30 31 32 33 | #include "bits/stdc++.h" #define all(v) (v).begin(), (v).end() #define st first #define nd second #define printv(a) { for(auto u : a) cout<<u<<" "; cout<<"\n"; } #define debug(x) cerr << #x << " = " << x << '\n'; using namespace std; using ll = long long; using pii = pair<int,int>; using vi = vector<int>; using si = set<int>; using mii = map<int,int>; const int H = 60, D = 1440; vector<int> kon = {2880, 4320, 5760, 7200, 7200 + D*2 - 60}; int main(){ ios_base::sync_with_stdio(0); cin.tie(0); int x,d,h,m; cin>>x>>d>>h>>m; int k = kon[x-1]; int p = (d - 23) * D; p += h * H; p += m; if(d == 29 && h > 2) p -= 60; cout<<k - p<<endl; return 0; } |
English