Submission

Status:

PPPPPPPPP----PP-PPPP

Subtask/Task Score:

75/100

Score: 75

User: letdown

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

Language: cpp

Time: 0.003 second

Submitted On: 2025-10-03 19:43:16

#include <iostream>
#include <math.h>
#include <string.h>

using namespace std;
int main() {
    int m, d, daystill;
    cin >> m >> d;
    m--;
    int ms[] = {31, 28, 31, 30, 31, 30,
                31, 31, 30, 31, 30, 31};

    daystill = 365 - 31 - 30 - 31 - 30 - 31 + 12;

    if (m <= 7) {
        for (int i = 0; i < m; i++) {
            daystill -= ms[i];
        }
    } else {
        for (int i = 11; i > m; i--) {
            daystill += ms[i];
        }
    }

    cout << (daystill % 7 + d - 1) % 7;
}