23942023-01-12 13:40:12DalmEgykorúak (75 pont)cpp11Wrong answer 5/7518ms4948 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/03ms1880 KiB
2Wrong answer0/018ms2480 KiB
3Wrong answer0/52ms2588 KiB
4Accepted5/52ms2792 KiB
5Wrong answer0/52ms3048 KiB
6Wrong answer0/52ms3256 KiB
7Wrong answer0/52ms3080 KiB
8Wrong answer0/52ms3328 KiB
9Wrong answer0/52ms3400 KiB
10Wrong answer0/54ms3676 KiB
11Wrong answer0/56ms3652 KiB
12Wrong answer0/57ms3940 KiB
13Wrong answer0/59ms4300 KiB
14Wrong answer0/510ms4436 KiB
15Wrong answer0/59ms4576 KiB
16Wrong answer0/514ms4784 KiB
17Wrong answer0/517ms4948 KiB