212322026-01-12 17:19:27PappMatyasVilágnaptár (45 pont)cpp17Wrong answer 15/451ms384 KiB
#include <iostream>

using namespace std;

int main()
{
	int nday[12] = { 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 };
	int wday[12] = { 31, 30, 30, 31, 30, 30, 31, 30, 30, 31, 30, 30 };
	int y, m, d;
	cin >> y >> m >> d;

	cout << y << " ";
	if (m == 12 && d == 31)
	{
		cout << m << " VN";
		return 0;
	}
	else if (y % 4 == 0 && m == 7 && d == 1)
	{
		cout << 6 << " SZN";
		return 0;
	}
 
	if (y % 4 == 0)
	{
		nday[1]++;
		wday[5]++;
	}

	for (int i = 1; i < 12; i++)
	{
		nday[i] = nday[i - 1] + nday[i];
		wday[i] = wday[i - 1] + wday[i];
	}

	int total = nday[m - 1] + d;

	int newMonth = 1;
	while (total > wday[newMonth])
	{
		newMonth++;
	}

	cout << newMonth << " " << total - wday[newMonth - 1];

	return 0;
}
SubtaskSumTestVerdictTimeMemory
base15/45
1Accepted0/01ms316 KiB
2Accepted0/01ms316 KiB
3Accepted0/01ms316 KiB
4Accepted2/21ms316 KiB
5Accepted2/21ms316 KiB
6Wrong answer0/31ms384 KiB
7Wrong answer0/31ms316 KiB
8Accepted3/31ms316 KiB
9Wrong answer0/31ms316 KiB
10Wrong answer0/31ms316 KiB
11Wrong answer0/31ms316 KiB
12Wrong answer0/31ms316 KiB
13Wrong answer0/31ms316 KiB
14Wrong answer0/31ms316 KiB
15Wrong answer0/31ms316 KiB
16Accepted3/31ms316 KiB
17Accepted3/31ms316 KiB
18Accepted2/21ms316 KiB
19Wrong answer0/31ms316 KiB