京东24号运维工程师笔试

import sys
import math
n=int(input())
s=str(input())
now=[[False],0]
for i in s:
	***=[]
	for j in now:
		if (i.islower() and j[0]) or (i.isupper()) and not j[0] :
			***.append([not j[0],j[1]+1])#用caps
			***.append([j[0],j[1]+1])#用shift
		else:
			***.append([j[0],j[1]])
		***.sort(key=lambda x:x[1])
		joke=***[0][1]
	for j in ***:
		if joke==j[1]:
			now.append(j)
print(now[0][1]+len(s))
这是那个CapsLock和shift的那个
import sys
import math
n=int(input())
s=input().split(" ")
s=[int(i) for i in s]
f=s[:]
f.sort()
ans=0
ds={}
df={}
for i in range(len(s)):
	ds[s[i]]=True
	df[f[i]]=True
	if ds==df:
		ans+=1
		ds={}
		df={}
print(ans)这个是合唱团

均是全部ac,但是第一个时间很差#京东##运维工程师##笔试题目#
全部评论
运维开发工程师
点赞 回复 分享
发布于 2019-08-24 22:05
运维还有代码题?
点赞 回复 分享
发布于 2019-08-24 22:00
运维开发嘛铁汁
点赞 回复 分享
发布于 2019-08-24 21:59

相关推荐

06-12 10:50
门头沟学院 Java
你的不定积分没加C:我怎么在学院群看到了同样的话
点赞 评论 收藏
分享
评论
点赞
4
分享

创作者周榜

更多
牛客网
牛客网在线编程
牛客网题解
牛客企业服务