214322026-01-13 08:42:52sklausVilágnaptár (45 pont)cpp17Wrong answer 16/451ms592 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]++;
    }
    int p=r[h-1]+n+1;
    int *low=lower_bound(t, t+12, p);
    int j=low-t;
    cout << j << " " << p-t[j-1];
    return 0;
}
SubtaskSumTestVerdictTimeMemory
base16/45
1Wrong answer0/01ms316 KiB
2Accepted0/01ms316 KiB
3Accepted0/01ms316 KiB
4Wrong answer0/21ms316 KiB
5Accepted2/21ms316 KiB
6Wrong answer0/31ms316 KiB
7Accepted3/31ms552 KiB
8Wrong answer0/31ms316 KiB
9Wrong answer0/31ms316 KiB
10Accepted3/31ms508 KiB
11Accepted3/31ms316 KiB
12Wrong answer0/31ms592 KiB
13Wrong answer0/31ms316 KiB
14Wrong answer0/31ms508 KiB
15Wrong answer0/31ms316 KiB
16Wrong answer0/31ms316 KiB
17Wrong answer0/31ms316 KiB
18Accepted2/21ms316 KiB
19Accepted3/31ms316 KiB