首页 > 其他分享 >模板

模板

时间:2024-01-26 11:11:34浏览次数:22  
标签:typedef return int long include 模板 define

#define sandom signed
#define fre(x, y) freopen(#x ".in", "r", stdin), freopen(#y ".out", "w", stdout);
#include <iostream>
#include <cstdio>
#include <algorithm>
#include <cmath>
#include <cstring>
#include <string>
#include <vector>
#include <queue>
#include <deque>
#include <set>
#include <bitset>
#include <random>
#define rep(i, a, b) for (int i = (a); i <= (b); ++i)
#define dwn(i, a, b) for (int i = (a); i >= (b); --i)
// #define int long long
using namespace std; typedef long long ll; typedef unsigned long long ull; typedef pair<int, int> paint;
namespace IO
{
    const int bif = 1 << 18; char buf[bif], *p1, *p2; int wrt[20], Tp = 0;
    inline char getc() { if (p1 == p2) { p2 = (p1 = buf) + fread(buf, 1, bif, stdin); if (p1 == p2) return EOF; } return *p1++; }
    inline char gotc() { char c = getc(); while (c == ' ' || c == '\n' || c == '\r') c = getc(); return c; }
    inline int read() { int x = 0; bool f = 0; char c = getc(); while (!isdigit(c)) f |= c == '-', c = getc(); while (isdigit(c)) x = (x << 1) + (x << 3) + (c ^ 48), c = getc(); return f ? -x : x; }
    inline void write(int x, bool f) { if (x < 0) putchar('-'), x = -x; do { wrt[++Tp] = x % 10, x /= 10; } while(x); while(Tp) putchar(wrt[Tp--] | 48); putchar(f ? '\n' : ' '); }
} using namespace IO;
const int Z = 1e5 + 10, inf = 2e9, mod = 998244353;
inline int max(int a, int b) { return a > b ? a : b; } inline int min(int a, int b) { return a < b ? a : b; } inline int abs(int x) { return x < 0 ? -x : x; }

int n, m, k, ans;

sandom main()
{
    fre(test, test);
    // ios::sync_with_stdio(false), cin.tie(0), cout.tie(0);
    return 0;
}
/*
IN
OUT
*/

标签:typedef,return,int,long,include,模板,define
From: https://www.cnblogs.com/sandom/p/17988934

相关文章

  • 自定义模板中数据标签
    笔记数据标签(DataTag)只是一种辨识度比较高的文本字符串,样式完全由开发人员自己说了算。比如这样的数据标签“【##日期$$】”,编写代码openDataTag("【##日期$$】")即可返回数据标签对象,进而可以对此数据标签填充数据或设置样式等操作。在实际的Word文档开发中,经常需要自动填充......
  • Auth模板
    Auth模板什么是Auth模块,有什么用?django的auth的模块的使用:auth是集合注册,登录,注销,session多个功能集合在一起的模块使用Auth组件的默认auth_user表常用操作fromdjango.contrib.auth.modelsimportUser#1、创建普通用户User.objects.create_user(username='......
  • P3374 【模板】树状数组 1(线段树)
    【模板】树状数组1题目描述如题,已知一个数列,你需要进行下面两种操作:将某一个数加上x求出某区间每一个数的和输入格式第一行包含两个正整数n,m,分别表示该数列数字的个数和操作的总个数。第二行包含n个用空格分隔的整数,其中第i个数字表示数列第i项的初始值......
  • 根据word模板动态导出word文档
    根据word模板动态导出word文档前置条件:新建一个springboot项目1.引jar包<dependency><groupId>org.springframework.boot</groupId><artifactId>spring-boot-starter-web</artifactId></dependency><dependency><group......
  • 【模板】并查集
    并查集是解决两元素是否属于同一集合,将一个集合合并另一集合的数据结构。具体来说,我们使用数字代替集合,比如集合1,集合2.使用数组f[i]维护元素i属于的集合,比如f[2]=4表示元素2属于集合4。具体我们有以下实现功能的代码1初始化表示集合的数组。cin>>n>>m;for(int......
  • 代码模板
    代码模板数论快速幂intqmi(inta,intb,intp){ intres=1; while(b){ if(b&1)res=res*a%p; a=a*a%p; b>>=1; } returnres;}线性筛法(素数+欧拉函数)intst[N1],pri[N1],cnt,phi[N1];intgetp(intn){ phi[1]=1; for(inti=......
  • P3389 【模板】高斯消元法
    #include<bits/stdc++.h>usingnamespacestd;doublemax(doublea,doubleb){ if(a>=b)returna; if(a<b)returnb;}intn;doublea[1010][1010];doublea1[1010][1010];intmain(){ scanf("%d",&n); for(inti=1;i<=n;i++) { ......
  • P3374 【模板】树状数组 1
    part1#include<bits/stdc++.h>#defineintlonglongusingnamespacestd;structnode1{intl,r,value;};node1node[2000020];inta[500010];voidmt(intp,intl,intr){intmid=(l+r)>>1;node[p].l=l;node[p].r=r;if(l==r)......
  • P3368 【模板】树状数组 2
    #include<bits/stdc++.h>#defineintlonglongusingnamespacestd;constintMax=500005;inta[Max];intn,m;intlowbit(intx){ returnx&-x;}voidadd(intx,inty){ while(x<=n){ a[x]+=y; x+=lowbit(x); }}intsum(intx)......
  • 【模板】多项式半家桶 version 2
    #include<bits/stdc++.h>usingnamespacestd;#ifdefLOCAL#definedebug(...)fprintf(stderr,##__VA_ARGS__)#else#defineendl"\n"#definedebug(...)void(0)#endiftypedeflonglongLL;template<unsignedumod>structmodint{......