2025 ICPC 南京站(南京)VP

赛时情况

VP 时间:2026.11.11 17:00-21:44

解题数 总用时 解出题目 排名/总人数 比例
2 77 CK 228/335(铁牌) 68.1%

C. 分糖果(0:02,lhm)

不难发现 \(n\) 为奇数时,\(a,b\) 必定一奇一偶,奇数不可能被偶数整除,因此不可能是 \(n\)。

\(n\) 为偶数时直接拆成 \(a=b=\dfrac{n}{2}\) 即可。

#include<bits/stdc++.h>
#define Std_Maker lhm
#define ll long long
using namespace std;
ll t,n;
int main()
{
    ios::sync_with_stdio(0);
    cin.tie(0);
    cout.tie(0);
    cin>>t;
    while(t--)
    {
        cin>>n;
        if(n%2==1) cout<<"No"<<endl;
        else cout<<"Yes"<<endl<<n/2<<" "<<n/2<<endl;
    }
    return 0;
}

K. 象棋(0:55,+1,lhm)

手玩枚举所有情况,把边角的可能情况都算一遍,只有开局将死才能将死,否则一定跑掉。

#include<bits/stdc++.h>
#define Std_Maker lhm
#define ll long long
using namespace std;
ll t,x,y,a,b;
int main()
{
    ios::sync_with_stdio(0);
    cin.tie(0);
    cout.tie(0);
    cin>>t;
    while(t--)
    {
        cin>>x>>y>>a>>b;
        if(x==2 and y==2 and a==4 and b==4)
        {
            cout<<"YES"<<endl;
            continue;
        }
        if(x==8 and y==2 and a==6 and b==4)
        {
            cout<<"YES"<<endl;
            continue;
        }
        if(x==2 and y==9 and a==4 and b==7)
        {
            cout<<"YES"<<endl;
            continue;
        }
        if(x==8 and y==9 and a==6 and b==7)
        {
            cout<<"YES"<<endl;
            continue;
        }
        if(x==2 and y==1 and a==4 and b==3)
        {
            cout<<"YES"<<endl;
            continue;
        }
        if(x==1 and y==2 and a==3 and b==4)
        {
            cout<<"YES"<<endl;
            continue;
        }
        if(x==8 and y==1 and a==6 and b==3)
        {
            cout<<"YES"<<endl;
            continue;
        }
        if(x==9 and y==2 and a==7 and b==4)
        {
            cout<<"YES"<<endl;
            continue;
        }
        if(x==1 and y==9 and a==3 and b==7)
        {
            cout<<"YES"<<endl;
            continue;
        }
        if(x==2 and y==10 and a==4 and b==8)
        {
            cout<<"YES"<<endl;
            continue;
        }
        if(x==8 and y==10 and a==6 and b==8)
        {
            cout<<"YES"<<endl;
            continue;
        }
        if(x==9 and y==9 and a==7 and b==7)
        {
            cout<<"YES"<<endl;
            continue;
        }
        if(x==1 and y==1)
        {
            if((a==2 and b==2) or (a==3 and b==3) or (a==1 and b==2) or (a==2 and b==1)) cout<<"YES"<<endl;
            else cout<<"NO"<<endl;
            continue;
        }
        if(x==9 and y==1)
        {
            if((a==8 and b==2) or (a==7 and b==3) or (a==8 and b==1) or (a==9 and b==2)) cout<<"YES"<<endl;
            else cout<<"NO"<<endl;
            continue;
        }
        if(x==1 and y==10)
        {
            if((a==2 and b==9) or (a==3 and b==8) or (a==1 and b==9) or (a==2 and b==10)) cout<<"YES"<<endl;
            else cout<<"NO"<<endl;
            continue;
        }
        if(x==9 and y==10)
        {
            if((a==8 and b==9) or (a==7 and b==8) or (a==8 and b==10) or (a==9 and b==9)) cout<<"YES"<<endl;
            else cout<<"NO"<<endl;
            continue;
        }
        if(x==1)
        {
            if(a==2 and y==b) cout<<"YES"<<endl;
            else cout<<"NO"<<endl;
            continue;
        }
        if(x==9)
        {
            if(a==8 and y==b) cout<<"YES"<<endl;
            else cout<<"NO"<<endl;
            continue;
        }
        if(y==1)
        {
            if(b==2 and x==a) cout<<"YES"<<endl;
            else cout<<"NO"<<endl;
            continue;
        }
        if(y==10)
        {
            if(b==9 and x==a) cout<<"YES"<<endl;
            else cout<<"NO"<<endl;
            continue;
        }
        cout<<"NO"<<endl;
    }
    return 0;
}
posted @ 2026-11-13 10:06  Lithium_Chestnut  阅读(14)  评论(0)    收藏  举报