摘要:
#include #include #include #include using namespace std; struct edge//存储边连接的点和改边的权值 { int to,w; }; vectormap[10001];//二维动态数组实现 int n,m; int x,y,z,k; int main () { edge e; cin>>n>>m; for (int i=1... 阅读全文
摘要:
洛谷爆内存了 然而并不想改 #include#include#includeusing namespace std;int n,m;int isnotp[10000001],prim[10000001],cnt,check[10000001],xi;int primer (int x){ fo... 阅读全文
摘要:
基本操作和模板 阅读全文
摘要:
并不是某道题其实只是心血来潮随便写的QwQ(2333我才不会说我想发二进制说说来装B) #include#include#include#includeusing namespace std;int primer(int a,int b)//快速幂将N进制转换成10进制 { int r=1,ba... 阅读全文
摘要:
思路:二分+位运算 #include#include#include#includeusing namespace std;int power(int a,int b){ int r=1,base=a;//r存结果,base存每一次运算的乘积 while(b!=0) { if (b&1) r... 阅读全文
摘要:
思路:只有在有序序列中才有效(原理的原因),思路就是不断缩小范围,算法复杂度为O(logn),是许多高效算法和数据结构的基础 #include#include#includeusing namespace std;int a[1001];int n;int binsearch (int g[]... 阅读全文