teamnote default

This commit is contained in:
2026-06-03 09:20:51 +09:00
commit f50ed902fe
65 changed files with 6033 additions and 0 deletions

29
source/Misc/FastI.cpp Normal file
View File

@@ -0,0 +1,29 @@
#define getint(n) int n; read(n)
#define getll(n) ll n; read(n)
#define inta getint(a)
#define intab getint(a); getint(b)
char get() {
static char buf[100000], *S=buf, *T=buf;
if(S == T) {
S = buf; T = buf + fread(buf, 1, 100000, stdin);
if(S == T) return EOF;
}
return *S++;
}
void read(int& n) {
n = 0; char c; bool neg = false;
for(c = get(); c < '0'; c=get()) if(c=='-') neg = true;
for(;c>='0';c=get()) n = n*10+c-'0';
if(neg) n = -n;
}
void read(ll& n) {
n = 0; char c; bool neg = false;
for(c = get(); c < '0'; c=get()) if(c=='-') neg = true;
for(;c>='0';c=get()) n = n*10+c-'0';
if(neg) n = -n;
}
int read(char s[]) {
char c; int p = 0; while((c = get()) <= ' ');
s[p++] = c; while((c = get()) >= ' ') s[p++] = c;
s[p] = '\0'; return p;
}

7
source/Misc/NegDiv.cpp Normal file
View File

@@ -0,0 +1,7 @@
#define div _div
ll div(ll A, ll B)
{
ll q = A/B;
if(A<0) q-=(B>0)-(B<0);
return q;
}

View File

7
source/Misc/mt19937.cpp Normal file
View File

@@ -0,0 +1,7 @@
const long long rand_L = 1;
const long long rand_R = 10;
mt19937_64 rng(chrono::steady_clock::now().time_since_epoch().count());
uniform_int_distribution<int> dist(rand_L, rand_R);
auto gen = bind(dist, rng);
gen(); gen(); gen();