Submission

Status:

PPPPPPPPP----PP-PPPP

Subtask/Task Score:

75/100

Score: 75

User: nicekrittaphat

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

Language: cpp

Time: 0.004 second

Submitted On: 2026-10-10 20:59:19

#include <iostream>
using namespace std;

int main() 
{
    int a;
    int b;
    cin>>a>>b;
    

    int motherneed = 31+28+31+30+31+30+31+12;
    int day[12] = {31,28,31,30,31,30,31,31,30,31,30,31};
    int res[7] = {7,1,2,3,4,5,6};
    
    int have = 0;
    if(a<=8){
    for(int i=a-1;i<7;i++){
        have += day[i];
    }}
    else{
    for(int i=a-1;i<12;i++){
        have += day[i];
    }
    have += 31+28+31+30+31+30+31;
    }
    cout<<res[(have+b+12-1)%7];
    

}