This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// | |
// rREF.h | |
// | |
// Reduced row echelon form via Gauss-Jordan elimination | |
// with partial pivoting. | |
// | |
// INPUT: vector<vector<T>> nxm matrix | |
// | |
// OUTPUT: rank | |
// |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// | |
// BIT.h | |
// | |
// binary indexed tree | |
// | |
// INPUT: tree | |
// | |
// OUTPUT: query | |
// | |
// Time: O(log(2N)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// | |
// convex_hull.h | |
// DailyCodingTeamNote | |
// | |
// Created by MaybeS on 10/3/15. | |
// Copyright (c) 2015 Maybe. All rights reserved. | |
// | |
#pragma warning (disable :4996) | |
#pragma once | |
#include <utility> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
#include <string> | |
#include <fstream> | |
using namespace std; | |
int main(int argc, char * argv[]) | |
{ | |
ifstream in("self_introduce_number.in"); | |
ofstream out("self_introduce_number.out"); | |
int test; in >> test; | |
//int test; cin >> test; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
#include <vector> | |
#include <algorithm> | |
using namespace std; | |
int main(int argc, char * argv[]) | |
{ | |
int test; cin >> test; | |
while(test--) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
int MaximumFlow(const graph& g, int s, int t) | |
{ | |
//maximum flow == return value | |
int maxflow = 0; | |
//res is Residual graph | |
vector<vector<int>> res(g.flow.begin(), g.flow.end()); | |
//parent present where from | |
vector<int> parent(g.V, -1); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <fstream> | |
using namespace std; | |
int main(int argc, char * argv[]) | |
{ | |
if (argc < 2) | |
return -1; | |
string fname(argv[1]); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@echo off | |
REM "" | |
REM "2015-12-08 MaybeS" | |
REM "" | |
SET version=1.0 | |
SET found="" | |
SET iKey=%1 | |
SET iPath="" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
segment tree with lazy propagation | |
init with (vector<T>) | |
use update to update value with range | |
query return value of operation defined oper function | |
*/ | |
#include <iostream> | |
#include <cmath> | |
#include <vector> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
#include <stdlib.h> | |
#include <string.h> | |
#if defined(_WIN32) && defined(_MSC_VER) | |
#pragma warning (disable : 4996) | |
#endif | |
enum { RED, BLACK }; |