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 endl '\n' #define ll long long #define ull unsigned long long #define size(v) ((int)v.size()) #define all(v) v.begin(), v.end() #define x first #define y second using namespace std; int dx[] = {-1, 0, 1, 0}, dy[] = {0, 1, 0, -1};
int months[13] = {0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};
void solve() { int y,t; cin >> y >> t; if ((y % 4 == 0 && y % 100 != 0) || y % 400 == 0) months[2] = 29; else months[2] = 28;
cout << months[t] << endl; }
int main() { ios::sync_with_stdio(0), cin.tie(0), cout.tie(0); int _; _ = 1; while (_--) solve();
return 0; }
|