上一页 1 2 3 4 5 6 7 ··· 10 下一页
摘要: #include <bits/stdc++.h> using namespace std; using ll = long long ; const int N = 35; int dp[N][10]; void init() { for(int i=0;i<=9;i++) if(i!=4) dp[ 阅读全文
posted @ 2021-06-23 10:35 Acception 阅读(23) 评论(0) 推荐(0)
摘要: #include <bits/stdc++.h> using namespace std; using ll = long long ; ll x,k,f[20],p[15]; void init(){ p[0]=1; for(int i=1;i<15;i++) p[i]=10ll*p[i-1]; 阅读全文
posted @ 2021-06-21 18:35 Acception 阅读(36) 评论(0) 推荐(0)
摘要: #include <bits/stdc++.h> using namespace std; #define rep(i,a,b) for(int i=a;i<b;i++) #define all(x) x.begin(),x.end() #define pb(x) push_back(x) #def 阅读全文
posted @ 2021-06-19 12:14 Acception 阅读(45) 评论(0) 推荐(0)
摘要: __builtin_popcount __builtin_popcountll 该函数的主要作用是计算一个数字的二进制中有多少个1,返回值就是其中1的个数。 它使用一张基于表的方法来进行位搜索,因此这个操作的执行效率很高 阅读全文
posted @ 2021-06-19 11:44 Acception 阅读(145) 评论(0) 推荐(0)
摘要: https://ac.nowcoder.com/acm/contest/11212/E #include<bits/stdc++.h> using namespace std; // define a point class to store a point class Point { public 阅读全文
posted @ 2021-06-18 22:11 Acception 阅读(100) 评论(0) 推荐(0)
摘要: string s; cin>>s; if(s.find("123")!=s.npos); npos在 c++中表示一个常数,表示不存在的位置,类型一般是std::container_type::size_type。其值一般为-1. 阅读全文
posted @ 2021-06-18 22:09 Acception 阅读(53) 评论(0) 推荐(0)
摘要: 定义: mex(minimal excludant)运算,这是施加于一个集合的运算,表示最小的不属于这个集合的非负整数。例如mex{0,1,2,4}=3、mex{1,3,5}=0、mex{}=0。 设SG(x) = { SG(a),SG(b),SG(c) }; 设集合S = { SG(a),SG(b 阅读全文
posted @ 2021-06-15 21:03 Acception 阅读(559) 评论(0) 推荐(0)
摘要: ios::cin.sync() ///清空缓冲区 ios::cin.rdstate() ///0表示正常输入数据类型,4表示发生错误 #include <iostream> int main() { int x; std::cin>>x;//1 2 std::cin.sync(); int y; s 阅读全文
posted @ 2021-06-15 17:33 Acception 阅读(71) 评论(0) 推荐(0)
摘要: #include <bits/stdc++.h> using namespace std; using ll = long long ; ll solve(int n){ ll ans=0; for(int i=1;i<=10;i++) ans+=n/(int)(pow(10,i-1)); retu 阅读全文
posted @ 2021-06-11 12:46 Acception 阅读(29) 评论(0) 推荐(0)
摘要: 暴力枚举所有状态 先将第一行都变成1 再将中间三行编程1 判断最后一行是不是全是1 记录答案存最小步数 #include <bits/stdc++.h> using namespace std; using ll = long long ; int dx[]={1,-1,0,0,0}; int dy 阅读全文
posted @ 2021-06-06 21:00 Acception 阅读(36) 评论(0) 推荐(0)
上一页 1 2 3 4 5 6 7 ··· 10 下一页