224242026-01-15 07:58:59zoEgykorúak (75 pont)cpp17Wrong answer 25/758ms504 KiB
#include <iostream>

using namespace std;

int main()
{
    int l,m;
    m=0;
    int n,i,pe, ph,pn,x=0;
    cin>>n;
    cin>>pe>>ph>>pn;

    int s[12]={31,28,31,30,31,30,31,31,30,31,30,31};


     int ev[n],honap[n],nap[n];
    for (i=0; i<n; i++)
    {
        m=0;
        cin>>ev[i] >> honap[i] >> nap[i];
        if (ev[i]==pe)
        {
            x=x+1;
        }

        else if (ev[i]==pe+1)
        {
            if (honap[i]+12-ph<=12)
            {
                for (l=0; l<honap[i]; l++)
                {
                    m=m+s[l];
                }
                m=m+nap[i];// hanyadik napon szuletett
                for (l=11; l>ph; l--)
                {
                    m=m+s[l];
                }
                m=m+s[ph-1]-pn;
                if (m<=365)
                {
                    x=x+1;
                }
            }
        }
        else if (ev[i]==pe-1 )
        {
            m=0;

            for (l=0; l<ph-1; l++)
            {
                m=m+s[l];
            }
            m=m+pn;// hanyadik napon szuletett peti
            for (l=11; l>honap[i]; l--)
            {
                m=m+s[l];
            }
            m=m+s[ph-1]-nap[i];
            if (m<=365)
            {
                x=x+1;
            }
        }

    }
    cout<<x<<endl;
    return 0;
}
SubtaskSumTestVerdictTimeMemory
base25/75
1Accepted0/02ms316 KiB
2Wrong answer0/08ms500 KiB
3Accepted5/52ms356 KiB
4Accepted5/51ms316 KiB
5Wrong answer0/51ms500 KiB
6Accepted5/51ms316 KiB
7Accepted5/51ms316 KiB
8Wrong answer0/51ms500 KiB
9Accepted5/51ms316 KiB
10Wrong answer0/53ms316 KiB
11Wrong answer0/52ms316 KiB
12Wrong answer0/53ms332 KiB
13Wrong answer0/54ms440 KiB
14Wrong answer0/54ms324 KiB
15Wrong answer0/54ms316 KiB
16Wrong answer0/56ms480 KiB
17Wrong answer0/57ms504 KiB