102 条题解
-
-2
#include<bits/stdc++.h> using namespace std; char a[200]; int main(){ int len,lenmax=0,t=0,end=0,k=0;//len:a的长;lenmax:最长单词长;t:当前单词长;end:词的结束索引 ;k:词的开始索引 gets(a);//输入字符数组a len = strlen(a);//获取a的长 for(int i=0;i<len;i++){//遍历a数组 if(a[i]!=' ' && a[i]!='.'){//如果不是空格或句号 t++;//那么当前单词长++ } else{//如果是空格或句号 if(t>lenmax){//判断当前单词长 > 最长单词长 lenmax = t;//将当前单词长赋值给最长单词长 k = i-t;//记录下该单词的起始位置 end=i-1; } t=0; } } for(int i=k;i<=end;i++){ cout<<a[i]; } cout<<" "<<lenmax; return 0; }
-
-2
# 比赛 1. **4** **2023-2** # [图论测试](http://219.153.61.2:20004/contest/63db2d0d35180016154171f3) * [IOI](http://219.153.61.2:20004/contest?rule=ioi) * Rated * 3.5 小时 * 15 1. **18** **2023-1** # [2023小学生邀请赛](http://219.153.61.2:20004/contest/63c5f79e1f47891a1a8f48e6) * [IOI](http://219.153.61.2:20004/contest?rule=ioi) * Rated * 3 小时 * 27 1. **18** **2023-1** # [phdhd的地狱邀请赛](http://219.153.61.2:20004/contest/63c52fc51f47891a1a8f465a) * [IOI](http://219.153.61.2:20004/contest?rule=ioi) * Rated * 4.2 小时 * 24 1. **24** **2022-12** # [树(2022年12月24日)](http://219.153.61.2:20004/contest/63a3f7b8286d4494ba8d73f6) * [IOI](http://219.153.61.2:20004/contest?rule=ioi) * Rated * 4 小时 * 12 1. **18** **2022-7** # [暑期汪老师班(18日上午)](http://219.153.61.2:20004/contest/62d35a815358837861a03636) * [ACM/ICPC](http://219.153.61.2:20004/contest?rule=acm) * Rated * 3 小时 * 6 [更多 >](http://219.153.61.2:20004/contest) # 作业 1. **5** **2023-4** # [深搜作业](http://219.153.61.2:20004/homework/6422934cac600753985e12d0) * 状态: 正在进行… * 开始时间: **21 年后** * 截止时间: **21 年后** 1. **5** **2023-4** # [矩阵作业](http://219.153.61.2:20004/homework/64229ccaac600753985e12e1) * 状态: 正在进行… * 开始时间: **21 年后** * 截止时间: **21 年后** 1. **26** **2023-3** # [3月18日冉老师布置作业](http://219.153.61.2:20004/homework/64157c6cac600753985d73b1) * 状态: 已结束 * 开始时间: **21 年后** * 最终截止时间: **21 年后** 1. **24** **2023-3** # [队列](http://219.153.61.2:20004/homework/6412f60673933e13205d347d) * 状态: 已结束 * 开始时间: **21 年后** * 最终截止时间: **21 年后** 1. **12** **2023-3** # [GCD与LCM](http://219.153.61.2:20004/homework/6402a05a24ef8ca4e1fdce37) * 状态: 已结束 * 开始时间: **21 年后** * 最终截止时间: **21 年后** 1. **6** **2023-3** # [质数作业2](http://219.153.61.2:20004/homework/63fb23dafe582d833fbf332f) * 状态: 已结束 * 开始时间: **21 年后** * 最终截止时间: **21 年后** 1. **6** **2023-3** # [质数作业1](http://219.153.61.2:20004/homework/63fb23a0fe582d833fbf332c) * 状态: 已结束 * 开始时间: **21 年后** * 最终截止时间: **21 年后** 1. **5** **2023-3** # [排序作业](http://219.153.61.2:20004/homework/63f973e2fe582d833fbf2114) * 状态: 已结束 * 开始时间: **21 年后** * 最终截止时间: **21 年后** 1. **28** **2023-2** # [线段树](http://219.153.61.2:20004/homework/63f24eb1fe582d833fbee370) * 状态: 已结束 * 开始时间: **21 年后** * 最终截止时间: **21 年后** 1. **26** **2023-2** # [字符数组2](http://219.153.61.2:20004/homework/63f048c2fe582d833fbeba96) * 状态: 已结束 * 开始时间: **21 年后** * 最终截止时间: **21 年后** [更多 >](http://219.153.61.2:20004/homework) # Ranking | 排名 | 用户名 | RP | 个人简介 | | - | - | - | - | | ------------------------------ | | 1 | ![](http://q1.qlogo.cn/g?b=qq&nk=1950874978&s=160) [文彦博 (13368253581)](http://219.153.61.2:20004/user/135) | 316 | 女人只会影响我拔刀的速度!😄 ![image](/file/135/lsqAf9sZw5ARksLgJm3cz.jpeg... | | ---- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----- | ---------------------------------------------------------------------------------------------------------------------------------- | | 2 | ![](http://q1.qlogo.cn/g?b=qq&nk=372163040&s=160) [王沛鑫 (202530384)](http://219.153.61.2:20004/user/146) | 314 | 不恋尘世浮华,不写红尘纷扰,不叹世道苍凉,不惹情思哀怨。闲看花开,静待花落,冷暖自知,干净如始。 | | 3 | ![](http://q1.qlogo.cn/g?b=qq&nk=14112085&s=160) [admin ](http://219.153.61.2:20004/user/2)SU | 308 | | | 4 | ![](http://cn.gravatar.com/avatar/d41d8cd98f00b204e9800998ecf8427e?d=mm&s=64) [unknown (202522184)](http://219.153.61.2:20004/user/191) | 278 | `该用户太懒,这里啥也没写´ (・ω・)`![image](/file/191/FXBKve7CEc9F6zyhqg-ii.pn... | | 5 | ![](http://cn.gravatar.com/avatar/d41d8cd98f00b204e9800998ecf8427e?d=mm&s=64) [Иосиф Виссарионович Сталин (202522249)](http://219.153.61.2:20004/user/192) | 272 | ![]([http://219.153.61.2:20004/file/135/rzhmGkVXODiY4MLwywUck.gif](http://219.153.61.2:20004/file/135/rzhmGkVXODiY4MLwywUck.gif)... | | 6 | ![](http://cn.gravatar.com/avatar/d41d8cd98f00b204e9800998ecf8427e?d=mm&s=64) [FlyingPig278 ( G2025 杨双源 ) (202530439)](http://219.153.61.2:20004/user/148) | 270 | I'd rather believe l'm a muggle than that there's no magic in th... | | 7 | ![](http://cn.gravatar.com/avatar/d0a2f1de8d06b80f735f61f21871b0fc?d=mm&s=64) [童韵凝 (August)](http://219.153.61.2:20004/user/41) | 265 | | | 8 | ![](http://cn.gravatar.com/avatar/8938580e15acd07a8b23aaceb38bf8d0?d=mm&s=64) [宗琦瀚 (13022338777)](http://219.153.61.2:20004/user/137) | 263 | # **A生B,B生C,C生C++,C++生万物。** ~调皮~ --- 好了书归正传: #####... | | 9 | ![](https://cc.163.com/586568/) [陈骢玮 (13436086078)](http://219.153.61.2:20004/user/162) | 259 | 死亡不是结束,而是另一种开始。 Administrator [[誓死坚守游戏下载\_Until We Die中文版下载[... | | 10 | ![](http://cn.gravatar.com/avatar/d41d8cd98f00b204e9800998ecf8427e?d=mm&s=64) [丁宇平 (18623340398)](http://219.153.61.2:20004/user/94) | 255 | 3.2我是一刻也呆不下去了 ![image](http://219.153.61.2:20004/file/94/kmqyM-bVTmiixmp11tOcD.jpeg) ... | [更多 >](http://219.153.61.2:20004/ranking) # 一言 探索自己独一无二的世界,挺过黑夜,并创建您能想象的一切! # 推荐 * ## 中文 1. [LibreOJ](https://loj.ac/) 1. [洛谷](https://www.luogu.com.cn/) 1. [UOJ](https://uoj.ac/) 1. [CometOJ](https://www.cometoj.com/) 1. [Vijos](https://vijos.org/) * ## English 1. [Codeforces](https://codeforces.com/) 1. [AtCoder](https://atcoder.jp/) 1. [CodeChef](https://www.codechef.com/) 1. [SPOJ](https://www.spoj.com/) 1. [TopCoder](https://www.topcoder.com/) 1. [OnlineJudge](https://onlinejudge.org/) * ## 工具 1. [OIerDb](https://oier.baoshuo.dev/) # 状态 * [评测队列](http://219.153.61.2:20004/record) * [服务状态](http://219.153.61.2:20004/status) # 开发 * [开源](https://github.com/hydro-dev/Hydro) * [API](http://219.153.61.2:20004/api) # 支持 * [帮助](http://219.153.61.2:20004/wiki/help) * [QQ 群](http://219.153.61.2:20004/wiki/about#contact) 1. [关于](http://219.153.61.2:20004/wiki/about) 1. [联系我们](http://219.153.61.2:20004/wiki/about#contact) 1. [隐私](http://219.153.61.2:20004/wiki/about#privacy) 1. [服务条款](http://219.153.61.2:20004/wiki/about#tos) 1. [版权申诉](https://hydro.js.org/#%E8%81%94%E7%B3%BB%E6%88%91%E4%BB%AC) 1. Language 1. [Legacy mode](http://219.153.61.2:20004/legacy?legacy=true) 1. 主题 1. 1. 1. Worker 0 in 40ms 1. Powered by [Hydro v4.9.7](https://hydro.js.org/) Community
-
-2
using namespace std; const int N=1000; int n,s; double dp[N+5][N+5]; double dfs(int i,int j){ if(i==n&&j==s) return 0; if(dp[i][j]!=0) return dp[i][j]; dp[i][j]=1; if(i+1<=n) dp[i][j]+=dfs(i+1,j)*(n-i)*1.0*j/(n*s); if(j+1<=s) dp[i][j]+=dfs(i,j+1)*i*(s-j)/(1.0*n*s); if(i+1<=n&&j+1<=s) dp[i][j]+=dfs(i+1,j+1)*(n-i)*1.0*(s-j)/(n*s); dp[i][j]/=(1.0-i*j*1.0/(n*s)); return dp[i][j]; } int main(){ scanf("%d%d",&n,&s); printf("%.4lf\n",dfs(0,0)); return 0; }
-
-2
贴下高精度
#include<bits/stdc++.h> using namespace std; int myCompare(string a,string b) { if(a.size()!=b.size()) { if(a.size()>b.size()) return 1; else return -1; } else { if(a>b) return 1; else if(a==b) return 0; else return -1; } } string myAdd(string a,string b) { int n=max(a.size(),b.size())+1; vector<int>ans(n,0); int i=a.size()-1,j=b.size()-1,k=n-1; while(i>=0&&j>=0) { ans[k--]=(a[i--]-'0')+(b[j--]-'0'); } while(j>=0) { ans[k--]=(b[j--]-'0'); } while(i>=0) { ans[k--]=(a[i--]-'0'); } string c=""; for(int i=n-1;i>0;i--) { if(ans[i]>=10) { ans[i]-=10; ans[i-1]++; } c.insert(0,1,ans[i]+'0'); } if(ans[0]>0) { c.insert(0,1,ans[0]+'0'); } return c; } int main(){ string a,b; cin>>a>>b; cout<<myAdd(a,b); return 0; }
-
-2
[ ] 54 道题
- 1
状态 题目显示标签 AC / 尝试 难度[](javascript:;) -------------------------------------------------------- - 1
[ 进入编辑模式](javascript:;)
分类
根据当前过滤条件随机选择一道题
状态
开发
支持
-
Language
-
主题
-
Worker 0 in 23ms
-
Powered by Hydro v4.7.2 Community
-
-2
[ ] 54 道题
- 1
状态 题目显示标签 AC / 尝试 难度[](javascript:;) -------------------------------------------------------- - 1
分类
根据当前过滤条件随机选择一道题
状态
开发
支持
- 关于
- 联系我们
- 隐私
- 服务条款
- 版权申诉
- Language
- Legacy mode
- 主题
- Worker 0 in 23ms
- Powered by Hydro v4.7.2 Community
-
-2
1. [![](http://219.153.61.2:20004/components/navigation/nav-logo-small_dark.png)](http://219.153.61.2:20004/) 1. [首页](http://219.153.61.2:20004/) 1. [题库](http://219.153.61.2:20004/p) 1. [训练](http://219.153.61.2:20004/training) 1. [比赛](http://219.153.61.2:20004/contest) 1. [作业](http://219.153.61.2:20004/homework) 1. [评测记录](http://219.153.61.2:20004/record?uidOrName=192) 1. [排名](http://219.153.61.2:20004/ranking) 1. [202522249 ](http://219.153.61.2:20004/user/192) [ ] 54 道题 * **1** | 状态 | 题目**显示标签** | AC / 尝试 | 难度[](javascript:;) | | - | - | - | - | | -------------------------------------------------------- | | [100 Accepted](http://219.153.61.2:20004/record/636cde756248fb90a93b86c3) | [**P7**【入门】鸡兔同笼问题](http://219.153.61.2:20004/p/7)* [需要找规律的循环](http://219.153.61.2:20004/p?q=category%3A%E9%9C%80%E8%A6%81%E6%89%BE%E8%A7%84%E5%BE%8B%E7%9A%84%E5%BE%AA%E7%8E%AF) | 43 / 100 | 4 | | --------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ---------- | ------ | | [100 Accepted](http://219.153.61.2:20004/record/636cde8e6248fb90a93b86d1) | [**P8**【入门】买小猫小狗](http://219.153.61.2:20004/p/8)* [需要找规律的循环](http://219.153.61.2:20004/p?q=category%3A%E9%9C%80%E8%A6%81%E6%89%BE%E8%A7%84%E5%BE%8B%E7%9A%84%E5%BE%AA%E7%8E%AF) | 27 / 51 | 3 | | [100 Accepted](http://219.153.61.2:20004/record/636ce3b66248fb90a93b87a9) | [**P15**【入门】百钱百鸡问题](http://219.153.61.2:20004/p/15)* [需要找规律的循环](http://219.153.61.2:20004/p?q=category%3A%E9%9C%80%E8%A6%81%E6%89%BE%E8%A7%84%E5%BE%8B%E7%9A%84%E5%BE%AA%E7%8E%AF) | 40 / 147 | 6 | | [100 Accepted](http://219.153.61.2:20004/record/6370ea546248fb90a93bde04) | [**P17**【入门】购买文具](http://219.153.61.2:20004/p/17)* [需要找规律的循环](http://219.153.61.2:20004/p?q=category%3A%E9%9C%80%E8%A6%81%E6%89%BE%E8%A7%84%E5%BE%8B%E7%9A%84%E5%BE%AA%E7%8E%AF) | 16 / 25 | 4 | | [100 Accepted](http://219.153.61.2:20004/record/6370ebbb6248fb90a93bde39) | [**P18**【入门】兑换硬币](http://219.153.61.2:20004/p/18)* [需要找规律的循环](http://219.153.61.2:20004/p?q=category%3A%E9%9C%80%E8%A6%81%E6%89%BE%E8%A7%84%E5%BE%8B%E7%9A%84%E5%BE%AA%E7%8E%AF) | 20 / 59 | 6 | | [100 Accepted](http://219.153.61.2:20004/record/6374862d6248fb90a93c3006) | [**P75**【基础】小青蛙回来了](http://219.153.61.2:20004/p/75)* [需要找规律的循环](http://219.153.61.2:20004/p?q=category%3A%E9%9C%80%E8%A6%81%E6%89%BE%E8%A7%84%E5%BE%8B%E7%9A%84%E5%BE%AA%E7%8E%AF) | 15 / 26 | 5 | | [100 Accepted](http://219.153.61.2:20004/record/6374873d6248fb90a93c30a6) | [**P76**【基础】寻找2的幂](http://219.153.61.2:20004/p/76)* [需要找规律的循环](http://219.153.61.2:20004/p?q=category%3A%E9%9C%80%E8%A6%81%E6%89%BE%E8%A7%84%E5%BE%8B%E7%9A%84%E5%BE%AA%E7%8E%AF) | 12 / 17 | 6 | | [100 Accepted](http://219.153.61.2:20004/record/637487736248fb90a93c30ca) | [**P77**【入门】桐桐的计算](http://219.153.61.2:20004/p/77)* [需要找规律的循环](http://219.153.61.2:20004/p?q=category%3A%E9%9C%80%E8%A6%81%E6%89%BE%E8%A7%84%E5%BE%8B%E7%9A%84%E5%BE%AA%E7%8E%AF) | 8 / 20 | 7 | | [100 Accepted](http://219.153.61.2:20004/record/637488036248fb90a93c30f2) | [**P78**【入门】桐桐去购物](http://219.153.61.2:20004/p/78)* [需要找规律的循环](http://219.153.61.2:20004/p?q=category%3A%E9%9C%80%E8%A6%81%E6%89%BE%E8%A7%84%E5%BE%8B%E7%9A%84%E5%BE%AA%E7%8E%AF) | 6 / 21 | 8 | | [100 Accepted](http://219.153.61.2:20004/record/637489056248fb90a93c317b) | [**P79**【入门】求恰好使s=1+1/2+1/3+…+1/n的值大于X时n的值。](http://219.153.61.2:20004/p/79)* [需要找规律的循环](http://219.153.61.2:20004/p?q=category%3A%E9%9C%80%E8%A6%81%E6%89%BE%E8%A7%84%E5%BE%8B%E7%9A%84%E5%BE%AA%E7%8E%AF) | 9 / 10 | 9 | | [100 Accepted](http://219.153.61.2:20004/record/63748ce36248fb90a93c31a1) | [**P80**【基础】三角形的个数](http://219.153.61.2:20004/p/80)* [需要找规律的循环](http://219.153.61.2:20004/p?q=category%3A%E9%9C%80%E8%A6%81%E6%89%BE%E8%A7%84%E5%BE%8B%E7%9A%84%E5%BE%AA%E7%8E%AF) | 8 / 16 | 8 | | [100 Accepted](http://219.153.61.2:20004/record/63748d1c6248fb90a93c31bc) | [**P82**【入门】时间转换](http://219.153.61.2:20004/p/82)* [需要找规律的循环](http://219.153.61.2:20004/p?q=category%3A%E9%9C%80%E8%A6%81%E6%89%BE%E8%A7%84%E5%BE%8B%E7%9A%84%E5%BE%AA%E7%8E%AF) | 9 / 19 | 7 | | [100 Accepted](http://219.153.61.2:20004/record/63748d406248fb90a93c31c9) | [**P83**【入门】猴子吃桃子](http://219.153.61.2:20004/p/83)* [需要找规律的循环](http://219.153.61.2:20004/p?q=category%3A%E9%9C%80%E8%A6%81%E6%89%BE%E8%A7%84%E5%BE%8B%E7%9A%84%E5%BE%AA%E7%8E%AF) | 32 / 90 | 5 | | [100 Accepted](http://219.153.61.2:20004/record/63748e116248fb90a93c31d5) | [**P84**【基础】回文数](http://219.153.61.2:20004/p/84)* [需要找规律的循环](http://219.153.61.2:20004/p?q=category%3A%E9%9C%80%E8%A6%81%E6%89%BE%E8%A7%84%E5%BE%8B%E7%9A%84%E5%BE%AA%E7%8E%AF) | 9 / 16 | 7 | | [100 Accepted](http://219.153.61.2:20004/record/63749bdc6248fb90a93c3360) | [**P85**【入门】因子求和](http://219.153.61.2:20004/p/85)* [需要找规律的循环](http://219.153.61.2:20004/p?q=category%3A%E9%9C%80%E8%A6%81%E6%89%BE%E8%A7%84%E5%BE%8B%E7%9A%84%E5%BE%AA%E7%8E%AF) | 5 / 18 | 8 | | [100 Accepted](http://219.153.61.2:20004/record/63749c216248fb90a93c336f) | [**P86**【入门】寻找雷劈数](http://219.153.61.2:20004/p/86)* [需要找规律的循环](http://219.153.61.2:20004/p?q=category%3A%E9%9C%80%E8%A6%81%E6%89%BE%E8%A7%84%E5%BE%8B%E7%9A%84%E5%BE%AA%E7%8E%AF) | 6 / 12 | 9 | | [100 Accepted](http://219.153.61.2:20004/record/63749c3f6248fb90a93c337b) | [**P87**【入门】姐妹数对](http://219.153.61.2:20004/p/87)* [需要找规律的循环](http://219.153.61.2:20004/p?q=category%3A%E9%9C%80%E8%A6%81%E6%89%BE%E8%A7%84%E5%BE%8B%E7%9A%84%E5%BE%AA%E7%8E%AF) | 6 / 8 | 9 | | [100 Accepted](http://219.153.61.2:20004/record/63749cf56248fb90a93c3387) | [**P88**【入门】两个自然数M和N的最小公倍数。](http://219.153.61.2:20004/p/88)* [需要找规律的循环](http://219.153.61.2:20004/p?q=category%3A%E9%9C%80%E8%A6%81%E6%89%BE%E8%A7%84%E5%BE%8B%E7%9A%84%E5%BE%AA%E7%8E%AF) | 11 / 15 | 6 | | [100 Accepted](http://219.153.61.2:20004/record/63749e566248fb90a93c33a8) | [**P89**【入门】求两个自然数M和N的最大公约数](http://219.153.61.2:20004/p/89)* [需要找规律的循环](http://219.153.61.2:20004/p?q=category%3A%E9%9C%80%E8%A6%81%E6%89%BE%E8%A7%84%E5%BE%8B%E7%9A%84%E5%BE%AA%E7%8E%AF) | 14 / 16 | 6 | | [100 Accepted](http://219.153.61.2:20004/record/63749f3d6248fb90a93c33b6) | [**P90**【入门】找数游戏](http://219.153.61.2:20004/p/90)* [需要找规律的循环](http://219.153.61.2:20004/p?q=category%3A%E9%9C%80%E8%A6%81%E6%89%BE%E8%A7%84%E5%BE%8B%E7%9A%84%E5%BE%AA%E7%8E%AF) | 4 / 11 | 9 | | [100 Accepted](http://219.153.61.2:20004/record/63749f946248fb90a93c33c2) | [**P91**【入门】同因查找](http://219.153.61.2:20004/p/91)* [需要找规律的循环](http://219.153.61.2:20004/p?q=category%3A%E9%9C%80%E8%A6%81%E6%89%BE%E8%A7%84%E5%BE%8B%E7%9A%84%E5%BE%AA%E7%8E%AF) | 7 / 8 | 9 | | [0 Format Error](http://219.153.61.2:20004/record/6374a0b36248fb90a93c33d0) | [**P92**【入门】奇数及偶数和](http://219.153.61.2:20004/p/92)* [需要找规律的循环](http://219.153.61.2:20004/p?q=category%3A%E9%9C%80%E8%A6%81%E6%89%BE%E8%A7%84%E5%BE%8B%E7%9A%84%E5%BE%AA%E7%8E%AF) | 0 / 8 | 10 | | [100 Accepted](http://219.153.61.2:20004/record/6374a31a6248fb90a93c33eb) | [**P93**【入门】aabb](http://219.153.61.2:20004/p/93)* [需要找规律的循环](http://219.153.61.2:20004/p?q=category%3A%E9%9C%80%E8%A6%81%E6%89%BE%E8%A7%84%E5%BE%8B%E7%9A%84%E5%BE%AA%E7%8E%AF) | 14 / 22 | 5 | | [100 Accepted](http://219.153.61.2:20004/record/637588826248fb90a93c40e2) | [**P121**【基础】“倒”数](http://219.153.61.2:20004/p/121)* [需要找规律的循环](http://219.153.61.2:20004/p?q=category%3A%E9%9C%80%E8%A6%81%E6%89%BE%E8%A7%84%E5%BE%8B%E7%9A%84%E5%BE%AA%E7%8E%AF) | 47 / 240 | 7 | | [100 Accepted](http://219.153.61.2:20004/record/638576e16248fb90a93d791b) | [**P220**【入门】买糕点](http://219.153.61.2:20004/p/220)* [需要找规律的循环](http://219.153.61.2:20004/p?q=category%3A%E9%9C%80%E8%A6%81%E6%89%BE%E8%A7%84%E5%BE%8B%E7%9A%84%E5%BE%AA%E7%8E%AF) | 2 / 2 | 10 | | [100 Accepted](http://219.153.61.2:20004/record/638577136248fb90a93d7927) | [**P227**【入门】阿凡提的难题](http://219.153.61.2:20004/p/227)* [需要找规律的循环](http://219.153.61.2:20004/p?q=category%3A%E9%9C%80%E8%A6%81%E6%89%BE%E8%A7%84%E5%BE%8B%E7%9A%84%E5%BE%AA%E7%8E%AF) | 3 / 6 | 10 | | [100 Accepted](http://219.153.61.2:20004/record/635cdfc26248fb90a939b599) | [**P241**【入门】角谷猜想](http://219.153.61.2:20004/p/241)* [需要找规律的循环](http://219.153.61.2:20004/p?q=category%3A%E9%9C%80%E8%A6%81%E6%89%BE%E8%A7%84%E5%BE%8B%E7%9A%84%E5%BE%AA%E7%8E%AF) | 5 / 24 | 8 | | [100 Accepted](http://219.153.61.2:20004/record/6397c2fd6248fb90a93eb064) | [**P248**【入门】求数列的第n项的值是多少?](http://219.153.61.2:20004/p/248)* [需要找规律的循环](http://219.153.61.2:20004/p?q=category%3A%E9%9C%80%E8%A6%81%E6%89%BE%E8%A7%84%E5%BE%8B%E7%9A%84%E5%BE%AA%E7%8E%AF) | 2 / 2 | 10 | | [100 Accepted](http://219.153.61.2:20004/record/6397c32b6248fb90a93eb070) | [**P249**【入门】搬砖问题](http://219.153.61.2:20004/p/249)* [需要找规律的循环](http://219.153.61.2:20004/p?q=category%3A%E9%9C%80%E8%A6%81%E6%89%BE%E8%A7%84%E5%BE%8B%E7%9A%84%E5%BE%AA%E7%8E%AF) | 3 / 11 | 9 | | [100 Accepted](http://219.153.61.2:20004/record/6397c4cc6248fb90a93eb07d) | [**P250**【入门】马克思手稿的问题](http://219.153.61.2:20004/p/250)* [需要找规律的循环](http://219.153.61.2:20004/p?q=category%3A%E9%9C%80%E8%A6%81%E6%89%BE%E8%A7%84%E5%BE%8B%E7%9A%84%E5%BE%AA%E7%8E%AF) | 3 / 7 | 10 | | | [**P261**【入门】该存多少钱](http://219.153.61.2:20004/p/261)* [需要找规律的循环](http://219.153.61.2:20004/p?q=category%3A%E9%9C%80%E8%A6%81%E6%89%BE%E8%A7%84%E5%BE%8B%E7%9A%84%E5%BE%AA%E7%8E%AF) | 0 / 3 | 10 | | | [**P310**【基础】第n盆花是什么颜色?](http://219.153.61.2:20004/p/310)* [需要找规律的循环](http://219.153.61.2:20004/p?q=category%3A%E9%9C%80%E8%A6%81%E6%89%BE%E8%A7%84%E5%BE%8B%E7%9A%84%E5%BE%AA%E7%8E%AF) | 14 / 112 | 8 | | | [**P315**【入门】队形数量求解](http://219.153.61.2:20004/p/315)* [需要找规律的循环](http://219.153.61.2:20004/p?q=category%3A%E9%9C%80%E8%A6%81%E6%89%BE%E8%A7%84%E5%BE%8B%E7%9A%84%E5%BE%AA%E7%8E%AF) | 2 / 4 | 10 | | | [**P329**【入门】需要举办多少场足球赛?](http://219.153.61.2:20004/p/329)* [需要找规律的循环](http://219.153.61.2:20004/p?q=category%3A%E9%9C%80%E8%A6%81%E6%89%BE%E8%A7%84%E5%BE%8B%E7%9A%84%E5%BE%AA%E7%8E%AF) | 4 / 6 | 10 | | | [**P339**【入门】怎样种树?](http://219.153.61.2:20004/p/339)* [需要找规律的循环](http://219.153.61.2:20004/p?q=category%3A%E9%9C%80%E8%A6%81%E6%89%BE%E8%A7%84%E5%BE%8B%E7%9A%84%E5%BE%AA%E7%8E%AF) | 1 / 1 | 10 | | | [**P346**【入门】植树的人数](http://219.153.61.2:20004/p/346)* [需要找规律的循环](http://219.153.61.2:20004/p?q=category%3A%E9%9C%80%E8%A6%81%E6%89%BE%E8%A7%84%E5%BE%8B%E7%9A%84%E5%BE%AA%E7%8E%AF) | 5 / 10 | 9 | | | [**P347**【入门】纸盒的最大体积是多少?](http://219.153.61.2:20004/p/347)* [需要找规律的循环](http://219.153.61.2:20004/p?q=category%3A%E9%9C%80%E8%A6%81%E6%89%BE%E8%A7%84%E5%BE%8B%E7%9A%84%E5%BE%AA%E7%8E%AF) | 2 / 4 | 10 | | | [**P348**【入门】买公园门票](http://219.153.61.2:20004/p/348)* [需要找规律的循环](http://219.153.61.2:20004/p?q=category%3A%E9%9C%80%E8%A6%81%E6%89%BE%E8%A7%84%E5%BE%8B%E7%9A%84%E5%BE%AA%E7%8E%AF) | 1 / 1 | 10 | | | [**P349**【入门】费马定理](http://219.153.61.2:20004/p/349)* [需要找规律的循环](http://219.153.61.2:20004/p?q=category%3A%E9%9C%80%E8%A6%81%E6%89%BE%E8%A7%84%E5%BE%8B%E7%9A%84%E5%BE%AA%E7%8E%AF) | 2 / 3 | 10 | | | [**P352**【入门】门票的定价](http://219.153.61.2:20004/p/352)* [需要找规律的循环](http://219.153.61.2:20004/p?q=category%3A%E9%9C%80%E8%A6%81%E6%89%BE%E8%A7%84%E5%BE%8B%E7%9A%84%E5%BE%AA%E7%8E%AF) | 1 / 1 | 10 | | [100 Accepted](http://219.153.61.2:20004/record/63771c536248fb90a93c78bb) | [**P353**【入门】小兔子的最大活动面积](http://219.153.61.2:20004/p/353)* [需要找规律的循环](http://219.153.61.2:20004/p?q=category%3A%E9%9C%80%E8%A6%81%E6%89%BE%E8%A7%84%E5%BE%8B%E7%9A%84%E5%BE%AA%E7%8E%AF) | 2 / 6 | 10 | | | [**P391**【入门】恐龙园买玩具?](http://219.153.61.2:20004/p/391)* [需要找规律的循环](http://219.153.61.2:20004/p?q=category%3A%E9%9C%80%E8%A6%81%E6%89%BE%E8%A7%84%E5%BE%8B%E7%9A%84%E5%BE%AA%E7%8E%AF) | 1 / 1 | 10 | | | [**P392**【入门】小丽找数?](http://219.153.61.2:20004/p/392)* [需要找规律的循环](http://219.153.61.2:20004/p?q=category%3A%E9%9C%80%E8%A6%81%E6%89%BE%E8%A7%84%E5%BE%8B%E7%9A%84%E5%BE%AA%E7%8E%AF) | 1 / 1 | 10 | | | [**P393**【入门】开学大采购?](http://219.153.61.2:20004/p/393)* [需要找规律的循环](http://219.153.61.2:20004/p?q=category%3A%E9%9C%80%E8%A6%81%E6%89%BE%E8%A7%84%E5%BE%8B%E7%9A%84%E5%BE%AA%E7%8E%AF) | 1 / 1 | 10 | | | [**P457**【入门】小明学游泳](http://219.153.61.2:20004/p/457)* [需要找规律的循环](http://219.153.61.2:20004/p?q=category%3A%E9%9C%80%E8%A6%81%E6%89%BE%E8%A7%84%E5%BE%8B%E7%9A%84%E5%BE%AA%E7%8E%AF) | 1 / 1 | 10 | | | [**P465**【基础】小鱼的航程](http://219.153.61.2:20004/p/465)* [需要找规律的循环](http://219.153.61.2:20004/p?q=category%3A%E9%9C%80%E8%A6%81%E6%89%BE%E8%A7%84%E5%BE%8B%E7%9A%84%E5%BE%AA%E7%8E%AF) | 2 / 2 | 10 | | | [**P466**【基础】数的统计](http://219.153.61.2:20004/p/466)* [需要找规律的循环](http://219.153.61.2:20004/p?q=category%3A%E9%9C%80%E8%A6%81%E6%89%BE%E8%A7%84%E5%BE%8B%E7%9A%84%E5%BE%AA%E7%8E%AF) | 1 / 1 | 10 | | | [**P788**【入门】换钞票](http://219.153.61.2:20004/p/788)* [需要找规律的循环](http://219.153.61.2:20004/p?q=category%3A%E9%9C%80%E8%A6%81%E6%89%BE%E8%A7%84%E5%BE%8B%E7%9A%84%E5%BE%AA%E7%8E%AF) | 1 / 1 | 10 | | | [**P789**【入门】采购水果](http://219.153.61.2:20004/p/789)* [需要找规律的循环](http://219.153.61.2:20004/p?q=category%3A%E9%9C%80%E8%A6%81%E6%89%BE%E8%A7%84%E5%BE%8B%E7%9A%84%E5%BE%AA%E7%8E%AF) | 2 / 2 | 10 | | | [**P957**【入门】数字之和](http://219.153.61.2:20004/p/957)* [需要找规律的循环](http://219.153.61.2:20004/p?q=category%3A%E9%9C%80%E8%A6%81%E6%89%BE%E8%A7%84%E5%BE%8B%E7%9A%84%E5%BE%AA%E7%8E%AF) | 2 / 3 | 10 | | | [**P1122**【入门】换钞票(2)(change)](http://219.153.61.2:20004/p/1122)* [需要找规律的循环](http://219.153.61.2:20004/p?q=category%3A%E9%9C%80%E8%A6%81%E6%89%BE%E8%A7%84%E5%BE%8B%E7%9A%84%E5%BE%AA%E7%8E%AF) | 0 / 0 | (无) | | | [**P1124**【入门】换零钱(1)](http://219.153.61.2:20004/p/1124)* [需要找规律的循环](http://219.153.61.2:20004/p?q=category%3A%E9%9C%80%E8%A6%81%E6%89%BE%E8%A7%84%E5%BE%8B%E7%9A%84%E5%BE%AA%E7%8E%AF) | 1 / 1 | 10 | | | [**P1128**【入门】找公约数](http://219.153.61.2:20004/p/1128)* [需要找规律的循环](http://219.153.61.2:20004/p?q=category%3A%E9%9C%80%E8%A6%81%E6%89%BE%E8%A7%84%E5%BE%8B%E7%9A%84%E5%BE%AA%E7%8E%AF) | 29 / 149 | 7 | | | [**P1129**【入门】求约数](http://219.153.61.2:20004/p/1129)* [需要找规律的循环](http://219.153.61.2:20004/p?q=category%3A%E9%9C%80%E8%A6%81%E6%89%BE%E8%A7%84%E5%BE%8B%E7%9A%84%E5%BE%AA%E7%8E%AF) | 2 / 2 | 10 | * **1** [ 进入编辑模式](javascript:;) # 分类 * [动态规划](http://219.153.61.2:20004/p?q=category%3A%E5%8A%A8%E6%80%81%E8%A7%84%E5%88%92) * [搜索](http://219.153.61.2:20004/p?q=category%3A%E6%90%9C%E7%B4%A2) * [分治](http://219.153.61.2:20004/p?q=category%3A%E5%88%86%E6%B2%BB) * [计算几何](http://219.153.61.2:20004/p?q=category%3A%E8%AE%A1%E7%AE%97%E5%87%A0%E4%BD%95) * [贪心](http://219.153.61.2:20004/p?q=category%3A%E8%B4%AA%E5%BF%83) * [树结构](http://219.153.61.2:20004/p?q=category%3A%E6%A0%91%E7%BB%93%E6%9E%84) * [图结构](http://219.153.61.2:20004/p?q=category%3A%E5%9B%BE%E7%BB%93%E6%9E%84) * [数论](http://219.153.61.2:20004/p?q=category%3A%E6%95%B0%E8%AE%BA) * [模拟](http://219.153.61.2:20004/p?q=category%3A%E6%A8%A1%E6%8B%9F) * [数据结构](http://219.153.61.2:20004/p?q=category%3A%E6%95%B0%E6%8D%AE%E7%BB%93%E6%9E%84) * [博弈论](http://219.153.61.2:20004/p?q=category%3A%E5%8D%9A%E5%BC%88%E8%AE%BA) * [字符串](http://219.153.61.2:20004/p?q=category%3A%E5%AD%97%E7%AC%A6%E4%B8%B2) * [组合数学](http://219.153.61.2:20004/p?q=category%3A%E7%BB%84%E5%90%88%E6%95%B0%E5%AD%A6) * [线性代数](http://219.153.61.2:20004/p?q=category%3A%E7%BA%BF%E6%80%A7%E4%BB%A3%E6%95%B0) * [高精度算法](http://219.153.61.2:20004/p?q=category%3A%E9%AB%98%E7%B2%BE%E5%BA%A6%E7%AE%97%E6%B3%95) * [递推](http://219.153.61.2:20004/p?q=category%3A%E9%80%92%E6%8E%A8) * [递归](http://219.153.61.2:20004/p?q=category%3A%E9%80%92%E5%BD%92) * [概率论](http://219.153.61.2:20004/p?q=category%3A%E6%A6%82%E7%8E%87%E8%AE%BA) * [NPC](http://219.153.61.2:20004/p?q=category%3ANPC) * [其他](http://219.153.61.2:20004/p?q=category%3A%E5%85%B6%E4%BB%96) [ 手气不错](http://219.153.61.2:20004/problem/random?q=category%3A%E9%9C%80%E8%A6%81%E6%89%BE%E8%A7%84%E5%BE%8B%E7%9A%84%E5%BE%AA%E7%8E%AF) 根据当前过滤条件随机选择一道题 # 状态 * [评测队列](http://219.153.61.2:20004/record) * [服务状态](http://219.153.61.2:20004/status) # 开发 * [开源](https://github.com/hydro-dev/Hydro) * [API](http://219.153.61.2:20004/api) # 支持 * [帮助](http://219.153.61.2:20004/wiki/help) * [QQ 群](http://219.153.61.2:20004/wiki/about#contact) 1. [关于](http://219.153.61.2:20004/wiki/about) 1. [联系我们](http://219.153.61.2:20004/wiki/about#contact) 1. [隐私](http://219.153.61.2:20004/wiki/about#privacy) 1. [服务条款](http://219.153.61.2:20004/wiki/about#tos) 1. [版权申诉](https://hydro.js.org/#%E8%81%94%E7%B3%BB%E6%88%91%E4%BB%AC) 1. Language 1. [Legacy mode](http://219.153.61.2:20004/legacy?legacy=true) 1. 主题 1. 1. 1. Worker 0 in 23ms 1. Powered by [Hydro v4.7.2](https://hydro.js.org/) Community
-
-2
#include<bits/stdc++.h> using namespace std; struct zzh{ char xm[100]; int xb; int n; int y; int r; }; zzh a[1000]; bool hzz(zzh f,zzh g) { if(f.n>g.n) { return 0; } if(f.n==g.n) { if(f.y>g.y) { return 0; } if(f.y==g.y) { if(f.r>g.r) { return 1; } } return 1; } return 1; } int main() { cout<<"请输入一共有多少人"<<endl; int n; cin>>n; cout<<"输入每个人的 姓名 出生年份 出生月份 出生日"<<endl; for(int i=1;i<=n;i++){ cout<<"第"<<i<<"个人:"; cin>>a[i].xm>>a[i].n>>a[i].y>>a[i].r; } sort(a+1,a+n+1,hzz); cout<<endl; for(int i=1;i<=n;i++) { cout<<"第"<<i<<"大的:"; cout<<a[i].xm<<" "<<a[i].n<<" "<<a[i].y<<" "<<a[i].r<<endl; } return 0; }
-
-2
#include<bits/stdc++.h> using namespace std; long long read(){ long long ans=0,f=1; char ch=getchar(); while(!isdigit(ch)){ f*=(ch=='-')?-1:1; ch=getchar(); } while(isdigit(ch)){ ans=(ans<<3)+(ans<<1)+(ch^48); ch=getchar(); } return ans*f; } const int MAXN=505; int e[MAXN][MAXN],n,m,a,b; int main(){ n=read(),m=read(); memset(e,0x3f,sizeof(e)); for(int i=1;i<=m;i++){ int x=read(),y=read(),l=read(); e[x][y]=l;e[y][x]=l; } for(int k=1;k<=n;k++){ for(int i=1;i<=n;i++){ for(int j=1;j<=n;j++){ e[i][j]=min(e[i][j],e[i][k]+e[k][j]); } } } a=read(),b=read(); if(e[a][b]==0x3f3f3f3f)cout<<"No path"; else printf("%d",e[a][b]); }
信息
- ID
- 1
- 时间
- 1000ms
- 内存
- 256MiB
- 难度
- 10
- 标签
- 递交数
- 843
- 已通过
- 300
- 上传者