codedorces 260 div2 A题
水题,扫描一遍看是否出现价格低质量高的情况。
#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题的更多相关文章
- codeforces 260 div2 C题
C题就是个dp,把原数据排序去重之后得到新序列,设dp[i]表示在前i个数中取得最大分数,那么: if(a[i] != a[i-1]+1) dp[i] = cnt[a[i]]*a[i] + dp[ ...
- codeforces 260 div2 B题
打表发现规律,对4取模为0的结果为4,否则为0,因此只需要判断输入的数据是不是被4整出即可,数据最大可能是100000位的整数,判断能否被4整出不能直接去判断,只需要判断最后两位(如果有)或一位能否被 ...
- 2017 ACM Arabella Collegiate Programming Contest div2的题,部分题目写个题解
F. Monkeying Around 维护点在多少个线段上 http://codeforces.com/gym/101350/problem/F 题意:有m个笑话,每个笑话的区间是[L, R], ...
- BC div2补题以及 复习模除 逆元__BestCoder Round #78 (div.2)
第一题没话说 智商欠费 加老柴辅导终于过了 需要在意的是数据范围为2的63次方-1 三个数相加肯定爆了 四边形的定义 任意边小于其余三边之和 换句话说就是 最长边小于其余三边之和 这样的话问题转化为 ...
- 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 ...
- 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 ...
- Codeforces round 419 div2 补题 CF 816 A-E
A Karen and Morning 水题 注意进位即可 #include<bits/stdc++.h> using namespace std; typedef long long i ...
- codeforces 447 A-E div2 补题
A DZY Loves Hash 水题 #include<iostream> #include<cstdio> #include<cstdlib> #include ...
- codeforces round 418 div2 补题 CF 814 A-E
A An abandoned sentiment from past 水题 #include<bits/stdc++.h> using namespace std; int a[300], ...
随机推荐
- QTP重要功能总结
以下为QTP最应掌握的.最常用的功能(以下仅提供菜单入口,其他还有很多入口,但功能都是一样的) 1.QTP上方菜单栏->Tools->Object Spy(对象探测器)----多个入口 功 ...
- Java学习笔记之:Java数组
一.介绍 数组对于每一门编程语言来说都是重要的数据结构之一,当然不同语言对数组的实现及处理也不尽相同. Java语言中提供的数组是用来存储固定大小的同类型元素. 你可以声明一个数组变量,如number ...
- 40. Combination Sum II
题目: Given a collection of candidate numbers (C) and a target number (T), find all unique combination ...
- JCIFS读取远程服务器文件过慢的解决方法
JCIFS读取远程服务器文件过慢的解决方法 发表于3年前(2013-07-12 11:23) 阅读(1174) | 评论(0) // 我要收藏"; var favor_del = &qu ...
- MyEclipse 2013 开发WebService
1.在Package Explorer窗口右键File新建WebService Project项目,我的名称为:TestWebService 2.WebService Framework选择JAX-W ...
- 9本java程序员必读的书
来源:http://mp.weixin.qq.com/s?__biz=MjM5NzA1MTcyMA==&mid=202904638&idx=2&sn=21dd20438e32a ...
- /usr/lib/libstdc++.so.6: version `GLIBCXX_3.4.15' not found错误的解决
升级cmake时,提示"Error when bootstrapping CMake:Problem while running initial CMake",第二次运行./boo ...
- 使用easyui实现列表的批量删除
使用easyui实现列表的批量删除 首先要做的就是增加一个多选框 <table id="otGrid" nowrap="false" style=&quo ...
- 简单实现WPF界面控件换肤效果
效果如下如图:选择皮肤颜色 1.首先新建一个如图界面: 选择匹夫下拉框Xaml代码如下:三种颜色选项,并触发SelectionChanged事件 <ComboBox Height="2 ...
- HighChart图片本地导出
Highchart第三方图表控件,导出默认是从官方地址导出,这样在无外网的条件下则导致导出失败,改进如下: 后台导出代码: public partial class HighChart : Syste ...