16632022-12-01 13:12:13DalmEgykorúak (75 pont)cpp11Wrong answer 5/7518ms4052 KiB
#include <iostream>

using namespace std;

 int honapok[]={0,31,28,31,30,31,30,31,31,30,31,30,31};

struct datum{
        int ev;
        int honap;
        int nap;
    }typedef datum;

int main()
{
    datum peti;
    int N;
    cin>>N;
    cin>>peti.ev;
    cin>>peti.honap;
    cin>>peti.nap;

 datum taborozok [N];
 for (int i=0;i<N;i++){
    cin>>taborozok[i].ev;
    cin>>taborozok[i].honap;
    cin>>taborozok[i].nap;
 }
int db=0;
for(int i=0;i<N;i++){
    if(taborozok[i].ev==peti.ev){
        db++;
        cout<<taborozok[i].ev<<endl;}
    else if(taborozok[i].ev-1==peti.ev){ //Peti után született//
        if(taborozok[i].honap<peti.honap){
            db++;
            cout<<taborozok[i].ev<<endl;
        }
        else if(taborozok[i].honap==peti.honap&&taborozok[i].nap<peti.nap){
            db++;
            cout<<taborozok[i].ev<<endl;
        }
        else if(taborozok[i].ev%4!=0&&taborozok[i].honap==peti.honap&&taborozok[i].nap==peti.nap){
            db++;
            cout<<taborozok[i].ev<<endl;
        }
    }
    else if(taborozok[i].ev+1==peti.ev){//Peti elõtt született//
        if(taborozok[i].honap>peti.honap){
            db++;
            cout<<taborozok[i].ev<<endl;
        }
        else if(taborozok[i].honap==peti.honap&&taborozok[i].nap>peti.nap){
            db++;
            cout<<taborozok[i].ev<<endl;
        }
        else if(peti.ev%4!=0&&taborozok[i].honap==peti.honap&&taborozok[i].nap==peti.nap){
            db++;
            cout<<taborozok[i].ev<<endl;
        }
    }
}

cout<<db;



































    return 0;
}
SubtaskSumTestVerdictTimeMemory
base5/75
1Wrong answer0/03ms1748 KiB
2Wrong answer0/014ms2152 KiB
3Wrong answer0/52ms2116 KiB
4Accepted5/52ms2360 KiB
5Wrong answer0/52ms2564 KiB
6Wrong answer0/52ms2768 KiB
7Wrong answer0/52ms2928 KiB
8Wrong answer0/52ms3008 KiB
9Wrong answer0/53ms3288 KiB
10Wrong answer0/54ms3428 KiB
11Wrong answer0/54ms3644 KiB
12Wrong answer0/56ms3788 KiB
13Wrong answer0/57ms3852 KiB
14Wrong answer0/58ms3984 KiB
15Wrong answer0/59ms4052 KiB
16Wrong answer0/514ms3888 KiB
17Wrong answer0/518ms3912 KiB