Submission

Status:

PPPPPPPP--P-PPP-PPPP

Subtask/Task Score:

80/100

Score: 80

User: YourLocalZ

Problemset: ปฏิทินวันแม่

Language: cpp

Time: 0.003 second

Submitted On: 2025-10-13 12:03:02

#include <iostream>
#include <vector>
using namespace std;

int main()
{
    vector<int> month = {31,28,31,30,31,30,31,31,30,31,30,31};
    vector<int> day = {1,2,3,4,5,6,7};
    int x,y,s=0;
    cin >> x >> y;
    if(x<8)
    {
        for(auto it=month.begin()+x-1;it!=month.begin()+7;it++) s+=*it;
        s=(s+11+y)%7;
    }
    else
    {
        for(auto it=month.begin()+x-1;it!=month.begin()+7;it--) s-=*it;
        s=7+(s+11+y)%7;
    }
    if(s==0) cout << 7;
    else cout << s;
}