- 博客(3)
- 收藏
- 关注
原创 H. Maximal AND
#include <bits/stdc++.h>// 贪心,从最高位开始首先统计有多少 1看k 是否可以补全 该位的1 using namespace std;const int N =2e5+10;int a[N];int pos[35];int main(){ int t; cin>>t; while(t--) { memset(pos,0,sizeof pos); int n,k; cin>>n>>...
2022-11-04 17:52:09
56
原创 1.博弈大师(博弈论)
#include <iostream>6#include <cmath>using namespace std;typedef long long LL;int main(){ int t; cin>>t; while(t--) { LL n,a,b; cin>>n>>a>>b; if(a>b)// 如果有技能卡 他们会利于自己 { cout<<"niuniu"<&l...
2022-04-23 08:09:48
538
1
原创 数学知识.1
1.质数:在大于1的整数中,只包含1和本身这两个约数,就被称为质数,或者素数。1) 质数的判定 -试除法bool is_prime(int x){ if(x<2) return false; for(int p=2;p<x/p;p++) if(x%p==0) return false; return true;}试题:AcWing 866. 试除法判定质数2) 分解质因数void divide (int x){ for(int p=2;p<.
2022-02-11 16:22:36
294
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人