46642023-03-30 18:36:051478Világnaptár (45 pont)cpp17Hibás válasz 38/453ms4384 KiB
#include <bits/stdc++.h>
#include <random>

using namespace std;

typedef long long ll;
typedef long double ld;
typedef pair<int, int> p32;
typedef pair<ll, ll> p64;
typedef pair<double, double> pdd;
typedef vector<ll> v64;
typedef vector<int> v32;
typedef vector<vector<int>> vv32;
typedef vector<vector<ll>> vv64;
typedef vector<vector<p64>> vvp64;
typedef vector<p64> vp64;
typedef vector<p32> vp32;
ll MOD = 998244353;
double eps = 1e-12;
#define forn(i, e) for (ll i = 0; i < e; i++)
#define forsn(i, s, e) for (ll i = s; i < e; i++)
#define rforn(i, s) for (ll i = s; i >= 0; i--)
#define rforsn(i, s, e) for (ll i = s; i >= e; i--)
#define ln "\n"
#define dbg(x) cout << #x << " = " << x << ln
#define mp make_pair
#define pb push_back
#define fi first
#define se second
#define INF 2e18
#define fast_cin()                    \
    ios_base::sync_with_stdio(false); \
    cin.tie(NULL);                    \
    cout.tie(NULL)
#define all(x) (x).begin(), (x).end()
#define sz(x) ((ll)(x).size())

vector<int> vNHonapokNapjai = {0, 31, 30, 30, 31, 30, 30, 31, 30, 30, 30, 30, 31};
vector<int> gHonapokNapjai = {0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};

int main()
{
    fast_cin();
    //ifstream cin("in.txt");
    int ev, honap, nap;
    cin >> ev >> honap >> nap;

    if (ev % 4 == 0)
    {
        vNHonapokNapjai[6]++;
        gHonapokNapjai[2]++;
    }

    vector<int> vNSum(13);
    for (int i = 1; i <= 12; i++)
    {
        vNSum[i] = vNSum[i - 1] + vNHonapokNapjai[i];
    }

    int x = 0;
    for (int i = 1; i < honap; i++)
    {
        x += gHonapokNapjai[i];
    }
    x += nap;
    int ind = lower_bound(all(vNSum), x) - vNSum.begin();

    //cout << x << " " << ind << " " << vNSum[ind - 1] << '\n';
    if (ind == 6 && x - vNSum[ind - 1] == 31)
    {
        cout << ev << " " << ind << " "
             << "SZN";
    }
    else if (ind == 13 && x - vNSum[ind - 1] == 1)
    {
        cout << ev << " " << ind << " "
             << "VN";
    }
    else
    {
        cout << ev << " " << ind << " " << x - vNSum[ind - 1] << '\n';
    }

    return 0;
}
RészfeladatÖsszpontTesztVerdiktIdőMemória
base38/45
1Elfogadva0/03ms1828 KiB
2Elfogadva0/03ms2056 KiB
3Hibás válasz0/03ms2272 KiB
4Hibás válasz0/22ms2348 KiB
5Hibás válasz0/22ms2348 KiB
6Elfogadva3/33ms2488 KiB
7Elfogadva3/32ms2576 KiB
8Elfogadva3/33ms2704 KiB
9Elfogadva3/33ms2920 KiB
10Hibás válasz0/33ms3156 KiB
11Elfogadva3/33ms3448 KiB
12Elfogadva3/33ms3688 KiB
13Elfogadva3/33ms3664 KiB
14Elfogadva3/33ms3884 KiB
15Elfogadva3/33ms3976 KiB
16Elfogadva3/33ms4040 KiB
17Elfogadva3/33ms4164 KiB
18Elfogadva2/23ms4384 KiB
19Elfogadva3/32ms4364 KiB