n = int(input())
scores = list(map(int, input().split()))
best = max(scores)
for i in range(n):
grade = 'F'
if scores[i] >= best - 10:
grade = 'A'
elif scores[i] >= best - 20:
grade = 'B'
elif scores[i] >= best - 30:
grade = 'C'
elif scores[i] >= best - 40:
grade = 'D'
print("学生{}分数为{},等级为{}".format(i, scores[i], grade))
![](https://i-blog.csdnimg.cn/blog_migrate/63b0c845552d5d94bbebfeb038a58d1d.png)
n = int(input())
nums = list(map(int, input().split()))
counts = [0] * 101
for num in nums:
counts[num] += 1
for i in range(1, 101):
if counts[i] > 0:
print(f"{i}出现{counts[i]}次")
![](https://i-blog.csdnimg.cn/blog_migrate/37ae454aacd3e1963a225192cec1ff6a.png)
n = int(input())
nums = list(map(int, input().split()))
unique_nums = list(set(nums))
for num in unique_nums:
print(num, end=" ")
![](https://i-blog.csdnimg.cn/blog_migrate/ffa6134d160f4525bb06d3af235434e4.png)
import math
n = int(input())
nums = list(map(int, input().split()))
gcd = nums[0]
for i in range(1, n):
gcd = math.gcd(gcd, nums[i])
print(gcd)
![](https://i-blog.csdnimg.cn/blog_migrate/e885e4069c7bb9a1a323fa22a76be62e.png)
def is_non_decreasing(arr):
for i in range(len(arr) - 1):
if arr[i] > arr[i+1]:
return "NO"
return "YES"
T = int(input())
for _ in range(T):
n = int(input())
arr = list(map(int, input().split()))
result = is_non_decreasing(arr)
print(result)
![](https://i-blog.csdnimg.cn/blog_migrate/e653b918a49332a7956bb9357014e582.png)
word1 = input()
word2 = input()
sorted_word1 = ''.join(sorted(word1))
sorted_word2 = ''.join(sorted(word2))
if sorted_word1 == sorted_word2:
print("YES")
else:
print("NO")
![](https://i-blog.csdnimg.cn/blog_migrate/8631ae6483c06dc55bf99ae31299d89a.png)
import random
ball_count, slot_count = map(int, input().split())
slots = [0] * slot_count
for _ in range(ball_count):
path = ""
slot = 0
for i in range(slot_count - 1):
if random.random() <= 0.5:
path += "L"
slot += 1
else:
path += "R"
slots[slot] += 1
print(path)
print(" ".join(map(str, slots)))
![](https://i-blog.csdnimg.cn/blog_migrate/8844e7ca3342c4e3089f3ee7d7df6eb3.png)
lockers = [False] * 100
for student in range(1, 101):
for locker in range(student, 101, student):
lockers[locker - 1] = not lockers[locker - 1]
open_lockers = [index + 1 for index, locker in enumerate(lockers) if locker]
print(open_lockers)
![](https://i-blog.csdnimg.cn/blog_migrate/b48fecc9ccedb629611728029e8fa89c.png)
n = int(input())
A = list(map(int, input().split()))
m = int(input())
B = list(map(int, input().split()))
C = []
i, j = 0, 0
while i < n and j < m:
if A[i] <= B[j]:
C.append(A[i])
i += 1
else:
C.append(B[j])
j += 1
while i < n:
C.append(A[i])
i += 1
while j < m:
C.append(B[j])
j += 1
print(" ".join(map(str, C)))
![](https://i-blog.csdnimg.cn/blog_migrate/061ead4a15c8b617bf5bef0d2e15def3.png)