Submission

Status:

PPPPPPPPP----PP-PPPP

Subtask/Task Score:

75/100

Score: 75

User: kanin2208

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

Language: cpp

Time: 0.004 second

Submitted On: 2025-12-14 11:18:03

#include <iostream>
using namespace std;

int main() {
    int m, d;
    cin >> m >> d;
    
    int dayInMonth[13] = {
        0, 31, 28, 31, 30, 31, 30,
        31, 31, 30, 31, 30, 31
    };
    
    int sum = 0;
    
    for (int i = m; i < 8; i++) {
        sum += dayInMonth[i];
    }
    
    sum += 11;
    
    int ans = (d + sum) % 7;
    if (ans == 0) ans = 7;
    
    cout << ans;
    return 0;
}