Skip to content

Commit

Permalink
leetcode969
Browse files Browse the repository at this point in the history
  • Loading branch information
pwxcoo committed Feb 23, 2019
1 parent 40be01e commit b61d1e5
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 6 deletions.
15 changes: 15 additions & 0 deletions 2019-02/2019-02-23/leetcode969.cpp
@@ -0,0 +1,15 @@
class Solution {
public:
vector<int> pancakeSort(vector<int>& A) {
vector<int> res;
int x,i;
for (x = A.size(); x > 0; --x) {
for (i = 0; A[i] != x; ++i);
reverse(A.begin(), A.begin() + i + 1);
res.push_back(i + 1);
reverse(A.begin(), A.begin() + x);
res.push_back(x);
}
return res;
}
};
13 changes: 7 additions & 6 deletions ARCHIVED_README.md
Expand Up @@ -91,18 +91,18 @@ Accept Game
- leetcode763 / greedy
- leetcode764 / dp
### 2018-01-18
- 牛客练习赛10 A
- 牛客练习赛10 A
- 牛客练习赛10 B / stack
### 2018-01-19
- Wannafly挑战赛8 A
- Wannafly挑战赛8 A
- Wannafly挑战赛8 B
### 2018-01-20
- Wannafly挑战赛8 C / 状态压缩+dp
### 2018-01-21
- 2018年全国多校算法寒假训练营练习比赛(第一场)A
- 2018年全国多校算法寒假训练营练习比赛(第一场)A
- 2018年全国多校算法寒假训练营练习比赛(第一场)B
- 2018年全国多校算法寒假训练营练习比赛(第一场)H / 注意数据范围
- 2018年全国多校算法寒假训练营练习比赛(第一场)I
- 2018年全国多校算法寒假训练营练习比赛(第一场)I
### 2018-01-22
- hihocoder1355 / 模拟(找规律)
### 2018-01-24
Expand Down Expand Up @@ -359,7 +359,7 @@ Accept Game
### 2018-10-31
- codeforces Round 53 C / 购物问题,取余简化复杂度
### 2018-11-02
- hihocoder1451 / 看起来是 dp,其实是找规律 +
- hihocoder1451 / 看起来是 dp,其实是找规律 +
### 2018-11-04
- hihocoder1452 / 找到一堆 word 里是 s 子序列的最长的一个,用一个 f[i][j] 保存 S[i] 中下一个字符 j 的位置
- leetcode933 / 模拟一个操作,查询同时保存结果
Expand Down Expand Up @@ -447,4 +447,5 @@ Accept Game
### 2019-01-06
- leetcode872 / dfs
### 2019-01-07
- codeforces-round530-A
- codeforces-round530-A
### 2019-02-23

0 comments on commit b61d1e5

Please sign in to comment.