侧边栏
首页代码
摘要: #include<bits/stdc++.h> using namespace std; int dx[] = {0, 1, -1, 0}; int dy[] = {1, 0, 0, -1}; int a[100][100]; int n, m, ans; void dfs(int x, int y 阅读全文
posted @ 2020-12-03 20:39 AlexStraightUp 阅读(23) 评论(0) 推荐(0) 编辑
摘要: 有t个团队的人正在排一个长队。每次新来一个人时,如果他有队友在排队,那么这个 新人会插队到最后一个队友的身后。如果没有任何一个队友排队,则他会排到长队的队尾。 输入每个团队中所有队员的编号,要求支持如下3种指令(前两种指令可以穿插进 行)。 ENQUEUEx:编号为x的人进入长队。 DEQUEUE: 阅读全文
posted @ 2020-11-24 01:30 AlexStraightUp 阅读(28) 评论(0) 推荐(0) 编辑
摘要: #include<bits/stdc++.h> using namespace std; int fun(int n) { if(n <= 4) return n; else { return fun(n - 1)+fun(n - 3); } } int main() { int n; while( 阅读全文
posted @ 2020-11-13 21:28 AlexStraightUp 阅读(684) 评论(0) 推荐(0) 编辑
摘要: #include<bits/stdc++.h> using namespace std; int main() { int n; int a[100]; while(cin >> n) { double sum = 0; for(int i = 0;i < n;i++) { scanf("%d",& 阅读全文
posted @ 2020-11-12 21:39 AlexStraightUp 阅读(38) 评论(0) 推荐(0) 编辑
摘要: #include<bits/stdc++.h> using namespace std; pair<int,int> p[6]; int main() { while(1) { for(int i = 0;i < 6;i++) { if(!(cin >> p[i].first >> p[i].sec 阅读全文
posted @ 2020-11-04 10:00 AlexStraightUp 阅读(78) 评论(0) 推荐(0) 编辑
摘要: 简单模拟 这类题开头都要getchar()吸收回车 不然一开始输入的数字也被getline到s里 最后输出0了 (我也不知道为什么 #include<bits/stdc++.h> using namespace std; int main() { int sum = 0, a = 0,n; stri 阅读全文
posted @ 2020-10-30 21:10 AlexStraightUp 阅读(32) 评论(0) 推荐(0) 编辑
摘要: #include<bits/stdc++.h> using namespace std; int n,m,cnt = 0,a,b; char ch; int main(){ while(cin >> n >> m){ int h[10][10] = {0},v[10][10] = {0}; whil 阅读全文
posted @ 2020-10-28 23:03 AlexStraightUp 阅读(42) 评论(0) 推荐(0) 编辑
摘要: 从左到右有n个木块,编号为0~n-1,要求模拟以下4种操作(下面的a和b都是木块编 号)。move a onto b:把a和b上方的木块全部归位,然后把a摞在b上面。 move a over b:把a上方的木块全部归位,然后把a放在b所在木块堆的顶部。 pile a onto b:把b上方的木块全部 阅读全文
posted @ 2020-10-27 22:34 AlexStraightUp 阅读(57) 评论(0) 推荐(0) 编辑
摘要: 题目大意为输入N个数字 然后从中查找M个数字 找出从小到大排序后的数字中目标数字是第几个 #include<bits/stdc++.h> using namespace std; int a[10000000]; int main() { int n,m,c = 0; while((cin >> n 阅读全文
posted @ 2020-10-26 23:00 AlexStraightUp 阅读(66) 评论(1) 推荐(0) 编辑
摘要: #include<bits/stdc++.h> using namespace std; int a[25][25]; int main() { int n; scanf("%d",&n); int x,y,tot = 1; memset(a,0,sizeof(a)); a[x = 0][y = 0 阅读全文
posted @ 2020-10-26 19:14 AlexStraightUp 阅读(53) 评论(1) 推荐(0) 编辑
页脚HTML代码