10 2023 档案
第三章:列表
摘要:点击查看代码 # 列表 bicycles = ['trek', 'cannodale', 'redline', 'specialized'] print(bicycles) # 访问元素 print(bicycles[0].title()) # 第一个 print(bicycles[-1].titl
阅读全文
第二章:变量和简单的数据类型
摘要:点击查看代码 message='"Hellw world"' # 大小写转化 print(message.title()) print(message.lower()) print(message.upper()) first_name = "ruo" second_name = "ye" # f字
阅读全文
代码源:a-good string(CF1385D,分支)
摘要:传送 点击查看代码 #include<bits/stdc++.h> using namespace std; char s[131080]; int _solve(int L,int R,char x) { if(L==R) return s[L]!=x; int M=L+(R-L)/2; int
阅读全文
代码源:互不侵犯(SCOI,状压DP)
摘要:点击查看代码 #include<bits/stdc++.h> using namespace std; int n,m; long long f[10][1024][100]; int v[1024]; void init() { for(int i=1;i<1<<n;++i) { int c=0;
阅读全文
代码源:字典序枚举(位运算)
摘要:点击查看代码 #include<bits/stdc++.h> using namespace std; const int N=7e4,p=1e9+7; int f[N],c[100]; int nxt(int x) { int t=(x|(x-1))+1; int y=t|((t&-t)/(x&-
阅读全文
代码源:子集和I(位运算)
摘要:点击查看代码 #include<bits/stdc++.h> using namespace std; const int N=7e4,p=1e9+7; int f[N]; int main() { ios::sync_with_stdio(false); cin.tie(0); int n; ci
阅读全文
代码源:只出现一次的数(位运算)
摘要:点击查看代码 #include<bits/stdc++.h> using namespace std; int main() { ios::sync_with_stdio(false); cin.tie(0); int n; cin>>n; vector<int> a(n); int res=0;
阅读全文
代码源:CF 1355E(整数三分)
摘要:传送 点击查看代码 #include<bits/stdc++.h> using namespace std; typedef long long ll; int a[100010]; int n,A,R,M; ll f(int x) { ll y=0,z=0;//y表示需要增加的次数,z表示需要减少
阅读全文