随笔分类 - 模板
摘要:1 struct Edge{ 2 int v,next; 3 }edge[maxn<<1]; 4 int cnt,head[maxn]; 5 void add(int u,int v){ //链式前向星 6 edge[cnt].v=v; 7 edge[cnt].next=head[u]; 8 hea
阅读全文
摘要:#include<bits/stdc++.h>using namespace std;#define maxn 510const double eps=1E-8;int sig(double d){ return(d>eps)-(d<-eps);}struct Point{ double x,y;
阅读全文
摘要:1 #include <bits/stdc++.h> 2 #define ll long long 3 using namespace std; 4 5 inline int read(){ 6 int x=0,f=1; char ch=getchar(); 7 while(ch<'0'||ch>'
阅读全文
摘要:void getprim(){ check[1] = 1; int sum = 0,i,j; for(i = 2;i <= n; i++) { if(!check[i]) primer[sum++] = i; for(j = 0;j < sum;j ++)/* 1 */ { if(i*primer[
阅读全文
摘要:inline int read(){ int x=0,f=1; char ch=getchar(); while(ch<'0'||ch>'9'){ if(ch=='-') f=-1; ch=getchar(); } while(ch>='0'&&ch<='9'){ x=(x<<1)+(x<<3)+(
阅读全文
摘要:a^-1 mod p 就是 我们要求的,这个值的结果恒等于 a^p-2 mod p inline int ksm(int x,int y){ int ans1=1;while (y){ if (y&1) ans1=1ll*ans1*x%Mod; y>>=1;x=1ll*x*x%Mod; }retur
阅读全文
摘要:1 #include <cstdio> 2 #include <iostream> 3 #include <algorithm> 4 #include <cstring> 5 6 using namespace std; 7 const int N=1e6+5; 8 char s[N],t[1000
阅读全文
摘要:1 #include <bits/stdc++.h> 2 using namespace std; 3 char s[1005]; 4 int arr[1005]; 5 int c; 6 int main() 7 { 8 scanf("%s",s); 9 scanf("%d",&c); 10 for
阅读全文
摘要:int gdc(int n){ int num[200]={1}; //保存这个位置的数 int jw=0,len=1; for(int i=2;i<=n;i++){ for(int j=0;j<len;j++){ int zhi=(num[j]*i+jw)/10; num[j]=(num[j]*i
阅读全文
摘要:struct Point{ int x1,y1,x2,y2;}A[20];int arr[20];struct Node{ int x,y;};bool judge(Point p1,Point p2){ //相交最基本的条件 if(max(p1.x1,p1.x2)<min(p2.x1,p2.x2)
阅读全文

浙公网安备 33010602011771号