摘要: #include <iostream>#include <algorithm>#include <cstring>using namespace std;const int N=100010;int n,m;int f[N];int main(){ cin>>n>>m; f[0]=1; while( 阅读全文
posted @ 2022-04-12 17:58 小白QIU 阅读(286) 评论(1) 推荐(0)
摘要: #include <iostream>using namespace std;const int N=10010;int n,m;int v[N],w[N];int f[N][N];int main(){ cin>>n>>m; for(int i=1;i<=n;i++) cin>>v[i]>>w[i 阅读全文
posted @ 2022-04-12 16:41 小白QIU 阅读(10) 评论(1) 推荐(0)
摘要: #include <iostream>#include <cstring>#include <algorithm>using namespace std;const int N=10010;int n,m;int h[N],e[N],ne[N],idx;int q[N],d[N];void add( 阅读全文
posted @ 2022-04-04 13:18 小白QIU 阅读(25) 评论(1) 推荐(0)
摘要: #include <iostream>#include <cstring>#include <algorithm>using namespace std;const int N=10010;int n,m;int d[N],q[N];int h[N],e[N],ne[N],idx;void add( 阅读全文
posted @ 2022-04-04 12:21 小白QIU 阅读(29) 评论(1) 推荐(0)
摘要: #include <iostream>#include <algorithm>#include <cstring>using namespace std;typedef unsigned long long ULL;const int N=100010,P=131;//或p=13331 xmodQ 阅读全文
posted @ 2022-03-29 14:07 小白QIU 阅读(24) 评论(1) 推荐(0)
摘要: /*整型的每一种都分有无符号(unsigned)和有符号(signed)两种类型(float和double总是带符号的),在默认情况下声明的整型变量都是有符号的类型(char有点特别),如果需声明无符号类型的话就需要在类型前加上unsigned。无符号版本和有符号版本的区别就是无符号类型能保存2倍于 阅读全文
posted @ 2022-03-29 13:45 小白QIU 阅读(147) 评论(0) 推荐(0)
摘要: #include <iostream>#include <cstring>using namespace std;const int N=200003,null=0x3f3f3f3f;int h[N];int find(int x){ int k=(x%N+N)%N; while(h[k]!=nul 阅读全文
posted @ 2022-03-29 13:21 小白QIU 阅读(79) 评论(1) 推荐(0)
摘要: #include <iostream>#include <algorithm>#include <cstring>using namespace std;const int N=100003;int h[N],e[N],ne[N],idx;void insert(int x){ int k=(x%N 阅读全文
posted @ 2022-03-29 12:23 小白QIU 阅读(42) 评论(1) 推荐(0)
摘要: c语言strcmp函数用法为: 语法结构为:int strcmp(char *str1, char *str2); 比较字符串自str1和str2是否相同。如果相同则返回0; 如果不同,在不同的字符处如果str1的字符大于str2的字符,则返回1,否则返回-1 比如:char a[]="abcd"; 阅读全文
posted @ 2022-03-27 14:12 小白QIU 阅读(2657) 评论(0) 推荐(0)
摘要: #include <iostream>using namespace std;const int N=10010;int n,m;int p[N],size[N];int find(int x){ if(x!=p[x]) p[x]=find(p[x]); return p[x];}int main( 阅读全文
posted @ 2022-03-27 11:54 小白QIU 阅读(13) 评论(0) 推荐(0)