9 条题解

  • 0
    @ 2024-5-4 20:20:17

    懒人代码

    #include<bits/stdc++.h>
    using namespace std;
    const int INF=0x3f3f3f3f;
    int const N=1e5+10;
    int x,y;
    int main(){
    	cin>>x>>y;
    	if(y==2){
    		if(x%4==0&&x%100!=0||x%400==0){
    			cout<<29;
    			return 0;
    		}else{
    			cout<<28;
    			return 0;
    		}
    	}
    	if(y==1||y==3||y==5||y==7||y==8||y==10||y==12)cout<<31;
    	else{
    		cout<<30;
    	}
    	return 0;
    }
    
    

    信息

    ID
    863
    时间
    1000ms
    内存
    256MiB
    难度
    6
    标签
    递交数
    745
    已通过
    225
    上传者