摘要: 小苯的逆序对 题目描述 小苯有一个长度为 $n$ 的排列 $p$。他很想知道这个排列中有多少个逆序对满足互素。 形式化的,有多少个满足 $(i<j)$ 且 $(a_i > a_j)$ 且 $gcd(a_i, a_j) = 1$ 的 $(i, j)$ 对。 输入描述: 输入包含两行。 第一行一个正整数 阅读全文
posted @ 2024-02-16 22:55 onlyblues 阅读(76) 评论(0) 推荐(1) 编辑
摘要: D. Sasha and a Walk in the City Sasha wants to take a walk with his girlfriend in the city. The city consists of $n$ intersections, numbered from $1$ 阅读全文
posted @ 2024-02-16 18:28 onlyblues 阅读(129) 评论(1) 推荐(1) 编辑
Web Analytics