ACwing
matt__
这个作者很懒,什么都没留下…
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
ACwing 24. 机器人的运动范围
class Solution { public: typedef pair<int,int>PII; int get_single_sum(int x) { int s=0; while(x)s+=x%10,x/=10;//求下标和 return s; } int get_sum(PII p) { ...翻译 2019-08-08 23:55:44 · 186 阅读 · 0 评论 -
ACwing 148. 合并果子
#include<iostream> #include<queue> #include<algorithm> #include<vector> using namespace std; int n; int main() { cin>>n; priority_queue<int,vector<int>,g...翻译 2019-08-09 10:29:18 · 197 阅读 · 0 评论 -
ACwing 146. 序列
#include<iostream> #include<vector> #include<queue> #include<algorithm> using namespace std; const int N=2010; int a[N],b[N],c[N]; int m,n; typedef pair<int,int> pii; ...翻译 2019-08-09 10:27:22 · 206 阅读 · 0 评论 -
ACwing 94. 递归实现排列型枚举
` #include<iostream> #include<vector> using namespace std; int n; vector<int>ans; vector<bool>rec; void dfs(int &&count) { if(ans.size()==n) { for(auto p:ans...翻译 2019-08-09 10:17:28 · 400 阅读 · 0 评论 -
ACwing 93. 递归实现组合型枚举
#include<iostream> #include<vector> using namespace std; int n,m; /*void dfs(int u,int sum,int state) { if(sum+n-u<m)return; if(sum==m) { for(int i=0;i<n;i++) ...翻译 2019-08-09 10:11:28 · 204 阅读 · 0 评论 -
ACwing 92. 递归实现指数型枚举(二进制与非二进制)
#include<iostream> #include<vector> using namespace std; int n; /*void dfs(int u,int state) { if(u==n) { for(int i=0;i<n;i++) if( state>>i & ...翻译 2019-08-09 10:08:12 · 333 阅读 · 0 评论 -
ACwing 95. 费解的开关
#include<iostream> #include<cstring> using namespace std; char f[10][10]; int dx[5]={0,-1,0,1,0},dy[5]={0,0,1,0,-1};//五个位置 const int N=10000000; void turn(int x,int y)//只要按下周围五个位置状...翻译 2019-08-09 10:02:11 · 282 阅读 · 0 评论 -
ACwing 90. 64位整数乘法
#include<iostream> using namespace std; int main() { long long a,b,p; cin>>a>>b>>p; long long res=0; while(b) { if(b&1)res=(res+a)%p;//提前%p把...翻译 2019-08-09 09:51:10 · 169 阅读 · 0 评论 -
ACwing 89. a^b
#include<iostream> #include<algorithm> #include<cmath> #include<vector> using namespace std; int main() { int a, b, p; cin >> a >> b >> p; i...翻译 2019-08-09 09:43:44 · 198 阅读 · 0 评论 -
ACwing 149. 荷马史诗
#include<iostream> #include<vector> #include<queue> using namespace std; typedef long long LL; typedef pair<LL,int>PLI;//权值和路径; int main() { int n,k; cin>>n>>...翻译 2019-08-09 10:31:21 · 284 阅读 · 0 评论
分享