Skip to content

Instantly share code, notes, and snippets.

View fwang49asu's full-sized avatar

Feng Wang fwang49asu

View GitHub Profile
#include <iostream>
#include <vector>
#include <unordered_set>
#include <algorithm>
#include <stack>
using namespace std;
class Capcity {
private:
#include <iostream>
#include <vector>
#include <unordered_set>
#include <algorithm>
#include <stack>
using namespace std;
class Capcity {
private:
#include <iostream>
#include <vector>
#include <unordered_set>
#include <algorithm>
using namespace std;
class Capcity {
private:
void dfs(vector<vector<int>>& graph, int root, vector<bool>& visited, vector<int>& cache) {
#include <iostream>
#include <vector>
using namespace std;
class SlidingPuzzle {
private:
vector<int> bitree;
int lowbit(int x) {
return x & (-x);
}
#include <iostream>
#include <vector>
using namespace std;
class SlidingPuzzle {
private:
int inversions(vector<int>& board) {
int result = 0;
for (int i = 0; i < board.size(); ++i) {
for (int k = i + 1; k < board.size(); ++k) {
#include <iostream>
#include <vector>
#include <unordered_map>
#include <unordered_set>
#include <queue>
#include <algorithm>
#include <sstream>
using namespace std;
#include <iostream>
#include <vector>
#include <unordered_map>
#include <unordered_set>
#include <queue>
#include <algorithm>
using namespace std;
struct State {
#include <iostream>
#include <vector>
#include <unordered_map>
#include <queue>
#include <algorithm>
using namespace std;
struct State {
int key;
class Solution {
private:
struct State {
string key;
vector<int> board;
vector<int> indices;
};
string encode(vector<int>& vec) {
string result = "";
@fwang49asu
fwang49asu / LC773_BFS_1.cpp
Created March 10, 2019 07:11
Leetcode 773 BFS_1
class Solution {
private:
struct State {
string key;
vector<int> board;
vector<int> indices;
};
string encode(vector<int>& vec) {
string result = "";