想查看其他题的真题及题解的同学可以前往查看:CCF-CSP真题附题解大全
真题来源:寻宝!大冒险!
感兴趣的同学可以进去进行练习提交
70分题解:内存超限
- n, l, s = map(int,input().split())
- points = [[i for i in map(int,input().split())] for j in range(n)]
- money = [[i for i in map(int,input().split())] for j in range(s+1)]
- data = [[0 for i in range(l+1)] for j in range(l+1)]
- for point in points:
- x = point[0]
- y = point[1]
- data[x][y] = 1
- length = len(money)
- if length%2 == 0:
- for i in range(length//2):
- for j in range(length):
- money[i][j], money[s-i][j] = money[s-i][j], money[i][j]
- else:
- lake = length//2+1
- for i in range(length//2):
- if i == lake:
- continue
- for j in range(length):
- money[i][j], money[s-i][j] = money[s-i][j], money[i][j]
- time = 0
- for point in points:
- x = point[0]
- y = point[1]
- q = 0
- for i in range(s+1):
- if x+i > l:
- q = 1
- break
- if q == 1:
- break
- for j in range(s+1):
- if y+j > l:
- q = 1
- break
- if money[i][j] == data[x+i][y+j]:
- continue
- else:
- q = 1
- break
- if q == 0:
- time += 1
- print(time)
运行结果:
ccf-csp练习专栏