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 <unistd.h> //_getch | |
#include <termios.h> //_getch | |
#include <cstdio> | |
#include <iostream> | |
using namespace std; | |
char getch(){ | |
char buf=0; | |
struct termios old={0}; | |
fflush(stdout); | |
if(tcgetattr(0, &old)<0) |
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 <cstdio> | |
#include <cstring> | |
#include <vector> | |
#include <queue> | |
#include <algorithm> | |
using namespace std; | |
// data types |
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
#ifndef INCLUDE_SEMAPHORE | |
#define INCLUDE_SEMAPHORE 1 | |
#include <sys/types.h> | |
#include <sys/ipc.h> | |
#include <sys/sem.h> | |
#include <sys/shm.h> | |
#include <unistd.h> | |
class semaphore { |
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 <cstdio> | |
#include <cstring> | |
#include <cmath> | |
#include <algorithm> | |
#include <unistd.h> | |
#include <pthread.h> | |
#define EPS 1e-16L | |
using namespace std; |
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 <cstdio> | |
#include <cstring> | |
#include <cstdlib> | |
#include <algorithm> | |
#include <pthread.h> | |
#include <unistd.h> | |
using namespace std; | |
typedef void* object; |
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 <cstdio> | |
#include <cstring> | |
#include <vector> | |
#include <algorithm> | |
#define P (p << 1) | |
#define M ((L + R) >> 1) | |
#define INF 0xDEADBEE | |
using namespace std; |
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 <cstdio> | |
#include <ctime> | |
#include <unistd.h> | |
using namespace std; | |
char buffer[26]; | |
int main() { | |
int child = fork(); |
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 <cstdio> | |
#include <ctime> | |
#ifdef __GNUC__ | |
#include <unistd.h> | |
#define SLEEP(t) sleep(t) | |
#else | |
#include <cstdlib> | |
#define SLEEP(t) _sleep(t*1000) |
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
<div parallax='margin'> | |
This will scroll 0.15 times faster by default, using margin-top and margin-bottom offsets. | |
</div> | |
<div parallax='padding'> | |
You may also parallax using the padding instead of margin. | |
</div> | |
<div parallax='margin' speed='0.5'> |
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 <cstdio> | |
#include <queue> | |
#include <stack> | |
using namespace std; | |
const int N = 1000; | |
int vis[N][N]; pair<int, int> prev[N][N]; | |
int main() { |