影挚
影挚
全部文章
题解
归档
标签
去牛客网
登录
/
注册
影挚的博客
全部文章
/ 题解
(共71篇)
题解 | #序列中整数去重#
a = int(input()) b = list(map(int, input().split())) mid, ind = 0, [] for i in range(a): for j in range(i + 1, a): if b[j] == mid: ind.append(j) mid =...
Python3
2022-04-25
0
236
题解 | #有序序列判断#
n = int(input()) b = list(map(int, input().split())) c, d = sorted(b), sorted(b, reverse=True) if b == c or b == d: print('sorted') else: print('unsor...
Python3
2022-04-25
0
219
题解 | #[NOIP2013]记数问题#
a, b = map(int, input().split()) b, count_a = str(b), 0 for i in range(1, a + 1): i = str(i) if b in i: c = i.count(b) count_a += c print(count_a)
Python3
2022-04-25
0
224
题解 | #圣诞树#
标记 h = int(input()) a, b, c, d = '* ', '* ', '* ', 3 * h - 1 for i in range(1, h + 1): print((d - i * 3 + 3) * ' ' + c * i) print((d - i * 3 + 2...
Python3
2022-04-25
0
232
题解 | #空心三角形图案#
while True: try: n = int(input()) for i in range(1, n+1): if i == 1 or i == n: print('* ' * i) else: print('* ' + ' ' * (i-2) + '* ') except: break
Python3
2022-04-23
0
257
题解 | #空心正方形图案#
while True: try: n = int(input()) for i in range(n): if i == 0 or i == n - 1: print('* ' * n) else: print('* ' + ' ' * (n - 2) + '* ') except: break
Python3
2022-04-23
0
293
题解 | #X形图案#
while True: try: n = int(input()) if n % 2 == 1: a = n // 2 b = 1 else: a = n // 2 - 1 b = 2 for i in range(a): print(' ' * i + '' + ' ' * (n - 2 - 2 ...
Python3
2022-04-23
0
293
题解 | #箭形图案#
while True: try: n = int(input()) for i in range(1, n + 2): print(' ' * 2 * (n+1-i) + '' * i + ' ' * (i - 1)) for j in range(n): print(' ' * 2 * (j + ...
Python3
2022-04-23
0
217
题解 | #K形图案#
while True: try: n = int(input()) for i in range(n + 1): print(('* ' * (n - i + 1)).ljust(2 * n)) for j in range(2, n+2): print(('* ' * j).ljust(2 * n...
Python3
2022-04-23
0
307
题解 | #菱形图案#
while True: try: n = int(input()) for i in range(1, n + 2): print(('* ' * i).center(2 * (n + 1))) for j in range(n): print(('* ' * (n - j)).center(2 *...
Python3
2022-04-23
0
276
首页
上一页
1
2
3
4
5
6
7
8
下一页
末页