Submission

Status:

PPPPPPPPP---PPP-PPPP

Subtask/Task Score:

80/100

Score: 80

User: Prap

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

Language: cpp

Time: 0.002 second

Submitted On: 2026-03-25 13:05:18

#include <iostream>
#include <cmath>
#include <vector>
#include <string>
using namespace std;
int main() {
	int D,M;
	cin>>M>>D;
	int month[12] = {31,28,31,30,31,30,31,31,30,31,30,31};
	int count = 0;
	if (M <= 8) {
		for (int i = M-1; i<7; i++) {
			count = count + month[i];
		}
		cout<<(count+D+3)%7+1;
	}
	else {
		for (int i = M-1; i>=7; i--) {
			count = count + month[i];
		}
		cout<<(count+D-12)%7;
	}
}