report VI VI EN
Register | Login
  • HOME
  • PROBLEMSET
  • ROADMAP
  • COMPETITION
  • TOPIC
  • RANKING
  • GUIDE
  • MASHUP
  • ABOUT
  • CONTACT
  • Problem
  • Submit
  • Results
Subset - FlandreOJ: Flandre Online Judge

Subset

Time limit: 1000 ms
Memory limit: 256 MB
Given a set $S = {1, 2, \ldots, n}$, the task is to list all subsets of size $k$ in lexicographic order. ### Input - A single line contains two integers $n,k$. ### Output - List all subsets of size $k$ from set $S$ in lexicographic order. ### Constraints - $1 \le k \le n \le 20$. ### Example Input: ``` 4 2 ``` Output: ``` 1 2 1 3 1 4 2 3 2 4 3 4 ```
Backtracking
Binary string
ABC string
Subset sum
Subset
Permutations
Group division
Knight's tour
N-queens problem
Maximum path
Knapsack
Build array
Sudoku
Minesweeper
Travelling Salesman Problem
Word search
Topic
Complete Search
Rating 800
Solution (1) Solution