题解 AT4124 【[ABC096A] Day of Takahashi】

ShineEternal

2020-04-17 21:07:41

Solution

神奇,题解区居然没有和我一样的解法。 ---- ## solution 我们发现当月和日想到等的时候就是高桥日。那么我们有一个整月就有一个高桥日。只需要判断最后一个月能不能贡献一个高桥日就行了。 ## code ```cpp #include<cstdio> using namespace std; int main() { int a,b; scanf("%d%d",&a,&b); if(b<a) { printf("%d\n",a-1); } else { printf("%d\n",a); } return 0; } ```