Skip to main content

Practice · 1 of 9

Mixed A1

CHALLENGE
Difficulty: advanced+25 XP

**Bài toán.** Given n integers, count pairs (i, j) with i < j and a[i] > 2·a[j]. **Constraints:** 1 ≤ n ≤ 200000; 0 ≤ a[i] < 100000. **Input:** line 1: n; line 2: n values. **Output:** one integer — the count (fits in 64 bits).

Back to lesson: Practice: Mixed Sets A/B/C — Topics Hidden