Submission
Status:
PPPPP-PPP----PP---P-
Subtask/Task Score:
55/100
Score: 55
User: letdown
Problemset: ปฏิทินวันแม่
Language: cpp
Time: 0.002 second
Submitted On: 2025-10-03 19:36:55
#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 {
daystill += 19;
for (int i = m; i < 12; i++) {
daystill += ms[i];
}
}
cout << daystill % 7 + d - 1;
}