Submission
Status:
PPPPPPPPP---PPP-PPPP
Subtask/Task Score:
80/100
Score: 80
User: tl.cpp
Problemset: ปฏิทินวันแม่
Language: cpp
Time: 0.005 second
Submitted On: 2026-07-31 23:56:00
#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 + 20) % 7;
cout << (m + sum - 1) % 7;
}
}