Submission

Status:

PPPPPPPPP----PP-PPPP

Subtask/Task Score:

75/100

Score: 75

User: tl.cpp

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

Language: cpp

Time: 0.002 second

Submitted On: 2026-08-01 00:05:24

#include <bits/stdc++.h>
using namespace std;
int n, m;
int mou[] = {0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};
int wk[] = {};
int sum;
int main() {
    ios::sync_with_stdio(0), cin.tie(0);

    cin >> n >> m;
    if (n <= 8) {
        for (int i = n; i <= 7; i++) {
            sum += mou[i];
        }
        sum = (sum + 12) % 7;
        cout << (m + sum - 1) % 7;
    }
    else {
        for (int i = n; i > 8; i--) {
            sum += mou[i];
        }
        sum = (sum + 19) % 7;
        cout << (m + 7 - sum) % 7;
    }
}