Roy 的解題紀錄

Home Archives About
2019-02-02
解題區►Uva

Uva 402 - M*A*S*H

題目

Problem#

有一排人(長度$N$),每次從一疊卡(20張)頂端抽出一張卡,點數$i$ 代表 列隊每$i$個人要去除。

比如:列隊有10人,抽到點數3的卡,則:

1
2
3
4
1 2 3 4 5 6 7 8 9 10
x x x

x 代表去除

想法#

依照題目敘述模擬去除人數即可。

AC code#

https://github.com/roy4801/solved_problems/blob/master/uva/402.cpp

Share Comments
  • Uva
  • 解題紀錄
Newer
Uva 10935 - Throwing cards away I

Categories

  • 解題區
    • CSES
      • Introductory Problems
    • Leetcode
      • Easy
      • Hard
      • Medium
    • Uva

Tags

  • 2D 格子
  • BFS
  • Bit Manipulation
  • CSES
  • Class
  • DP
  • Design
  • Game Thoery
  • LCS
  • LIS
  • Leetcod
  • Leetcode
  • Stack
  • Uva
  • array
  • backtracking
  • bfs
  • binary search
  • bitwise 枚舉
  • bst
  • cycle
  • cycle detection
  • dfs
  • dijkstra
  • disjoint set
  • geometry
  • graph
  • greedy
  • hashmap
  • interval
  • linked list
  • map
  • math
  • matrix
  • matrixe
  • minumum spanning tree
  • monotonic stack
  • ordered set
  • prefix sum
  • priority queue
  • simulation
  • sliding window
  • sort
  • sorting
  • stack
  • string
  • 二分圖
  • 二分答案
  • 暴搜
  • 背包
  • 著色問題
  • 解題紀錄
  • 雙指標

Tag Cloud

2D 格子 BFS Bit Manipulation CSES Class DP Design Game Thoery LCS LIS Leetcod Leetcode Stack Uva array backtracking bfs binary search bitwise 枚舉 bst cycle cycle detection dfs dijkstra disjoint set geometry graph greedy hashmap interval linked list map math matrix matrixe minumum spanning tree monotonic stack ordered set prefix sum priority queue simulation sliding window sort sorting stack string 二分圖 二分答案 暴搜 背包 著色問題 解題紀錄 雙指標

Archives

  • July 2024
  • June 2024
  • May 2024
  • April 2024
  • March 2024
  • February 2024
  • January 2024
  • December 2023
  • November 2023
  • October 2023
  • September 2023
  • August 2023
  • July 2023
  • June 2023
  • May 2023
  • March 2023
  • February 2023
  • January 2023
  • December 2022
  • November 2022
  • July 2022
  • March 2022
  • February 2022
  • May 2021
  • March 2021
  • September 2019
  • June 2019
  • May 2019
  • February 2019

Recent Posts

  • Leetcode 2181 - Merge Nodes in Between Zeros
  • Leetcode 1509 - Minimum Difference Between Largest and Smallest Value in Three Moves
  • Leetcode 409 - Longest Palindrome
  • Leetcode 1863 - Sum of All Subset XOR Totals
  • Leetcode 861 - Score After Flipping Matrix
© 2024 Roy
Powered by Hexo
Home Archives About