Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
a给出了一个由 0 到 n-1 之间的 n 个整数组成的数组。答案是 (0,...,n-1) 的排列,这样:
a
a_0 + h_0 <= a_1 + h_1 <= ... <= a_n-1 + h_n-1 <= n-1
n <= 60答案是独一无二的。
n <= 60
例如,如果a是 (0,2,4,2,0),则答案 ( h) 是唯一确定的(正如问题所承诺的那样):
h
h = (3,1,0,2,4)