This file contains hidden or 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 <cstring> | |
#include <cstdlib> | |
#include <cstdio> | |
#include <set> | |
#include <map> | |
#include <numeric> | |
#include <queue> |
This file contains hidden or 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 <cstring> | |
#include <cstdio> | |
#include <numeric> | |
using namespace std; | |
typedef unsigned int u4; | |
#define MAXN 15 |
This file contains hidden or 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 <algorithm> | |
#include <vector> | |
#include <complex> | |
#include <cmath> | |
using namespace std; | |
static bool geoerror; | |
// #define USE_FLOAT |
This file contains hidden or 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 <sys/mman.h> | |
#include <sys/stat.h> | |
#include <sys/types.h> | |
#include <unistd.h> | |
#include <string> | |
#include <cstring> | |
#include <cctype> | |
#include <cstdio> |
This file contains hidden or 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 <sys/mman.h> | |
#include <sys/stat.h> | |
#include <sys/types.h> | |
#include <unistd.h> | |
#include <string> | |
#include <cstring> | |
#include <cctype> | |
#include <cstdio> | |
#include <cstdlib> |
This file contains hidden or 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
asm( | |
" .file \"queen2.cpp\"\n" | |
" .section .text._ZN2IO10skip_spaceEv,\"axG\",@progbits,_ZN2IO10skip_spaceEv,comdat\n" | |
" .align 2\n" | |
" .p2align 4,,15\n" | |
" .weak _ZN2IO10skip_spaceEv\n" | |
" .type _ZN2IO10skip_spaceEv, @function\n" | |
"_ZN2IO10skip_spaceEv:\n" | |
".LFB685:\n" | |
" .cfi_startproc\n" |
This file contains hidden or 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; | |
/* Recovers k increasing disjoint subsequences that cover the maximum possible | |
* number of elements from A. Runs in O(MN) time where M is the resulting | |
* number of elements on all subsequences. Based on the method | |
* described in section 4 of Greene's "An Extension of Schensted's Theorem". |
This file contains hidden or 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 <sys/types.h> | |
#include <dirent.h> | |
#include <stdio.h> | |
int main(int argc, char** argv) { | |
for (int i = 1; i < argc; i++) { | |
DIR* dir = opendir(argv[i]); | |
if (!dir) { | |
fprintf(stderr, "failed top open directory %s\n", argv[i]); | |
continue; |
This file contains hidden or 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
#!/bin/sh | |
DIR="/home/msg555/Dustforce" | |
BIN="$DIR/Dustforce.bin.x86_64" | |
BINESC=$(echo "$BIN" | sed -e 's/[]\/$*.^|[]/\\&/g') | |
if ps aux | grep "$BINESC" > /dev/null; then | |
/bin/echo -en '\xe1\x0d\x00\x00'"$@"'\x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000' | head -c 256 > "$DIR/IPC.sock" | |
else | |
"$BIN" $@ | |
fi |
This file contains hidden or 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
/* Correct answer is "OK". Most solutions incorrectly identify | |
* (4, 5) as a deadlock despite it not being reachable. | |
*/ | |
int NumberOfOperations(long long i) { | |
return 8; | |
} | |
int GetOperation(long long i, long long index) { | |
int op1[] = {1, 2, -2, 3, 2, -2, -1, -3}; |