Submission

Status:

PPPPPPPPP----PP-PPPP

Subtask/Task Score:

75/100

Score: 75

User: PutterThecityboy

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

Language: cpp

Time: 0.004 second

Submitted On: 2026-10-07 21:36:45

#include <iostream>
using namespace std;
int main (){
    int m, d, total_days;
    cin >> m >> d;
    int days[] = {0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};
    total_days = 0;

    if (m == 8) {
        total_days = 11;
    } else {
        for (int i = m; i < 8; i++) {
            total_days += days[i];
        }
        total_days = total_days - 1 + 12;
    }

    int ans = (d - 1 + total_days) % 7 + 1;

    cout << ans;


    return 0;
}