217522026-01-13 19:07:59zoEgykorúak (75 pont)cpp17Wrong answer 20/758ms660 KiB
#include <iostream>
using namespace std;
int main()
{
    int l,m;
    m=0;
    int n,i,p, p1,p2,x=0;
    cin>>n;
    cin>>p>>p1>>p2;
    
    int s[12]={31,28,31,30,31,30,31,31,30,31,30,31};
    
    
    int t[n],k[n],f[n];
    for (i=0; i<n; i++)
    {
        cin>>t[i] >> k[i] >> f[i];
        if (t[i]==p)
        {
            x=x+1;
        }
        else if (t[i]==p-1)
        {
            if(p%4==0 and p1<2 or (p1==2 and p2<=28)) 
            {
                x=x+1;
            }
            else if(t[i]%4==0 and k[i]<2 or (k[i]==2 and f[i]<=28))
            {
                x=x+1;
            }
            else if (k[i]==p1 and f[i]>=p2)   
            {
                x=x+1;
            }
            else if(k[i]>p1)
            {
                x=x+1;
            }
        }
        if (t[i]==p+1)
        {
            if(p%4==0 and p1>2 or (p1==2 and p2==29)) 
            {
                x=x+1;
            }
            else if(t[i]%4==0 and (k[i]>2 || k[i]==2 and f[i]==29))
            {
                x=x+1;
            }
            else if (k[i]==p1 and f[i]<=p2)
            {
                x=x+1;
            }
           else  if(k[i]<p1)
            {
                x=x+1;
            }
        }
        /*if (t[i]==p+1)
        {
            if (k[i]+12-p1<=12)
            {
                for (l=0; l<k[i]; l++)
                {
                    m=m+s[l];
                }
                m=m+f[i];// hanyadik napon szuletett
                for (l=11; l>p1; l--)
                {
                    m=m+s[l];
                }

            }
        }
        /*if (t[i]==p or t[i]==p+1 or t[i]==p-1 )
        {
            if (k[i])
        }*/
    
    }
    cout<<x<<endl;
    
    
    
    
    /*for(i=0; i<n; i++)
    {
        cout<<t[i]<<" " << k[i] <<" " << f[i] << endl;
    }*/
    


    return 0;
}
SubtaskSumTestVerdictTimeMemory
base20/75
1Wrong answer0/01ms500 KiB
2Wrong answer0/08ms316 KiB
3Accepted5/51ms316 KiB
4Accepted5/51ms316 KiB
5Accepted5/51ms316 KiB
6Wrong answer0/51ms316 KiB
7Wrong answer0/51ms316 KiB
8Wrong answer0/51ms316 KiB
9Accepted5/51ms400 KiB
10Wrong answer0/52ms316 KiB
11Wrong answer0/52ms316 KiB
12Wrong answer0/53ms316 KiB
13Wrong answer0/54ms388 KiB
14Wrong answer0/54ms660 KiB
15Wrong answer0/54ms508 KiB
16Wrong answer0/56ms528 KiB
17Wrong answer0/57ms420 KiB