2014 NEUACM 新星赛
来源:互联网 发布:protobuf php的使用 编辑:程序博客网 时间:2024/04/28 02:37
1481: Sister Wang
时间限制: 1 Sec 内存限制: 256 MB提交: 514 解决: 115
[提交][状态][讨论版]
题目描述
Do you know Sister Wang?
Sister Wang is goddess and many diaosi want to know her phone number. Sister Wang doesn’t tell them her number directly. She tells them a string, contains letters,
digits and symbols,but no blanks. And her phone number is in the string. Fushuai knows how to get the phone number. He delete the letters and symbols from the
string, so that he gets some digits, and then he sort the digits in ascending order. In this way, Fushuai succeeds in calling Sister Wang.
输入
There are several cases. Each cases contains a string L(1<= length(L)<=20).
输出
Output Sister Wang’s phont number.
样例输入
Sist1e2r3w4a5ng
样例输出
12345
提示
来源
新星赛2014
#include<iostream>#include<cstring>#include<cstdio>#include<cmath>#include<algorithm>using namespace std;int main(){char s[111];string str;while(~scanf("%s",s)){str="";for(int i=0;s[i]!='\0';i++){if(s[i]>='0'&&s[i]<='9')str=str+s[i];}sort(str.begin(),str.end());cout<<str<<endl;}return 0;}/************************************************************** Problem: 1481 User: 1307122118 Language: C++ Result: 正确 Time:4 ms Memory:1260 kb****************************************************************/
1482: Christmas math gift
时间限制: 1 Sec 内存限制: 256 MB提交: 56 解决: 27
[提交][状态][讨论版]
题目描述
输入
输出
样例输入
23 3 30 0 0
样例输出
no solutionmultiple solution
提示
来源
新星赛2014
#include<iostream>
#include<cstring>
#include<cstdio>
#include<cmath>
#include<algorithm>
#include<queue>
using
namespace
std;
int
main()
{
int
t,a,b,c;
int
del;
scanf
(
"%d"
,&t);
while
(t--)
{
scanf
(
"%d%d%d"
,&a,&b,&c);
if
(a==0)
{
if
(b==0)
{
if
(c==0)
{
printf
(
"multiple solution\n"
);
}
else
{
printf
(
"no solution\n"
);
}
}
else
{
printf
(
"one solution\n"
);
}
}
else
{
del=b*b-4*a*c;
if
(del<0)
{
printf
(
"no solution\n"
);
}
else
if
(del==0)
{
printf
(
"one solution\n"
);
}
else
{
printf
(
"multiple solution\n"
);
}
}
}
return
0;
}
/**************************************************************
Problem: 1482
User: 1307122118
Language: C++
Result: 正确
Time:0 ms
Memory:1252 kb
****************************************************************/
1483: Fushaui see movie
时间限制: 1 Sec 内存限制: 256 MB提交: 83 解决: 25
[提交][状态][讨论版]
题目描述
输入
输出
样例输入
251 2 2 4 452 3 4 5 1
样例输出
25
提示
来源
新星赛2014
#include<iostream>#include<cstring>#include<cstdio>#include<cmath>#include<algorithm>#include<queue> using namespace std;int a[200005],f[200005];int main(){int t,i,n,ans;scanf("%d",&t);while(t--){scanf("%d",&n);for(i=0;i<n;i++){scanf("%d",&a[i]);a[i+n]=a[i];}f[0]=1;ans=1;for(i=1;i<2*n;i++){if(a[i]>a[i-1]){f[i]=f[i-1]+1;}else{f[i]=1;}ans=max(ans,f[i]);}printf("%d\n",ans);} return 0;}
1484: Hengheng eat noodles
时间限制: 1 Sec 内存限制: 256 MB提交: 15 解决: 12
[提交][状态][讨论版]
题目描述
As we all know,Hengheng(big cow),very look forward to meizi and he often declare that he want to find a meizi.As Hengheng’s admirer, Jiajia decides to help Hengheng to achieve his dream in Christmas Day. In this day, Jiajia asks Hengheng to eat noodles with a pretty meizi(don’t ask why Jiajia didn’t chase this pretty meizi). When eating noodles, Hengheng is so excited that he wants the qq of the meizi. However, a unlucky thing happen.The pretty meizi says she won’t give Hengheng her qq unless Hengheng can solve her question. Hengheng promise without hesition.The pretty meizi picks up a noodle and say with sexy voice, “We all know a noodle has two ends,and now I has n noodles, so there are 2*n ends at all. Out of interest,I will link these ends randomly,and then I wonder the mathematical expectation of the circle I could get.” Although Hengheng is big cow, he can’t wait to get the qq so he can’t think as long as he see the pretty. So he ask Jiajia to solve the problem for him. Luckily,after 1000 ms,Jiajia give the right answer. And Hengheng got the qq successfully. Now, if you are Jiajia, could solve the problem within 1000 ms and help Hengheng get the qq.
输入
The first line is a integer t,indicate the number of cases.(t<=10)
For each case follow,there is a integer n,imply the amount of noodles.(n<=10^6)
输出
For each case, print a double E,represent the mathematical expectation.(E retain 6 decimal)
样例输入
3124
样例输出
1.0000001.3333331.676190
提示
来源
新星赛2014
#include<iostream>
#include<algorithm>
#include<cstring>
#include<cstdio>
#include<cmath>
#include<queue>
using
namespace
std;
double
e[1000001];
int
main()
{
int
t,i,n;
e[1]=1.000000;
for
(i=2;i<=1000001;i++)
{
e[i]=(e[i-1]+1.0)/(2*i-1)+e[i-1]*(2*i-2)/(2*i-1);
}
scanf
(
"%d"
,&t);
while
(t--)
{
scanf
(
"%d"
,&n);
printf
(
"%lf\n"
,e[n]);
}
return
0;
}
/**************************************************************
Problem: 1484
User: 1307122118
Language: C++
Result: 正确
Time:119 ms
Memory:9064 kb
****************************************************************/
#include<iostream>
#include<algorithm>
#include<cstring>
#include<cstdio>
#include<cmath>
#include<queue>
using
namespace
std;
double
e[1000001];
int
main()
{
int
t,i,n;
e[1]=1.000000;
for
(i=2;i<=1000001;i++)
{
e[i]=(e[i-1]+1.0)/(2*i-1)+e[i-1]*(2*i-2)/(2*i-1);
}
scanf
(
"%d"
,&t);
while
(t--)
{
scanf
(
"%d"
,&n);
printf
(
"%lf\n"
,e[n]);
}
return
0;
}
/**************************************************************
Problem: 1484
User: 1307122118
Language: C++
Result: 正确
Time:119 ms
Memory:9064 kb
****************************************************************/
- 2014 NEUACM 新星赛
- 2015年NEUACM一月月赛
- 2014:新星商城
- NEUACM 1002
- 2015年NEUACM省赛练习赛第二场 赛后小结
- 2015年NEUACM省赛练习赛第二场 B题补充题解
- 计算机语言新星:Kotlin
- 〖2016〗吉首大学第六届新星杯暨程序设计大赛(新生网络同步赛)-题解
- 又一颗演艺界新星陨落!
- BBS 设计思路系列 ---- 元老院 和 新星
- WEB应用服务器的新星 - Zope
- 易博: 博客编辑器中一颗闪亮的新星
- Web 2.0创业的六颗新星
- 《商务新星.NET 4.0》源代码分享
- 《商务新星.NET 4.0》发布说明
- 带你走进Adobe 新星 CS5 系列
- 中国广告传媒行业策划新星 丁卫华
- 融合式架构--数据中心兴起的新星
- (十三)Spring配置数据源方式
- nyoj 128 前缀式计算
- TCP连接探测中的Keepalive和心跳包. 关键字: tcp keepalive, 心跳, 保活
- ios-day05-01(ScrollView的三个属性:contentSize、contentInset、contentOffset)
- 关于GhostDriver的Cookie隔离问题
- 2014 NEUACM 新星赛
- Linux命令学习:ps(参数详解)
- FMDB
- 备忘网址
- db2 查看表空间使用率
- Ubuntu init启动流程分析
- [oldj]用JavaScript截取字符串左边长度为n的子串
- ios中应用程序的生命周期
- 用NginX+keepalived实现高可用的负载均衡