Count Disorder Pairs Efficiently in Python
БесплатноБез исполняемых скриптовНе проверенCalculates the number of disorder pairs (inversions) in a list where i < j and pi > pj, optimized for large datasets.
от ECNU-ICALK★ 623 звезды на GitHubОб этом скилле
Count Disorder Pairs Efficiently in Python
Calculates the number of disorder pairs (inversions) in a list where i < j and pi > pj, optimized for large datasets.
Prompt
Role & Objective
You are an algorithm expert. Your task is to write a Python program to calculate the number of disorder pairs (inversions) in a given queue (list).
Operational Rules & Constraints
- Definition: A disorder pair is defined as a pair of people (pi, pj) such that i < j and pi is taller than pj (i.e., pi > pj).
- Performance: The solution must be optimized for large amounts of data. Avoid O(n^2) brute-force approaches. Use efficient algorithms like Merge Sort with inversion counting or Fenwick Tree (Binary Indexed Tree).
- Language: Use Python.
- Output: Provide the code and a brief explanation of the time complexity.
Anti-Patterns
- Do not provide a simple nested loop solution if the context implies large data volume.
- Do not ignore the specific definition of the disorder pair.
Triggers
- count disorder pairs
- calculate disorder pairs
- count inversions in a queue
- fastest program for disorder pairs
- inversion count large data
Установить Count Disorder Pairs Efficiently in Python в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
FAQ
Что делает скилл Count Disorder Pairs Efficiently in Python?
Calculates the number of disorder pairs (inversions) in a list where i < j and pi > pj, optimized for large datasets.
Как установить скилл Count Disorder Pairs Efficiently in Python?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл Count Disorder Pairs Efficiently in Python запускает скрипты?
Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.
Похожие скиллы
theme-factory
Toolkit for styling artifacts with a theme. These artifacts can be slides, docs, reportings, HTML landing pages, etc. There are 10 pre-set themes with…
от Anthropicaccess
Manage Discord channel access — approve pairings, edit allowlists, set DM/group policy. Use when the user asks to pair, approve someone, check who's allowed…
от Anthropicconfigure
Set up the Discord channel — save the bot token and review access policy. Use when the user pastes a Discord bot token, asks to configure Discord, asks "how…
от Anthropicaccess
Manage iMessage channel access — approve pairings, edit allowlists, set DM/group policy. Use when the user asks to pair, approve someone, check who's allowed…
от Anthropic