39312023-03-05 21:03:45SleepyOverlordVilágnaptár (45 pont)cpp17Elfogadva 45/453ms4396 KiB
#include <vector>
#include <string> 
#include <set> 
#include <map> 
#include <unordered_set>
#include <unordered_map>
#include <queue> 
#include <bitset> 
#include <stack>
#include <list>

#include <numeric> 
#include <algorithm> 
#include <random>
#include <chrono>

#include <cstdio>
#include <fstream>
#include <iostream> 
#include <sstream> 
#include <iomanip>
#include <climits>

#include <cctype>
#include <cmath> 
#include <ctime>
#include <cassert>

using namespace std;

#define ULL unsigned long long
#define LL long long
#define PII pair <int, int>
#define VB vector <bool>
#define VI vector <int>
#define VLL vector <LL>
#define VD vector <double>
#define VS vector <string>
#define VPII vector <pair <int, int> >
#define VVI vector < VI >
#define VVB vector < VB >
#define SI set < int >
#define USI unordered_set <int>
#define MII map <int, int>
#define UMII unordered_map <int, int>
#define MS multiset
#define US unordered_set
#define UM unordered_map
#define UMS unordered_multiset
#define UMM unordered_multimap

#define FORN(i, n) for(int i = 0; i < (n); ++i)
#define FOR(i, a, b) for(int i = (a); i <= (b); ++i)
#define FORD(i, a, b) for(int i = (a); i >= (b); --i)

#define SZ size()
#define BG begin() 
#define EN end() 
#define CL clear()
#define X first
#define Y second
#define RS resize
#define PB push_back
#define MP make_pair
#define ALL(x) x.begin(), x.end()
#define INS insert
#define ER erase
#define CNT count

#define IN_FILE "a.in"
#define OUT_FILE "a.out"

template <typename T>
void PR(T var1)
{
	cout << var1 <<endl;
}
template <typename T, typename... Types>
void PR(T var1, Types... var2)
{
	cout << var1;
	PR(var2...);
}

int origDays[13] = {-1, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};
int newDays[13] = {-1, 31, 30, 30, 31, 30, 30, 31, 30, 30, 31, 30, 30};
int year, month, day;

int main()
{
	cin >> year >> month >> day;
	if (year % 4 == 0) 
	{
		origDays[2] = 29;
		newDays[6] = 31;
	}
	int dayOfYear = day;
	FOR(i, 1, month - 1) dayOfYear += origDays[i];

	int i = 1;
	while (i < 12 && newDays[i] < dayOfYear) dayOfYear -= newDays[i++];

	if (i == 6 && dayOfYear == 31) PR(year, " ", 6, " SZN");
	else 
		if (i == 12 && dayOfYear == 31) PR(year, " ", 12, " VN");
		else PR(year, " ", i, " ", dayOfYear);

	return 0;
}
RészfeladatÖsszpontTesztVerdiktIdőMemória
base45/45
1Elfogadva0/03ms1872 KiB
2Elfogadva0/02ms2080 KiB
3Elfogadva0/03ms2296 KiB
4Elfogadva2/23ms2508 KiB
5Elfogadva2/22ms2588 KiB
6Elfogadva3/32ms2620 KiB
7Elfogadva3/32ms2704 KiB
8Elfogadva3/33ms2836 KiB
9Elfogadva3/32ms3044 KiB
10Elfogadva3/33ms3256 KiB
11Elfogadva3/33ms3620 KiB
12Elfogadva3/32ms3628 KiB
13Elfogadva3/33ms3740 KiB
14Elfogadva3/33ms3884 KiB
15Elfogadva3/33ms4132 KiB
16Elfogadva3/32ms4184 KiB
17Elfogadva3/33ms4316 KiB
18Elfogadva2/22ms4396 KiB
19Elfogadva3/32ms4392 KiB