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> | |
#include <iterator> | |
using namespace std; | |
int main() | |
{ | |
int N; |
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 <string> | |
using namespace std; | |
int main() | |
{ | |
string A, B; | |
cin >> A >> B; |
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 N; | |
int pos = 0; | |
int tree[1005]; | |
vector<int> input; |
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
f = open("IntegerArray.txt") | |
a = [] | |
for line in f: | |
a.append(int(line)) | |
def handle(t1, t2): | |
a1 = t1 | |
a2 = t2 | |
result = [] |
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
input_file = open("QuickSort.txt") | |
input_array = [] | |
for line in input_file: | |
input_array.append(int(line)) | |
def partition(A, l, r): | |
if r - l <= 0: | |
return 0 |
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
import random | |
smallest = 100000 | |
for t in range(1, 1000): | |
input_file = open("kargerMinCut.txt") | |
dic = {} | |
for line in input_file: | |
l = line.split('\t') | |
nums = list(map(lambda x: int(x), l[:len(l) - 1])) | |
dic[nums[0]] = nums[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 <iostream> | |
#include <map> | |
#include <fstream> | |
#include <vector> | |
#include <stack> | |
#include <algorithm> | |
std::vector<std::vector<unsigned>> finishOrder; |
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 <fstream> | |
#include <string> | |
#include <sstream> | |
#include <vector> | |
#include <map> | |
#include <set> | |
#include <algorithm> | |
void split(const std::string &s, char delim, std::vector<std::string> &elems) { | |
std::stringstream ss; |
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 <fstream> | |
#include <vector> | |
#include <algorithm> | |
int main() | |
{ | |
std::ifstream input_file("D:\\Playground\\Median.txt"); | |
std::vector<int> x, m, h1, h2; |
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> | |
#include <iostream> | |
#include <unordered_set> | |
#include <thread> | |
#include <future> | |
int foo(long long a, long long b, const std::unordered_set<long long>& set) | |
{ | |
int result(0); |
OlderNewer