随笔分类 - 数论
摘要:给出非负整数a,b;求的满足a x+b y=1的最小非负整数x和整数y,若没有则输出sorry。 include include include define rg register define int long long using namespace std; inline int read(
阅读全文
摘要:无原题地址 最近公共祖先 (commonants.c/cpp/pas) Input file: commonants.in Output file: commonants.out Time Limit : 0.5 seconds Memory Limit: 512 megabytes 最近公共祖先(
阅读全文
摘要:->点我进原题 [SDOI2008] 仪仗队 时空限制 1000ms / 128MB Description 作为体育委员,C君负责这次运动会仪仗队的训练。仪仗队是由学生组成的N * N的方阵,为了保证队伍在行进中整齐划一,C君会跟在仪仗队的左后方,根据其视线所及的学生人数来判断队伍是否整齐(如下图
阅读全文
摘要:无原题地址 公约数 Time Limits: 1000 ms Memory Limits: 262144 KB Detailed Limits ### Description 给定一个正整数$n$,在$[1,n]$的范围内,求出有多少个无序数对$(a,b)$满足$gcd(a,b) = a$ $xor
阅读全文
摘要:->戳我进原题 小珂的苦恼 时间限制:1000 ms 内存限制:1000 KB 难度:2 ### 描述 小珂是一名初中生,她现在很苦恼,因为老师布置了一个让她苦恼的作业,你能不能帮助她呢?题目信息如下。 已知二元一次方程 a*x+b*y=n, 判断这个二元一次方程有没有整数解,x,y为未知数,其中a
阅读全文
摘要:``` include define int long long using namespace std; const int N =3000010; int n,p,inv[N]; signed main(){ scanf("%d%d",&n,&p); inv[1]=1;printf("1\n")
阅读全文
摘要:``` include include define rg register using namespace std; const int N = 1e7 + 1; int n, m, v[N], prime[N], tot; bool is_prime[N]; inline int read(){
阅读全文
摘要:``` include include include include include define int long long using namespace std; const int N =2e9+1; const int mod =1e9+7; int T,n; struct mat{ i
阅读全文
摘要:``` include include include include include define int long long using namespace std; const int N =2e9+1; const int mod =1e9+7; int T,n; struct mat{ i
阅读全文
摘要:``` #include #define int long long int a,b,p; inline double power(int a,int b){ int ans=1; for(;b;b>>=1){ if(b&1) ans=ans*a; a=a*a; } return ans; } signed main(){ scanf("%lf%lf",&a,&b); prin...
阅读全文
摘要:``` include include define int long long using namespace std; const int N =1e5+10; int t,n,m,p; int a[N],b[N];//两个非负整数 inline int read(){ int f=0,x=0;
阅读全文

浙公网安备 33010602011771号