水题,扫描一遍看是否出现价格低质量高的情况。

#include<cstdio>
#include<string>
#include<vector>
#include<cstring>
#include<iostream>
#include<algorithm>
using namespace std;
struct Node{
int a, b;
Node(int a, int b){
this->a = a;
this->b = b;
}
bool operator < (const Node &A) const{
if(a == A.a) return b < A.b;
return a < A.a;
}
};
vector<Node>V;
int main(){
int n, t1, t2;
scanf("%d", &n);
for(int i = 0;i < n;i ++){
scanf("%d%d",&t1, &t2);
V.push_back(Node(t1, t2));
}
sort(V.begin(), V.end());
int flag = 0;
for(int i = 1;i < n;i ++){
if(V[i-1].b > V[i].b){
flag = 1;
break;
}
}
if(!flag) printf("Poor Alex\n");
else printf("Happy Alex\n");
}

codedorces 260 div2 A题的更多相关文章

  1. codeforces 260 div2 C题

    C题就是个dp,把原数据排序去重之后得到新序列,设dp[i]表示在前i个数中取得最大分数,那么: if(a[i] != a[i-1]+1)   dp[i] = cnt[a[i]]*a[i] + dp[ ...

  2. codeforces 260 div2 B题

    打表发现规律,对4取模为0的结果为4,否则为0,因此只需要判断输入的数据是不是被4整出即可,数据最大可能是100000位的整数,判断能否被4整出不能直接去判断,只需要判断最后两位(如果有)或一位能否被 ...

  3. 2017 ACM Arabella Collegiate Programming Contest div2的题,部分题目写个题解

    F. Monkeying Around   维护点在多少个线段上 http://codeforces.com/gym/101350/problem/F 题意:有m个笑话,每个笑话的区间是[L, R], ...

  4. BC div2补题以及 复习模除 逆元__BestCoder Round #78 (div.2)

    第一题没话说 智商欠费 加老柴辅导终于过了 需要在意的是数据范围为2的63次方-1 三个数相加肯定爆了 四边形的定义 任意边小于其余三边之和 换句话说就是 最长边小于其余三边之和 这样的话问题转化为 ...

  5. codeforces round 422 div2 补题 CF 822 A-F

    A I'm bored with life 水题 #include<bits/stdc++.h> using namespace std; typedef long long int LL ...

  6. codeforces round 421 div2 补题 CF 820 A-E

    A Mister B and Book Reading  O(n)暴力即可 #include<bits/stdc++.h> using namespace std; typedef lon ...

  7. Codeforces round 419 div2 补题 CF 816 A-E

    A Karen and Morning 水题 注意进位即可 #include<bits/stdc++.h> using namespace std; typedef long long i ...

  8. codeforces 447 A-E div2 补题

    A DZY Loves Hash 水题 #include<iostream> #include<cstdio> #include<cstdlib> #include ...

  9. codeforces round 418 div2 补题 CF 814 A-E

    A An abandoned sentiment from past 水题 #include<bits/stdc++.h> using namespace std; int a[300], ...

随机推荐

  1. 【转载】Dom篇

    一. 初探Dom     1. Dom介绍 二. Dom基础     1. window顶级对象     2. body.document对象事件     3. 通用的HTML元素的事件     4. ...

  2. Hadoop基础教程之搭建开发环境及编写Hello World

    整个Hadoop是基于Java开发的,所以要开发Hadoop相应的程序就得用JAVA.在linux下开发JAVA还数eclipse方便. 1.下载 进入官网:http://eclipse.org/do ...

  3. Delphi 中的 procedure of object (类方法存在一个隐藏参数self),简单深刻 good

    其实要了解这些东西,适当的学些反汇编,WINDOWS内存管理机制,PE结构,看下李维的VCL架构剖析可以很好理解type TMyEvent = procedure of object;这是一种数据类型 ...

  4. Camel、Pastal、匈牙利标记法区别及联系

    在英语中,依靠单词的大小写拼写复合词的做法,叫做"骆驼拼写法"(CamelCase).比如,backColor这个复合词,color的第一个字母采用大写. 这种拼写法在正规的英语中 ...

  5. word引用错误

    错误 4317 无法嵌入互操作类型“Microsoft.Office.Interop.Word.ApplicationClass”.请改用适用的接口. 类型“Microsoft.Office.Inte ...

  6. poj 3273 Monthly Expense(贪心+二分)

    题目:http://poj.org/problem?id=3273 题意:把n个数分成m份,使每份的和尽量小,输出最大的那一个的和. 思路:二分枚举最大的和,时间复杂度为O(nlog(sum-max) ...

  7. PL/SQL Developer自动补全SQL技巧

    s = SELECT t.* FROM t w = WHERE b = BETWEEN AND l = LIKE '%%' o = ORDER BY insw = IN (SELECT a FROM ...

  8. HDU 4965 矩阵快速幂

    顺手写了下矩阵类模板 利用到矩阵乘法的交换律 (A*B)^n == A * (B*A)^n-1 *B #include <cstdio> #include <cstring> ...

  9. bzoj4154

    一开始读错题,各种不会做,后来发现染色只是染孩子…… 那不就简单了吗……注意这题是允许离线的 染色如果没有距离限制,它就是个dfs序 距离限制怎么做呢?我们考虑扩展一维变成二维的问题,将每个点变为二维 ...

  10. hdu2457:DNA repair

    AC自动机+dp.问改变多少个字符能让目标串不含病毒串.即走过多少步不经过病毒串终点.又是同样的问题. #include<cstdio> #include<cstring> # ...