Coderforces 373(Div.2)
来源:互联网 发布:人工智能失控 编辑:程序博客网 时间:2024/04/28 09:34
A
#include<iostream>#include<cstdio>#include<cstring>#include<algorithm>using namespace std;int main(){ int n; while(scanf("%d",&n)!=EOF) { int x[100]; for(int i=0;i<n;i++) scanf("%d",&x[i]); if(x[n-1]==0) {printf("UP\n");continue;} if(x[n-1]==15) {printf("DOWN\n");continue;} if(n==1) printf("-1\n"); else{ if(x[n-1]>x[n-2]) printf("UP\n"); else printf("DOWN\n"); } } return 0;}
B
#include<iostream>#include<cstdio>#include<cstring>#include<algorithm>using namespace std;int main(){ int n; while(scanf("%d",&n)!=EOF) { char c; int v[2][2]; memset(v,0,sizeof(v)); for(int i=0;i<n;i++){cin>>c;v[i%2][c=='r']++;} cout<<min(max(v[1][1],v[0][0]),max(v[1][0],v[0][1]))<<endl; } return 0;}
0 0
- Coderforces 373(Div.2)
- coderforces #284(Div.2)
- Coderforces Round #296(DIV.2)
- Coderforces Intel Code Challenge Final Round (Div. 1 + Div. 2, Combined)
- coderforces 2B the least round way
- coderforces 138CMushroom Gnomes - 2线段树
- coderforces 670D2 Magic Powder - 2
- Coderforces集锦
- Coderforces Round #
- Coderforces Next_Round
- Coderforces Team
- Coderforces Bit++
- Coderforces Football
- Coderforces Taxi
- Coderforces Tram
- Coderforces Twins
- Coderforces Presents
- coderforces 218 DIV2
- CSS3(三)布局样式
- 玩转微信应用号,「小程序」开发实操指南第二弹
- 连连看算法
- BZOJ3416 Poi2013 Take-out
- R23-
- Coderforces 373(Div.2)
- BZOJ1119 [POI2009]SLO
- 如何在caffe中添加新的Layer
- 如何让secureCRT保持连接不端开
- intent详解1
- win10系统怎么关闭自动更新
- python列表推导式
- Runtime获取一个类中所有成员变量的名字和类型
- 使用QRCode简单生成二维码