Codeforces Round #260 (Div. 2) A (贪心)

IPD流程中CBB管理的5个致命误区,第3个坑了80%的团队 本文深入剖析了IPD流程中CBB管理的五个致命误区,尤其指出缺乏有效的度量与激励机制是影响80%团队的核心陷阱。文章强调CBB的核心在于前瞻性设计,而非简单归档,并需平衡通用性与产品竞争力,同时建立持续运营机制,确保CBB与市场需求对齐,从而真正实现缩短开发周期、降低成本的目标。 阅读详情


题目:

A. Laptops
time limit per test
1 second
memory limit per test
256 megabytes
input
standard input
output
standard output

One day Dima and Alex had an argument about the price and quality of laptops. Dima thinks that the more expensive a laptop is, the better it is. Alex disagrees. Alex thinks that there are two laptops, such that the price of the first laptop is less (strictly smaller) than the price of the second laptop but the quality of the first laptop is higher (strictly greater) than the quality of the second laptop.

Please, check the guess of Alex. You are given descriptions of n laptops. Determine whether two described above laptops exist.

Input

The first line contains an integer n (1 ≤ n ≤ 105) — the number of laptops.

Next n lines contain two integers each, ai and bi (1 ≤ ai, bi ≤ n), where ai is the price of the i-th laptop, and bi is the number that represents the quality of the i-th laptop (the larger the number is, the higher is the quality).

All ai are distinct. All bi are distinct.

Output

If Alex is correct, print "Happy Alex", otherwise print "Poor Alex" (without the quotes).

Sample test(s)
input
2
1 2
2 1
output
Happy Alex




题意分析:

题目的意思大概就是有很多笔记本电脑,电脑有两种属性,一个price,一个quality。看是否存在两台电脑中,有一个台的价格更低而且质量更好。直接对price升序排列,然后循环维护一个最大质量ma,如果ma大于后面电脑的quality就break,对应输出就KO了。




代码:

#include <stdio.h>
#include <string.h>
#include <algorithm>
using namespace std;

const int MAXN = 100000+5;

struct node
{
    int a, b;
}di[MAXN];

int cmp(node x, node y)
{
    return x.a < y.a;
}

int main()
{
    int n, m;
    while(~scanf("%d", &n))
    {
        int i;
        for(i = 0;i < n;i++)
        {
            scanf("%d %d", &di[i].a, &di[i].b);
        }
        sort(di, di+n, cmp);
        int ma = 0;
        int ok = 0;
        for(i = 0;i < n;i++)
        {
            if(ma > di[i].b)
            {
                ok = 1;
                break;
            }
            ma = max(di[i].b, ma);
        }
        if(ok == 1)
        {
            printf("Happy Alex\n");
        }
        else
        {
            printf("Poor Alex\n");
        }
    }
    return 0;
}

31、贝叶斯认知建模与隐马尔可夫模型:理论与应用 本文探讨了贝叶斯认知建模与隐马尔可夫模型(HMM)的理论基础及其在认知科学和神经科学中的应用。重点介绍了贝叶斯定理和HMM的基本原理,并结合实际案例,如情绪识别系统和脑机接口(BCI),展示了它们在处理复杂认知任务中的强大能力。文章还讨论了贝叶斯-HMM模型的技术细节、优势与局限性,以及未来的发展前景。 阅读详情

相关推荐

经典损失函数——均方误差(MSE)和交叉熵误差(CEE)的python实现

损失函数(loss function)用来表示当前的神经网络对训练数据不拟合的程度。这个损失函数有很多,但是一般使用均方误差和交叉熵误差等。 1.均方误差(mean squared error) 先来看一下表达式: 用于将的求导结果变成,是神经网络的输出,是训练数据的标签值,k表示数据的维度。 用python实现: def MS...

Answer3664的博客 1万+

Codeforces Round #260 (Div. 2)

Codeforces Round #260 (Div. 2) 题目链接 A:水题,其实只要判断有没有一个ai != bi即可,因为都保证是1 - n的不相等数字 B:找到2 3 4的循环节,发现只有4和2,于是把大数%4,%2,在根据循环节去计算即可 C:dp,dp[i][0]表示不拿i数字,dp[i][1]表示拿i数字,状态转移为 dp(i,0)=max(dp(i−1,

Remilia's 887

发那科FOCAS 1/2文档——核心库文件

在开始开发前,明确目标 CNC 的具体型号、连接方式(HSSB/TCP/IP)、软件版本和配置(如轴数、程序号位数),并据此正确配置开发环境和编译选项。开发时需要包含相应的头文件。这是开发跨平台应用时需要特别注意的地方。这是开发应用时必须了解的核心文件。

snailiot的博客 1021

Codeforces Round #260 (Div. 2) C

C. Boredom 题意:

A Cube Master 717

GNSS - PPP软件 - GAMP 在VS2019/2022下完成调试、跑通程序(超详细!)

WIN32;_DEBUG;_CONSOLE;O_WARNINGS;ENAGLO;ENACMP;ENAGAL;ENAQZS;NFREQ=3。

qq_43381998的博客 8251

Labview项目01:标准可配置序列测试框架

摘要:本文介绍了一个基于LabVIEW2020开发的通用测试框架系统。该系统采用模块化设计,包含主界面、调试界面、设置界面和登录界面。主功能包括:1)可配置测试序列,支持延时、预定值输出、随机值输出等操作;2)单步测试功能自主添加;3)界面支持测试序列编辑和权限管理。系统采用队列机制处理事件和测试流程,通过CSV文件存储测试序列,支持参数化配置。用户可自定义测试VI(A_.vi和N_.vi格式),并通过调试界面验证测试序列。最终测试结果在主界面显示,提供整体判断功能。该系统既可作为学习参考,也可用于实际测试

weixin_38637405的博客 1552

Codeforces Round #480 (Div. 2)

题目链接:Codeforces Round #480 (Div. 2) A:如果有n个珠子,那么会产生n个两两之间的空位(环形),所以剩下的线可以整除n即可,注意n为0的情况。 AC代码: #pragma GCC optimize("-Ofast","-funroll-all-loops") #include<bits/stdc++.h> //#define int long lon...

青烟绕指柔的博客 165

Qt代码-无人机地面站系统

无人机地面站系统是无人机与操作员交互的核心枢纽,需实现**无人机状态监控**(位置、姿态、电池等)、**实时通信**(基于MAVLink协议)、**任务规划**(航点编辑、航线生成)、**地图显示**(无人机位置与航迹)、**参数配置**(传感器校准、飞行模式设置)等核心功能。地面站作为`MAV_COMP_ID_GCS`(地面控制站组件ID=255),无人机通常为`MAV_COMP_ID_AUTOPILOT1`(组件ID=1)。// 航点/盘旋指令。// 北京坐标(示例)

寒寒豆豆软件公司的博客 320

Codeforces Round #797 (Div. 3)

Codeforces Round #797 (Div. 3)

AC__dream的博客 609

QT使用libssh2库通过密匙实现sftp协议上传文件

qt下使用libssh2通过密匙连接sftp服务器端

小米的修行之路 942

【ubuntu】【VirtualBox】VirtualBox无法加载USB移动设备的解决方法(支持U盘启动盘)

提示:测试可用。

联系方式:927632640 2440

Codeforces Round #833 (Div. 2)

Codeforces Round #833 (Div. 2)

qq_33969563的博客 674

复分析 阿尔福斯(Ahlfors) 第三版答案 英文

答案分为十章,有部分习题没有答案,全英文复分析阿尔福斯(Ahlfors) 第三版答案

【Codeforces Round #614(div2)】D-Aroma's Search (贪心)

一、题目链接 https://codeforces.com/contest/1293/problem/D 二、题意 第一行给出一个点的坐标x0x_0x0​、y0y_0y0​,以及axa_xax​、aya_yay​、bxb_xbx​、byb_yby​。 当 i > 0 时,第i个点的坐标: xix_ixi​ = axa_xax​ * xi−1x_{i-1}xi−1​ + bxb_xbx​ yi...

养鸽场 212

假人有限元模型

假人模型,车辆碰撞假人有限元模型,适合做乘员安全的研究者利用

TMS_WebGMaps_1.9.8.0_Full_Source

TMS_WebGMaps_1.9.8.0_Full_Source 全源码 delphi cbuilder

Codeforces Round #158 (Div. 2)

Solved: 3 out of 5 (First 3 problems) in a 2-hour contest, got contest rating 1660 (still in Div. 2 :-( ) Problem set: http://codeforces.com/contest/260 Suggested Solutions: http://codeforces.com/b

MADNESS 672

IEM模型,地表粗糙度模拟

利用微波反演土壤水分时候,利用IEM模型可以实现对随机地表的模拟

Codeforces Round #739 (Div. 3)解题报告

文章目录ABCDEF1F2 A 题意:找出第k个既不是3的倍数也不以3结尾的数 思路:1≤t≤100,1≤k≤10001\le t\le100,1\le k\le10001≤t≤100,1≤k≤1000由样例得k=1000k=1000k=1000时,答案等于166616661666,所以暴力枚举1∼16661\sim16661∼1666即可 #include<bits/stdc++.h> using namespace std; int ans[1010], now; bool pan(int

qq_52383696的博客 669

Codeforces Round #260 (Div. 2) A. Laptops

A. Laptops time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output One day Dima and Alex had an argument about the pri...

weixin_30462049的博客 78

Codeforces Round #260 (Div. 1) 455 A. Boredom (DP)

A. Boredom time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output Alex doesn't like boredom. That's why whenever he

其实我是C先生--的博客 513

Codeforces Round #260 (Div. 1):A. Boredom(DP)

A. Boredomtime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard outputAlex doesn't like boredom. That's why whenever he gets bored, he comes up with games. One...

加载中... 370

( 贪心/并查集)Codeforces Round #480 (Div. 2) C. Posterized

C. Posterizedtime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard outputProfessor Ibrahim has prepared the final homework for his algorithm’s class. He asked ...

sunny crazy 347

Codeforces Round #158 (Div. 2)D. Black and White Tree(搜索 + 思维)

题目链接http://codeforces.com/contest/260/problem/D题目大意给你一棵树(注意不要出现环)的所有节点, 节点分为黑、白两类,只有不同颜色的节点才能相连, 每个节点还有一个值, 该值表示该点所连边的权值之和, 最后让你输出每条边所连的两个节点以及其权值(题目为特判)思路该题几乎没有用到算法,但十分考验思维 首先sum(edge) = sum(node) 由于

lin的博客 434

codeforces 743E

题解: 考虑这个每个数字少个数是可二分的(答案关于个数单调) 然后我们dp dp[i][S]表示到第i个数,已选完的数字集合为S 转移是贪心取连续一段 预处理转移右端点可以降下复杂度 1 #include<bits/stdc++.h> 2 #define maxn 1005 3 using namespace std; 4 int n,m; 5 i...

weixin_30497527的博客 141

Codeforces Round #266 (Div. 2) A

Codeforces Round #266 (Div. 2) A

Notdeep__acm的专栏 1571

Codeforces Round #263 (Div. 2) proB

Codeforces Round #263 (Div. 2) proB

Notdeep__acm的专栏 1377

Codeforces Round #263 (Div. 2) proC

Codeforces Round #263 (Div. 2) proC

Notdeep__acm的专栏 1156
下一篇: Codeforces Round #260 (Div. 2) B (数论)
Notdeep__acm
博客等级 码龄12年 20粉丝 53原创
评论 2
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

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

抵扣说明:

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

余额充值