Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <bits/stdc++.h>
- using namespace std;
- typedef long long LL;
- const int maxn = 100 + 100;
- int days[13] = {0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};
- int cal(int year, int month, int day) {
- int ret = 0;
- for (int i = 0; i <= year; ++i) {
- if (i % 400 == 0 || (i % 4 == 0 && i % 100 != 0)) {
- days[2] = 29;
- } else {
- days[2] = 28;
- }
- int maxMonth = (i == year ? month : 12);
- for (int j = 1; j <= maxMonth; ++j) {
- ret += (i == year && j == month ? day : days[j]);
- }
- }
- return ret;
- }
- int main() {
- #ifdef ExRoc
- freopen("test.txt", "r", stdin);
- #endif // ExRoc
- ios::sync_with_stdio(false);
- for (int i = 2026; i <= 10000; ++i) {
- int sq = sqrt(i);
- if (sq * sq == i) {
- cout << cal(i, 1, 1) - cal(2025, 3, 29) << endl;
- return 0;
- }
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement