Sicily 1641 Binary Searchable
来源:互联网 发布:淘宝秒杀抢拍器怎么买 编辑:程序博客网 时间:2024/05/17 22:19
水题,如果一个数比左面的都大,比右面的都小就是Binary Researchable
// Problem#: 1641// Submission#: 3247168// The source code is licensed under Creative Commons Attribution-NonCommercial-ShareAlike 3.0 Unported License// URI: http://creativecommons.org/licenses/by-nc-sa/3.0/// All Copyright reserved by Informatic Lab of Sun Yat-sen University#include<iostream>using namespace std;int main() { int n; while (cin >> n) { int a[105]; for (int i = 0; i < n; i++) { cin >> a[i]; } int count = 0; bool left, dext; for (int i = 0; i < n; i++) { left = dext = true; for (int j = i + 1; j < n; j++) { if (a[i] > a[j]) { dext = false; break; } } for (int j = i - 1; j >= 0; j--) { if (a[i] < a[j]) { left = false; break; } } if (left && dext) { count++; } } cout << count << endl; }}
0 0
- Sicily 1641 Binary Searchable
- Sicily 1641. Binary Searchable
- sicily--1641. Binary Searchable
- #sicily#1641.Binary Searchable
- 1000. Binary Searchable
- searchable
- sicily 1625 Binary Clock
- Sicily 1156 Binary tree
- Sicily 1156. Binary tree
- Sicily 1156. Binary tree
- sicily 1156.Binary tree
- sicily 1156. Binary tree
- sicily 1156. Binary tree
- sicily-1156. Binary tree
- Sicily 1156 Binary Tree
- sicily Binary Search
- Sicily 1156 Binary tree(搜索)
- [Sicily][深搜]1156. Binary tree
- UI基础-基础控件-0324-transform应用-使用transform实现btn小案例
- SharePoint Search之(八) 搜索中心站点
- Android Notification通知简单使用DEMO
- 控制界面切换的动画效果
- poj1240 Pre-Post-erous!
- Sicily 1641 Binary Searchable
- 编辑距离
- FPGA图像画质之显示器和视频头的画面问题
- 使用JS解决织梦dedecms多标签嵌套的问题
- ARC与非ARC在一个项目中同时使用
- 手机一秒震动一次(ZWB)
- android从相册或者照相获取图片,并且进行裁切
- 定风波·莫听穿林打叶声
- spring-mvc 拦截器 /** 的含义