摘要:
1.飞机降落(经典dfs,遍历每一种情况,不符返回0,符合返回1,只要有一个返回值1就成立,记得每次都初始化一下标记数组) 查看代码 #include<bits/stdc++.h> #define int long long using namespace std; int n,T,b[15]; s 阅读全文
摘要:
1.H(简单模拟,注意细节) 1 #include<bits/stdc++.h> 2 #define int long long 3 using namespace std; 4 int er[30],q[1000000]; 5 bool cmd(char a,char b,char c) 6 { 阅读全文
摘要:
1.红石难题(将红石线路拉成一条一维的线,再用总线路除一个红石源可满足的能量需求范围,不够进一即可) #include<bits/stdc++.h> #define int long long using namespace std; int a[1000000],b[10000000]; sign 阅读全文
摘要:
1.B爱恨的纠葛(先将ab排序,再二分查找ab元素间差值最小的一对,再从a和c中找出对应下标(因为第二个数组不能动),再交换a的两个下标位置的值) 1 #include<bits/stdc++.h> 2 using namespace std; 3 int a[1000005]; 4 int b[1 阅读全文
摘要:
1.B - Jiubei and Overwatch(注意是范围伤害,只需要找出血量最大值就可以了) 1 #include<bits/stdc++.h> 2 using namespace std; 3 int a[10000]; 4 int main() 5 { 6 int m; 7 cin>>m 阅读全文
摘要:
1.D守恒(主要通过数份数来和n作比较,一定要特判1这个特殊情况) #include<bits/stdc++.h> using namespace std; long long t[1000000]; void solve() { int n; cin>>n; long long sum=0,ans 阅读全文