【codeforces 807A】Is it rated?
【题目链接】:http://codeforces.com/contest/807/problem/A
【题意】
给你n个人在一场CF前后的rating值;
问你这场比赛是不是计分的
【题解】
如果有一个人的rating变了;
则是计分的;
否则;
按照题目所给的规则判断是maybe还是unrated;
O(N^2)
【Number Of WA】
0
【完整代码】
#include <bits/stdc++.h>
using namespace std;
#define lson l,m,rt<<1
#define rson m+1,r,rt<<1|1
#define LL long long
#define rep1(i,a,b) for (int i = a;i <= b;i++)
#define rep2(i,a,b) for (int i = a;i >= b;i--)
#define mp make_pair
#define pb push_back
#define fi first
#define se second
#define ms(x,y) memset(x,y,sizeof x)
typedef pair<int,int> pii;
typedef pair<LL,LL> pll;
const int dx[9] = {0,1,-1,0,0,-1,-1,1,1};
const int dy[9] = {0,0,0,-1,1,-1,1,-1,1};
const double pi = acos(-1.0);
const int N = 1e3+100;;
int n;
int a[N],b[N];
int main()
{
//freopen("F:\\rush.txt","r",stdin);
ios::sync_with_stdio(false),cin.tie(0);//scanf,puts,printf not use
cin >> n;
rep1(i,1,n)
cin >> a[i] >> b[i];
rep1(i,1,n)
if (a[i]!=b[i])
return cout <<"rated"<<endl,0;
rep1(i,1,n)
{
rep1(j,i+1,n)
if (a[j]>a[i])
return cout <<"unrated"<<endl,0;
}
cout <<"maybe"<<endl;
return 0;
}
【codeforces 807A】Is it rated?的更多相关文章
- 【codeforces 415D】Mashmokh and ACM(普通dp)
[codeforces 415D]Mashmokh and ACM 题意:美丽数列定义:对于数列中的每一个i都满足:arr[i+1]%arr[i]==0 输入n,k(1<=n,k<=200 ...
- 【codeforces 707E】Garlands
[题目链接]:http://codeforces.com/contest/707/problem/E [题意] 给你一个n*m的方阵; 里面有k个联通块; 这k个联通块,每个连通块里面都是灯; 给你q ...
- 【codeforces 707C】Pythagorean Triples
[题目链接]:http://codeforces.com/contest/707/problem/C [题意] 给你一个数字n; 问你这个数字是不是某个三角形的一条边; 如果是让你输出另外两条边的大小 ...
- 【codeforces 709D】Recover the String
[题目链接]:http://codeforces.com/problemset/problem/709/D [题意] 给你一个序列; 给出01子列和10子列和00子列以及11子列的个数; 然后让你输出 ...
- 【codeforces 709B】Checkpoints
[题目链接]:http://codeforces.com/contest/709/problem/B [题意] 让你从起点开始走过n-1个点(至少n-1个) 问你最少走多远; [题解] 肯定不多走啊; ...
- 【codeforces 709C】Letters Cyclic Shift
[题目链接]:http://codeforces.com/contest/709/problem/C [题意] 让你改变一个字符串的子集(连续的一段); ->这一段的每个字符的字母都变成之前的一 ...
- 【Codeforces 429D】 Tricky Function
[题目链接] http://codeforces.com/problemset/problem/429/D [算法] 令Si = A1 + A2 + ... + Ai(A的前缀和) 则g(i,j) = ...
- 【Codeforces 670C】 Cinema
[题目链接] http://codeforces.com/contest/670/problem/C [算法] 离散化 [代码] #include<bits/stdc++.h> using ...
- 【codeforces 515D】Drazil and Tiles
[题目链接]:http://codeforces.com/contest/515/problem/D [题意] 给你一个n*m的格子; 然后让你用1*2的长方形去填格子的空缺; 如果有填满的方案且方案 ...
随机推荐
- Narrow Art Gallery
Time Limit: 4000ms, Special Time Limit:10000ms, Memory Limit:65536KB Total submit users: 11, Accepte ...
- 改你MB需求!
改你MB需求! 原创 2015-12-08 尖峰视界 尖峰视界 我敏锐的觉察到,产品经理的头像開始闪动了.在0.1秒的时间内,我全身的血液都冲向了大脑.果然.右上角弹出了文件传输窗体. "最 ...
- Android布局文件经验
1.父控件中含有多个子控件时.往往遵循长子优先的原则,即长子假设非常大可能占满父空间.使次子们出局: 2.如果TableLayout有2行,当中一行未设定列间长度比例.而还有一行设定了,则未设定行可能 ...
- WINDOWS XP 系统显示乱码的解决方法(修改注册表,使用正常字体)
一位同事的计算机进入WINDOWS XP系统后,电脑里的所有汉字全部显示乱码,很多办公文档无法打开而影响工作.因为第一次遇到这种问题,当然首先是百度解决了,搜索了相关的信息后找到了答案 ...
- luogu1226 取余运算||快速幂
题目大意:快速求$a^b\mod p$的值. 根据二进制,令$b=\sum t_k\cdot 2^k, t\in \{0,1\}$,那么$$a^b=a^{\sum t_k\cdot 2^k}\mod ...
- Controller methods and views
https://docs.asp.net/en/latest/tutorials/first-mvc-app/controller-methods-views.html We have a good ...
- FH Admin
http://www.360doc.com/content/14/0713/08/8072791_394027312.shtml
- 百度jquery公共引用地址
http://cdn.code.baidu.com/ http://apps.bdimg.com/libs/jquery/1.6.4/jquery.js http://apps.bdimg.com/l ...
- 2015 多校赛 第一场 1007 (hdu 5294)
总算今天静下心来学算法.. Description Innocent Wu follows Dumb Zhang into a ancient tomb. Innocent Wu’s at the e ...
- E - Dividing Orange
Problem description One day Ms Swan bought an orange in a shop. The orange consisted of n·k segments ...