填空题 2020 省赛
没有好的思路,请大佬们指教
#include
#include
int main(int argc, char *argv[])
{
// 请在此输入您的代码
int sum = 0;
//有一段二极管发光; a,b,c,d,e,f,g
int l1 = 7;
//有两段二极管发光; ab,af,bc,bg,cg,cd,de,eg,ef,fg
int l2 = 10;
//有三段二极管发光; abf,abc,abg,afg,afe,bcd,bcg,bgf,bge,cgd,cgf,cge,cde,cdg,deg,def,efg
int l3 = 16;//
//有四段二极管发光; abcd,abcg,abcf,abge,abgf,abfe,afeg,bcde,bcdg,bcgf,bcge,bged,bgef,cdef,cdeg,cdgf,cgfa,cgfe,defg,defa
int l4 = 20;
//有五段二极管发光即有两端不发光; ab,ac,ad,ae,af,ag,bc,bd,be,bg,cd,cf,cg,de,df,dg,ef,eg,fg
int l5 = 19;//
//有六段二极管发光即有一端不发光; a,b,c,d,e,f,g
int l6 = 7;//(找一段二极管不发光的:)
//第七种情况,全部发光
int l7 = 1;
sum = l1 + l2 + l3 + l4 + l5 + l6 + l7;
printf("%d\n", sum);
return 0;
}
模拟 规律 2020 省赛
ababc
输出
21
代码:
在这里插入代码片
2021 省赛
n = 2021041820210418
docker = set()
count = 0
for i in range(1,int(n**0.5)+1):
if n%i==0:
docker.add(i)
docker.add(n//i)
for i in docker:
for j in docker:
for k in docker:
if i*j*k==n:
count+=1
print(count) # 2430
import os
import sys
# 请在此输入您的代码
'''
def zhishu(num):
for i in range(2,num):
if num%i==0:
return False
return True
count=0
for i in range(2,100000):
if zhishu(i):
count+=1
if count==2019:
print(i)
break
'''
print(17569)