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
(function() { | |
var bd = document.getElementsByTagName("body")[0]; | |
var cw = document.documentElement.clientWidth; | |
var an = document.getElementsByTagName("a"); | |
var cf = document.getElementById("iv"); | |
if(cf){bd.removeChild(cf);return null;} | |
var li = []; | |
for (var i = 0; i < an.length; i++) { | |
var ref = an[i].getAttribute("href"); | |
var re = new RegExp("(.*)[.](jpg|gif|png)"); |
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
test.cpp:83:44: warning: deprecated conversion from string constant to 'char*' [-Wwrite-strings] | |
#define LOCAL_RESOURCE_PATH INSTALL_DATADIR"/libwebsockets-test-server" | |
^ | |
test.cpp:84:23: note: in expansion of macro 'LOCAL_RESOURCE_PATH' | |
char *resource_path = LOCAL_RESOURCE_PATH; | |
^ | |
test.cpp: In function 'void dump_handshake_info(libwebsocket*)': | |
test.cpp:155:35: error: invalid conversion from 'int' to 'lws_token_indexes' [-fpermissive] | |
if (!lws_hdr_total_length(wsi, 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 <sstream> | |
using namespace std; | |
// tribonacci sequence | |
long tribonacci(int n){ | |
long a=1, b=2, c=4; | |
if(1>n){ | |
return 0; | |
}else if(1==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
process.stdin.resume(); | |
process.stdin.setEncoding('utf8'); | |
// Here your code ! | |
process.stdin.on('data', function (chunk) { | |
var Naive = function(list1, list2){ | |
var res = []; | |
for(var i = 0; i < list1.length; i++){ | |
for(var j = 0; j < list2.length; j++){ | |
if(list1[i] == list2[j]) res.push(list1[i]); | |
} |
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 <algorithm> | |
using namespace std; | |
int main(void) | |
{ | |
int primary[] = { 1, 2, 4, 3, 5, 7, 11, 13 }; | |
int number[] = { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15 }; | |
int result[256]; | |
int* ret; |
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 <random> | |
#include <cmath> | |
// knuth shuffle | |
void shuffle(std::vector<int>& ary){ | |
std::random_device rd; | |
std::mt19937 mt(rd()); | |
long N = ary.size(); |
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 <random> | |
// shift array left 1 time | |
int shiftLeft(std::vector<int>& ary) { | |
using std::vector; | |
if(ary.size() > 2) { | |
int t = ary[0]; | |
for(int i=1; i<ary.size(); i++){ |
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 <random> | |
void merge_inplace(std::vector<int>& ary, long head, long mid, long tail) { | |
if ( ary.size() > 1 ) { | |
std::vector<int> L,R; | |
// copy | |
for (long i=head; i<=mid; i++) { L.push_back(ary[i]); } |
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 <random> | |
#include <vector> | |
#include <algorithm> | |
template<typename T> | |
long choosePivot (const std::vector<T>& ary, long head, long tail) { | |
std::random_device rd; | |
std::mt19937 mt(rd()); | |
std::uniform_int_distribution<long> dist(head, tail); |
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 <string> | |
#include <sstream> | |
#include <utility> | |
#include <limits> | |
#include <functional> | |
#include <queue> | |
#include <array> |
OlderNewer