Skip to content

Instantly share code, notes, and snippets.

View YangKeao's full-sized avatar
👨‍🏭
working

YangKeao YangKeao

👨‍🏭
working
View GitHub Profile
#include <iostream>
#include <queue>
using namespace std;
int n,m,a,b,k;
int dist[150000];
bool inq[150000];
struct Edge{
int u,v,c,next;
}edge[150000];
int e=0,head[150000];
#include <iostream>
using namespace std;
int a,b,c;
int t,g;
int father[6000];
int getfather(int a){
if(father[a]==a) return a;
else father[a]=getfather(father[a]);
return father[a];
}
#include<stdio.h>
using namespace std;
long long q;
float CarmSqrt(float x){
union{
int intPart;
float floatPart;
} convertor;
#include <iostream>
using namespace std;
int n,c[1000000],m;
int t,g,l;
int low(int x){
return x&(-x);
}
int sum(int x){
int sum=0;
while(x>0){
#include <stdio.h>
#include <iostream>
using namespace std;
struct Node
{
long long left;
long long right;
long long delta;
long long sum;
Node *lc;
/*
八数码难题
*/
#include <iostream>
#include <cstdio>
using namespace std;
const int
d[4][2]={0,1,
0,-1,
1,0,
@YangKeao
YangKeao / In&Out.cpp
Last active August 29, 2015 14:03
输入输出
#include<iostream>
#include<cstdio>
#include<ctype.h>
using namespace std;
inline int readint()
{
char c=getchar();
while(!isdigit(c))c=getchar();
int x=0;
@YangKeao
YangKeao / in.cpp
Created July 12, 2014 07:34
输入
template <class T>
static void read(T &rec)
{
rec=0;
char c;
while((c=getchar())<'0' || c>'9');
while(c>='0' && c<='9')
{
rec=(rec<<3)+(rec<<1)+(c-'0');
c=getchar();
//http://acm.hdu.edu.cn/showproblem.php?pid=1166
#include <iostream>
#include <stdio.h>
#include <string.h>
#define N 50005
using namespace std;
int M;
int T[N*4];
int Query(int s,int t){
@YangKeao
YangKeao / mem_order.cpp
Created March 17, 2019 14:31
简单地触发因为reorder而产生的问题
#include <semaphore.h>
#include <random>
sem_t begin_sem1;
sem_t begin_sem2;
sem_t end_sem;
int X, Y;
int r1, r2;