求条
查看原帖
求条
1319065
cxlqwq楼主2024/11/2 11:47
#pragma optimize(3)
#include <bits/stdc++.h>
#define MAXN 10010
using namespace std;

int main() {
	ios::sync_with_stdio(false);
	cin.tie(0);
	int x, y, ans[MAXN], tmp = 0;
	cin >> x >> y;
	int count = 0;
	for (int i = x; i <= y; i++) {
		if (i % 400 == 0 || (i % 4 == 0 && i % 100 != 0)) {
			i = ans[tmp];
			count++;
			tmp++;
		}
	}
	cout << count << "\n";
	for (int i = 0; i <= tmp; i++) {
		cout << ans[i] << " ";
	}
	return 0;
}


2024/11/2 11:47
加载中...