hackerrank Piling Up!
来源:互联网 发布:网络赚钱方法大全 编辑:程序博客网 时间:2024/06/10 01:07
题目:https://www.hackerrank.com/challenges/piling-up/problem
题意:有点迷,大意就是是否从两边到中间逐渐减小
思路:list+sorted
其实最简单的是双指针模拟
代码:
'''-*- coding: utf-8 -*-@Author : PlayerGuan@Time : 2017/10/14 23:12@Software: PyCharm Community Edition@File : main.py'''from collections import dequeT = int(input())for case in range(T): n = int(input()) ls = list(map(int,input().split())) pos = ls.index(min(ls)) left = ls[:pos] right = ls[pos:] if left == sorted(left,reverse=True) and right == sorted(right): print("Yes") else: print("No")
阅读全文
0 0
- hackerrank Piling Up!
- Python HackerRank|Piling Up!(from collections import deque)
- [agc013d]Piling Up
- [DP] Atcoder AGC013D. Piling Up
- Atcoder Grand Contest 013D piling Up
- AtCoder Grand Contest 013D: Piling Up 题解
- hackerRank
- HackerRank
- HackerRank
- HackerRank
- HackerRank
- HackerRank
- HackerRank
- Domino piling
- A. Domino piling
- 50A_Domino piling
- 50A - Domino piling
- 50A Domino piling
- 链接
- Hexo 0 基础全套教程
- 机器学习 Python scikit-learn 中文文档与指南
- WEBGL学习【九】立方体贴不同的纹理
- redis简介与安装准备
- hackerrank Piling Up!
- 19. Python脚本学习笔记十九标准库
- 监控Linux环境下JVM应用内存的两种方法
- UVa 11716
- MySQL_索引_mysql高效索引之覆盖索引
- ServletContext讲解
- redis数据类型
- Android通过OpenSL ES播放音频套路详解
- redis解析配置文件