摘要:
"题目" 插入一个再排序,没有一点难度 struct Node { int x; int y; Node(){} Node(int x,int y){ this x = x; this y =y; } }a[100005]; int Compare(Node a,Node b) { if(a.x== 阅读全文
摘要:
"题目" 简单的结构体排序 struct Node { int x; int y; Node(){} Node(int x,int y){ this x = x; this y =y; } }a[100005]; int Compare(Node a,Node b) { if(a.x==b.x) { 阅读全文
摘要:
题目 上一题用了递归,这次用栈 ``` class Solution {public: int ans=0; int a[100][100]; int m; int x[100005]; int y[100005]; int s[100005]; int p[100005]; int totalNQ 阅读全文
摘要:
题目 N 皇后问题。 其实就是DFS或者BFS的入门题。 要是可以用位运算来模拟皇后的摆放和棋盘,那么代码就很优雅了。 class Solution { public: vector<vector<string>> ans; int a[100][100]; int m; vector<vector 阅读全文