214492026-01-13 09:12:21sklausVirágos rét (50 pont)cpp17Wrong answer 0/503ms512 KiB
#include <iostream>
#include <algorithm>

using namespace std;

int main()
{
    int ev, n, h;
    cin>>ev>>h>>n;
    int t[12];
    t[0]=0; t[1]=31; t[2]=61; t[3]=91; t[4]=122; t[5]=152; t[6]=182; t[7]=213; t[8]=243; t[9]=273; t[10]=304; t[11]=334;
    int r[12];
    r[0]=0; r[1]=31; r[2]=59; r[3]=90; r[4]=120; r[5]=151; r[6]=181; r[7]=212; r[8]=243; r[9]=273; r[10]=304; r[11]=334;
    cout<<ev<<" ";
    if(h==12 and n==31){cout<<h<<" VN";return 0;}
    if(ev%4==0 and h==7 and n==1){cout<<6<<" SZN"; return 0;}
    if(ev%4==0){
        for(int i=6; i<12; i++)t[i]++;
        for(int i=2; i<12; i++)r[i]++;
    }
    int p=r[h-1]+n;
    int *low=lower_bound(t, t+12, p);
    int j=low-t;
    cout << j << " " << p-t[j-1];
    return 0;
}
SubtaskSumTestVerdictTimeMemory
base0/50
1Wrong answer0/01ms316 KiB
2Wrong answer0/01ms316 KiB
3Wrong answer0/01ms316 KiB
4Wrong answer0/21ms316 KiB
5Wrong answer0/21ms316 KiB
6Wrong answer0/21ms316 KiB
7Wrong answer0/31ms512 KiB
8Wrong answer0/31ms316 KiB
9Wrong answer0/31ms316 KiB
10Wrong answer0/21ms316 KiB
11Wrong answer0/31ms316 KiB
12Wrong answer0/21ms316 KiB
13Wrong answer0/32ms316 KiB
14Runtime error0/23ms500 KiB
15Wrong answer0/22ms508 KiB
16Runtime error0/32ms316 KiB
17Runtime error0/31ms316 KiB
18Wrong answer0/31ms316 KiB
19Wrong answer0/31ms316 KiB
20Runtime error0/31ms316 KiB
21Runtime error0/31ms316 KiB
22Wrong answer0/31ms316 KiB