Lyft Level 5 Challenge 2018 - Elimination Round 题解

本文介绍了Lyft Level 5 Challenge 2018资格赛的解题思路。针对A题,通过判断棋子坐标确定它们是否位于同一象限;对于B题,解析了当a-b=1且a+b为质数时的条件;在C题中,使用动态规划(DP)方法求解,具体策略待补充。
摘要由CSDN通过智能技术生成

A题:

女王棋子将棋盘划分为四个象限,判断两个棋子的坐标是否在同一象限即可

#include<stdio.h>
#include<iostream>
#include<algorithm>
#include<cmath>
#include<cstring>
#include<queue>
#include<stack>
#include<list>
#include<map>
#include<set>
#include<vector>

typedef long long int ll;
const int  maxn =100000+10;
const int  mod =998244353;
const int INF=0x3f3f3f3f;

using namespace std;

int main()
{
    int n;scanf("%d",&n);
    int a,b;scanf("%d%d",&a,&b);
    int c,d;scanf("%d%d",&c,&d);
    int e,v;scanf("%d%d",&e,&v);
    if(c<a&&d<b)
    {
        if(e<a&&v<b) cout<<"yes";
        else cout<<"no";
    }
    if(c<a&&d>b)
    {
        if(e<a&&v>b)cout<<"yes";
        else cout<<"no";
    }
    if(
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值