Command Palette

Search for a command to run...

UnylyUnyly
Назад к скиллам

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от 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

  1. 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).
  2. 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).
  3. Language: Use Python.
  4. 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), без исполняемых скриптов.

Похожие скиллы

Сравнить Count Disorder Pairs Efficiently in Python с