Submission

Status:

PPPPPPPPP----PP-PPPP

Subtask/Task Score:

75/100

Score: 75

User: nicekrittaphat

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

Language: cpp

Time: 0.002 second

Submitted On: 2026-10-10 21:10:53

#include <iostream>
using namespace std;

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

    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];
        }
        cout<<res[(have+b+11)%7];
    }
    else{
        have+= day[a-1]-1;
        for(int i=0;i<12;i++){
            have+=day[i];
        }
        have += 31+28+31+30+31+30+31;

        cout<<res[(have+b+12)%7];
        
    }
    

}