46662023-03-30 18:42:211478Világnaptár (45 pont)cpp17Wrong answer 40/453ms4244 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 - 1 << " "
             << "VN";
    }
    else
    {
        cout << ev << " " << ind << " " << x - vNSum[ind - 1] << '\n';
    }

    return 0;
}
SubtaskSumTestVerdictTimeMemory
base40/45
1Accepted0/03ms1832 KiB
2Accepted0/03ms2052 KiB
3Accepted0/03ms2276 KiB
4Wrong answer0/23ms2508 KiB
5Accepted2/23ms2692 KiB
6Accepted3/32ms2776 KiB
7Accepted3/33ms2764 KiB
8Accepted3/33ms2888 KiB
9Accepted3/33ms3120 KiB
10Wrong answer0/33ms3324 KiB
11Accepted3/32ms3376 KiB
12Accepted3/33ms3508 KiB
13Accepted3/33ms3732 KiB
14Accepted3/32ms3796 KiB
15Accepted3/32ms3924 KiB
16Accepted3/33ms4020 KiB
17Accepted3/33ms4012 KiB
18Accepted2/22ms4112 KiB
19Accepted3/33ms4244 KiB