编写题解 1089: A+B for Input-Output Practice (V) 摘要:解题思路:定义三个变量来保存数据注意事项:参考代码:#include<bits/stdc++.h>//c++万能头文件using namespace std;int main(){ int n; in…… 题解列表 2022年07月17日 0 点赞 0 评论 495 浏览 评分:0.0
优质题解 1796: 蛇形填数(dfs) 解题思路:很久之前就看见这道题了,但是因为感觉模拟起来太复杂所以没有做,今天突然想到dfs寻路可能可以解这道题,就尝试了一下dfs做法。如上图所示,如果从右上角开始的话,优先级一定是先向下搜索,然后再向左搜索,向上,最后向右搜索。也就是说,我们让搜索的优先级下>左>上>右就可以了。 题解列表 2022年07月17日 0 点赞 0 评论 1532 浏览 评分:10.0
answer question 解题思路:anwerthewholequestionisanswerlikeusualpersnalymyownopinionistocaoculatetheselutionwehaveandunsulveit!注意事项:参考代码: 题解列表 2022年07月16日 0 点赞 1 评论 370 浏览 评分:7.3
信息学奥赛一本通T1430-家庭作业-题解(C++代码) ```cpp#include#include#includeusingnamespacestd;intmain(){ios::sync_with_stdio(false);intn;cin>>n;mapm;for(intx,y;n--;m[x].push_back(y))cin>>x>>y;prior 题解列表 2022年07月15日 1 点赞 0 评论 1606 浏览 评分:0.0
1553----笨小猴(适用于所有笨小猴)暴力遍历c++代码 摘要:解题思路:用for来回遍历数组模拟注意事项:多个for循环一步一步理清楚步骤,可能有些许繁琐,但最暴力。参考代码:#include<bits/stdc++.h> using namespace st…… 题解列表 2022年07月14日 0 点赞 0 评论 1354 浏览 评分:7.3
#C++1165——明明的随机数(set容器) ```cpp#include#include#include#includeusingnamespacestd;intmain(){intm;cin>>m;int*arr=newint[m];setbrr;//set容器,自动排序,去重//srand(time(NULL));//产生随机数种子for( 题解列表 2022年07月14日 0 点赞 0 评论 714 浏览 评分:0.0
#C++1162——密码(gets与cin,scanf混合使用会无法正常执行) 摘要:#include#include using namespace std; int a,b,c,d; bool check(char p)//对四种情况进行判断,并标记为1 { if(…… 题解列表 2022年07月14日 0 点赞 0 评论 799 浏览 评分:0.0
The 3n + 1 problem (c++) 摘要:解题思路:真的是又长又臭参考代码:#include<iostream>using namespace std;int main(){ long long count = 1; long l…… 题解列表 2022年07月14日 0 点赞 0 评论 412 浏览 评分:9.9
2177: 信息学奥赛一本通T1252-走迷宫(bfs模板) 摘要:解题思路:可以把bfs当成扩散问题,如果下一步可以走,就向下一步扩散,直到遇见终点,停止循环。参考代码:#include <bits/stdc++.h> #include <queue> usin…… 题解列表 2022年07月14日 0 点赞 0 评论 1042 浏览 评分:9.9
信息学奥赛一本通T1549-最大数-题解(C++代码) ```cpp#include#include#includeusingnamespacestd;intmain(){charc;vectorv;mapm;intn,p,t,a=0;scanf("%d%d",&n,&p);while(n--){scanf("\n%c%d", 题解列表 2022年07月13日 1 点赞 0 评论 1048 浏览 评分:9.0