Submission

Status:

PPPPPPPPP----PP-PPPP

Subtask/Task Score:

75/100

Score: 75

User: code

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

Language: cpp

Time: 0.002 second

Submitted On: 2025-10-23 15:36:51

#include <bits/stdc++.h>
using namespace std;
int main(){
    int m;cin>>m;
    int d;cin>>d;
    int arr[12]={31,28,31,30,31,30,31,31,30,31,30,31};
    int day=7-d+1;
    for (int i=m-1;i<8;i++){
        for (int j=1;j<6;j++){
            int test=day+7;
            if (i==7 && test>=12){
                day=test;
                break;
            }else{
                day=test;
            }
            if (day>arr[i]){
                day-=arr[i];
                break;
            }
            //cout<<day<<" ";
        }
        //cout<<"ok"<<day<<"ok";
    }
    //cout<<day;
    day-=12;
    cout<<7-day;
}