当前位置:网站首页>True question of CCF (anger takes 100 faints)
True question of CCF (anger takes 100 faints)
2022-07-18 21:14:00 【Diligent wild pointer】
List of articles
- 202206-1 normalization
- 201312-1 The most frequent number of occurrences
- 201403-1 On the contrary
- 201409-1 Adjacent number pairs
- 201412-1 Access control system
- 201503-1 Image rotation
- 201509-1 Sequence segmentation
- 201512-1 The sum of numbers
- 201604-1 Break point count
- 201609-1 Maximum fluctuation
- 201612-1 The middle number
- 201703-1 Divide the cake
- 202006-1 Linear classifier
- 202109-1 Array derivation
- 201709-1 get some soy sauce
- 201712-1 Minimum difference
- 201803-1 Take a jump
- 201809-1 Selling vegetables
- 201812-1 Xiao Ming goes to school
- 201903-1 Small, medium and large
- 202203-1 Warning not initialized
- 201909-1 Xiao Ming grows apples
- 202112-1 Sequence query
- 201912-1 Number off
- 202104-1 Gray histogram
- 202012-1 Safety index of final forecast
- 202009-1 It's called checkpoint query
202206-1 normalization
n=eval(input())
L=input().split()
L=[int(x) for x in L]
pinjun=sum(L)/len(L)
s=0
for ai in L:
s=s+(ai-pinjun)**2
fangcha=s/len(L)
for ai in L:
fai=(ai-pinjun)/fangcha**0.5
print(fai)
201312-1 The most frequent number of occurrences
n=eval(input())
L=list(map(int,input().split()))
A=[]
k=max(L)
cnt=[0]*(k+1)
for i in range(n):
if L[i] in A:
temp=L[i]
cnt[temp]+=1
else:
temp=L[i]
cnt[temp]=1
A.append(L[i])
M=max(cnt)
print(cnt.index(M))
201403-1 On the contrary
N=eval(input())
L=list(map(int,input().split()))
cnt=0
for num in L:
if -num in L:
cnt+=1
print(int(cnt/2))
201409-1 Adjacent number pairs
n=eval(input())
L=list(map(int,input().split()))
cnt=0
for i in range(n-1):
for j in range(i+1,n):
if abs(L[j]-L[i])==1:
cnt+=1
print(cnt)
201412-1 Access control system
n=eval(input())
L=list(map(int,input().split()))
M=[]
cnt=[0]*n
for i in L:
if i in M:
cnt[i]+=1
print(cnt[i],' ',end=' ')
else:
cnt[i]=1
print(cnt[i],' ',end=' ')
M.append(i)
201503-1 Image rotation
n,m=map(int,input().split())
jz=[]
for i in range(n):
L=list(map(int,input().split()))
jz.insert(0,L)
for i in range(m):
for j in range(n):
print(jz[n-j-1][m-i-1],'',end='')
print(' ')
201509-1 Sequence segmentation
n=eval(input())
L=list(map(int,input().split()))
cnt=1
for i in range(1,n):
if L[i]!=L[i-1]:
cnt+=1
print(cnt)
201512-1 The sum of numbers
n=input()
s=0
for i in range(len(n)):
temp=int(n[i])
s=s+temp
print(s)
201604-1 Break point count
n=eval(input())
L=list(map(int,input().split()))
cnt=0
for i in range(1,n-1):
if (L[i-1]<L[i] and L[i+1]<L[i]) or (L[i-1]>L[i] and L[i+1]>L[i]):
cnt+=1
print(cnt)
201609-1 Maximum fluctuation
n=eval(input())
L=list(map(int,input().split()))
max=0
for i in range(1,n):
temp=abs(L[i]-L[i-1])
if temp>max:
max=temp
print(max)
201612-1 The middle number
n=eval(input())
L=list(map(int,input().split()))
L.sort()
flag=0
for i in range(n):
big=0
small=0
for j in range(n):
if L[j]<L[i]:
small+=1
if L[j]>L[i]:
big+=1
if big==small:
print(L[i])
flag=1
break
if flag==0:
print(-1)
201703-1 Divide the cake
n,k=map(int,input().split())
L=list(map(int,input().split()))
sum=0
cnt=0
for i in range(n):
sum=sum+L[i]
if sum<k and i==n-1:
cnt+=1
if sum>=k:
cnt+=1
sum=0
print(cnt)
202006-1 Linear classifier
n,m=map(int,input().split())
N=[]
for i in range(n):
temp=input().split()
N.append(temp)
for i in range(m):
L1=[]
L2=[]
M=list(map(int,input().split()))
for j in N:
if M[0]+int(j[0])*M[1]+int(j[1])*M[2]>0:
L1.append(j[2])
if M[0]+int(j[0])*M[1]+int(j[1])*M[2]<0:
L2.append(j[2])
if ('A' in L1 and 'B' in L1) or ('A' in L2 and 'B' in L2):
print('No')
else:
print('Yes')
202109-1 Array derivation
n=int(input())
L=list(map(int,input().split()))
L1=[]
if len(set(L))==n:
print(sum(L))
print(sum(L))
else:
L1.append(L[0])
for i in range(1,n):
if L[i]!=L[i-1]:
L1.append(L[i])
else:
L1.append(0)
print(sum(L))
print(sum(L1))
201709-1 get some soy sauce
N=eval(input())
k1=N//50
k2=N%50//30
k3=N%50%30//10
print(k1*7+k2*4+k3)
201712-1 Minimum difference
n=eval(input())
L=list(map(int,input().split()))
MIN=abs(L[1]-L[0])
for i in range(n-1):
for j in range(i+1,n):
m=abs(L[j]-L[i])
if m<MIN:
MIN=m
print(MIN)
201803-1 Take a jump
L=list(map(int,input().split()))
sum=0
flag=1
for i in range(len(L)):
if L[i]==2:
sum=sum+2*flag
flag+=1
else:
flag=1
sum+=L[i]
print(sum)
201809-1 Selling vegetables
n=eval(input())
K=[]
L=list(map(int,input().split()))
for i in range(n):
if i==0:
ave=(L[i]+L[i+1])//2
K.append(ave)
elif i==(n-1):
ave=(L[i]+L[i-1])//2
K.append(ave)
else:
ave=(L[i]+L[i+1]+L[i-1])//3
K.append(ave)
for k in K:
print(k,end=' ')
201812-1 Xiao Ming goes to school
r,y,g=map(int,input().split())
n=eval(input())
L=[]
sum=0
for i in range(n):
temp=list(map(int,input().split()))
L.append(temp)
for i in range(n):
if L[i][0]==0:
sum=sum+L[i][1]
if L[i][0]==1:
sum=sum+L[i][1]
if L[i][0]==2:
sum=sum+L[i][1]+r
print(sum)
201903-1 Small, medium and large
n=eval(input())
L=list(map(int,input().split()))
L1=[]
L1.append(max(L))
if n%2!=0:
L1.append(L[n//2])
else:
if (L[n//2-1]+L[n//2])%2==0:
L1.append((L[n//2-1]+L[n//2])//2)
else:
L1.append('%.1f'%((L[n//2-1]+L[n//2])/2))
L1.append(min(L))
for i in L1:
print(i,end=' ')
202203-1 Warning not initialized
n,k=map(int,input().split())
num=[[i for i in map(int,input().split())] for j in range(k)]
time=0
temp=set()
for i in range(k):
if num[i][1]!=0 and num[i][1] not in temp:
time+=1
temp.add(num[i][0])
print(time)
201909-1 Xiao Ming grows apples
N,M=map(int,input().split())
L=[]
T=[]
s=0
for i in range(N):
temp=list(map(int,input().split()))
L.append(temp)
for i in range(N):
s=s+sum(L[i])
t=sum(L[i])-L[i][0]
T.append(t)
MIN=min(T)
print(s,end=' ')
print(T.index(MIN)+1,end=' ')
print(-MIN)
202112-1 Sequence query
n,N=map(int,input().split())
L=list(map(int,input().split()))
L.insert(0,0)
F=[]
sum=0
num=0
for i in range(len(L)):
if i==len(L)-1:
for j in range(N-L[-1]):
F.append(num)
else:
for j in range(L[i+1]-L[i]):
F.append(num)
num+=1
for i in range(n):
sum=sum+F[L[i]]*(L[i+1]-L[i])
sum=sum+F[L[n]]*(N-L[n])
print(sum)
201912-1 Number off
n=eval(input())
cnt=1
c=1
num1=0
num2=0
num3=0
num4=0
while cnt<=n:
if c%7==0 or '7' in str(c):
if c%4==1:
num1+=1
if c%4==2:
num2+=1
if c%4==3:
num3+=1
if c%4==0:
num4+=1
else:
cnt+=1
c+=1
print(num1)
print(num2)
print(num3)
print(num4)
202104-1 Gray histogram
n,m,l=map(int,input().split())
A=[[i for i in map(int,input().split())] for j in range(n)]
L=[0]*l
for i in range(n):
for j in range(m):
L[A[i][j]]+=1
for i in range(l):
print(L[i],end=' ')
202012-1 Safety index of final forecast
n=eval(input())
L=[[i for i in map(int,input().split())] for j in range(n)]
sum=0
for i in range(n):
sum=sum+L[i][0]*L[i][1]
if sum<=0:
print(0)
else:
print(sum)
202009-1 It's called checkpoint query
n,X,Y=map(int,input().split())
S=[]
for i in range(1,n+1):
x,y=map(int,input().split())
s=((X-x)**2+(Y-y)**2)
S.append([s,i])
S.sort(key=lambda x:x[0])
print(S[0][1])
print(S[1][1])
print(S[2][1])
边栏推荐
- Blog migration from cloudbase to virtual machine
- Uniapp request request encapsulation method
- 基于单片机倾角检测仪设计分享
- 初始 Redis(认识Redis以及常见命令)
- Brits: detailed explanation of bidirectional recursive imputation for time series
- Tableau JDBC连接GraphDB
- GD32F4(6):晶振引发串口乱码
- 浅谈数组方法重构再封装-forEach-Map——push(),unshift(),shift(),Map(),filter(),every(),some(), reduce()
- 高数下|二重积分的计算1|高数叔|手写笔记
- Play through ansible directory in one step
猜你喜欢

About SQL: orcale SQL, why is the foreign key inventory ID statement of the merchant table invalid

VirtualBox virtual machine failed to start, e_ FAIL( 0x80004005)

The thermal characteristics of this heater

redis实现分布式锁

Find out the motivation and needs of enterprise location, and carry out investment attraction work efficiently

Embedded development: seven techniques for accelerating firmware development

UE4阴影:PerObjectShadow验证

What is industrial planning? How to make industrial planning for industrial parks

On array method reconstruction and re encapsulation -foreach map -- push (), unshift (), shift (), map (), filter (), every (), some (), reduce ()

Epic-kbs9 industrial computer brushing document
随机推荐
What is the event delegation in JS?
劍指 Offer 57. 和為s的兩個數字
R语言使用lm函数构建多元回归模型、并根据模型系数写出回归方程、使用summary函数计算出模型的汇总统计信息(R方、F统计量、残差分布、残差标准误差、系数等)
Embedded development: seven techniques for accelerating firmware development
数学建模 - 分类模型(基于logistic回归)
Raspberry pie record
UE4 shadow: perobjectshadow verification
初始 Redis(认识Redis以及常见命令)
R language uses LM function to build regression model and BoxCox function of mass package to find the best power transformation to improve the fitting degree of the model (determine the best λ Paramet
World Tour Finals 2019 D - Distinct Boxes 题解
SkyWalking 针对 gRPC 的负载均衡和自动扩容实践
R语言dplyr包进行数据分组聚合统计变换(Aggregating transforms)、计算dataframe数据的分组分位数(quantile)
Play through ansible directory in one step
[cloud native] Devops (IV): integrated sonar Qube
浅谈数组方法重构再封装-forEach-Map——push(),unshift(),shift(),Map(),filter(),every(),some(), reduce()
docker mysql
鸿蒙应用开发项目新建过程与hap包生成方法
What skills do software test engineers need to master if they need to speak 20K? I dare to be higher with these skills~
R language uses GLM function to build Poisson logarithm linear regression model, processes three-dimensional contingency table data to build saturation model, and uses step function to realize stepwis
What is industrial planning? How to make industrial planning for industrial parks