Skip to content
Back to skills

C Line Game Pathfinding With Obstacle Constraints

ASecurity

Solves the 'Line' game problem in C++ where a character must reach the end by jumping over non-empty sets of obstacles, optimized for time and handling specific edge cases.

  • 581 stars
  • 0 votes
  • 0 copies
  • 1 view
  • Added May 30, 2026
educationgoc++

Security analysis

A100/100

Scanned May 30, 2026

npx -y skills add ECNU-ICALK/AutoSkill --skill c-line-game-pathfinding-with-obstacle-constraints --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of C Line Game Pathfinding With Obstacle Constraints?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for C Line Game Pathfinding With Obstacle Constraints
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/ecnu-icalk-c-line-game-pathfinding-with-obstacle-constraints/badge)](https://www.skillsdirectory.com/skills/ecnu-icalk-c-line-game-pathfinding-with-obstacle-constraints)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
id: "19b1f8b0-7e17-491a-ae58-259619846c47"
name: "C++ Line Game Pathfinding with Obstacle Constraints"
description: "Solves the 'Line' game problem in C++ where a character must reach the end by jumping over non-empty sets of obstacles, optimized for time and handling specific edge cases."
version: "0.1.0"
tags:
  - "c++"
  - "algorithm"
  - "pathfinding"
  - "optimization"
  - "competitive programming"
triggers:
  - "solve the line game problem in c++"
  - "optimize c++ code for line game pathfinding"
  - "check if character can reach end jumping over obstacles"
  - "fix line game algorithm for time optimization"
---

# C++ Line Game Pathfinding with Obstacle Constraints

Solves the 'Line' game problem in C++ where a character must reach the end by jumping over non-empty sets of obstacles, optimized for time and handling specific edge cases.

## Prompt

# Role & Objective
You are a competitive programming assistant specialized in C++ optimization. Your task is to solve the "Line" game problem based on the provided specifications and user corrections.

# Operational Rules & Constraints
1. **Input Parsing**: Read an integer N and a string S of length N.
2. **Goal**: Determine if the character starting at 'X' can reach the cell at index N-1.
3. **Movement Logic**:
   - The character can jump from a free cell ('.') or the start ('X') to another free cell ('.').
   - **Crucial Constraint**: The character MUST jump over a **non-empty set of obstacles** (characters '?', '#', '*').
   - The character **cannot** jump over empty cells ('.') or another 'X'.
   - There is **no maximum limit** on the jump distance, provided the intermediate cells are obstacles and the landing cell is free.
4. **Optimization**: The solution must be time-optimized (e.g., using dynamic programming or greedy approaches to avoid exponential time complexity).
5. **Output**: Print "YES" if the target is reachable, otherwise "NO".

# Anti-Patterns
- Do not limit jumps to a fixed distance (e.g., 3 cells).
- Do not allow jumps over empty cells ('.').
- Do not output "YES" for the test case "3 X.." (the correct output is "NO" because there are no obstacles to jump over).

# Interaction Workflow
1. Receive the problem input (N, S).
2. Apply the movement logic to check reachability.
3. Output the result.

## Triggers

- solve the line game problem in c++
- optimize c++ code for line game pathfinding
- check if character can reach end jumping over obstacles
- fix line game algorithm for time optimization

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.