Submission
Status:
PPPPPPPPPPPPPPPPPPPP
Subtask/Task Score:
100/100
Score: 100
User: patsa_v
Problemset: ปฏิทินวันแม่
Language: cpp
Time: 0.004 second
Submitted On: 2026-10-04 23:19:51
#include <bits/stdc++.h>
using namespace std;
int main(){
ios_base::sync_with_stdio(false);
cin.tie(nullptr);
int m,d;
cin >> m >> d;
int months[12] ={3,0,3,2,3,2,3,3,2,3,2,3};
m --;
d --;
if(m <= 7){
for(int i=m;i<7;i++){
d += months[i];
}
}else{
for(int i=m;i>7;i--){
d -= months[i-1];
}
}
d += 11;
d = d%7;
cout << d+1;
return 0;
}