2010年ACM亚洲赛福州赛区现场赛题目
ACM软件大赛之编程大赛题目(附部分答案)
ACM 软件大赛之编程大赛比赛注意事项:l 比赛时间为3小时(小时(180180分钟);比赛分两个阶段:第一阶段限时30分钟,完成公示的3题,第二阶段限时150分钟(事先完成第一阶段题目的小组可提前进入第二阶段); l 比赛第一阶段的3道题目将在前期宣传中告知参赛选手,比赛第二阶段的题目将由赛事主席当场公布竞赛题目;主席当场公布竞赛题目;l 前两阶段题目分为三个分值(前两阶段题目分为三个分值(55分、分、1010分、分、1515分),第一阶段3道公示题都为5分;第二阶段总共15道题,根据不同的难度分值不同,分别为5道5分题,分题,55道10分题,分题,55道15分题;第一阶段参赛队员不可参考任何相关资料;第二阶段参赛队员可以携带诸如书,如书,手册,程序清单等参考资料。
手册,程序清单等参考资料。
手册,程序清单等参考资料。
比赛过程中队员不得携带任何电子媒质的资料;参比赛过程中队员不得携带任何电子媒质的资料;参赛者可以选择自己擅长的语言(赛者可以选择自己擅长的语言(C,C++,JAVA C,C++,JAVA 等等)进行编写等等)进行编写l 考虑到大一和大二学生的知识掌握程度,大一参加选手一开始就会有10分的分数,最后总分是由所做题目及初始的10分相加得到。
分相加得到。
l 每组队员根据安排使用电脑,小组人数为两人的使用一台电脑,超过两人的使用两台电脑,每台的电脑配置完全相同;脑,每台的电脑配置完全相同;l 各小组每做完一题或几题,必须交予评委老师运行,评委老师当场给分;各小组每做完一题或几题,必须交予评委老师运行,评委老师当场给分; l 如在比赛中发现作弊等行为,将取消比赛资格。
如在比赛中发现作弊等行为,将取消比赛资格。
第一阶段公示题目:题目一:(5分) 打印以下图形,纵遵从字母顺序,行字符数遵从斐波那契数列ABCCDDD EEEEEFFFFFFFFGGGGGGGGGGGGG#include<iostream>int f(int x){int a = 1 , b = 0;int max_ = x;int sum = 0; for(int i = 0; i < max_ ; i++){sum = a + b;a = b;b = sum;}return sum;}void loop_print(int num,char chr){for(int i = 0; i < num ;i++)std::cout<<chr;std::cout<<"\n";}int main(){int line_max = 7;char chr = 'A';for(int line = 0; line < line_max; line++){loop_print(f(line+1),chr);chr++;}return 0;}题目二:(5分)有个电子钟,12点显示为12:00(即12小时制),那么请问一天24时间内,出现连续3个相同数字的钟点有几个?#include<iostream>using namespace std;bool check(int me){int h= me/100;int m= me-100*h;return h<=12&&m<=59&&h>0?true:false;//12小时制小时制}int main(){int me=0;int j(0);//总计数器总计数器while( me<1270){//max 12:59int t= me;int n[4];for(int i=0;i<4;i++){n[i]=t%10;t /= 10;}if(n[1]==n[2]&&(n[0]==n[1]||n[3]==n[1])&&check( me)){//cout<<n[3]<<n[2]<<":"<<n[1]<<n[0]<<"\n";//testj++;me++;}cout<<"total: "<<j*2<<endl;}题目三:(5分)10进制的四位数中有几个符合如下特征:将其分别表示为16进制、10进制、12进制,在每种状态下,分别将各个位上的数相加,能得到3个相等10进制数。
acm程序设计教程 course(1)初识ACM
2011-9-5
38
2009-6-9 讨论湖南省大学生计算机程 序设计竞赛湖南师范大学具体实施方案 2009-6-10 下发2009年湖南省大学生计 算机程序设计竞赛湖南师范大学选拔赛 通知(数计院、物信院、工学院) 2009-6-15 正式选拔 2009-7-4 开学典礼 7-10——8-10 暑假集训
2011-9-5
6
ACM/ICPC in China
中国大陆高校从1996年开始参加ACM/ICPC—— 前六届中国赛区设在上海,由上海大学承办; 2002年由清华大学和西安交通大学承办; 2003年由清华大学和中山大学承办。 2004年由北京大学和上海交通大学承办。 2005年由四川大学、北大和浙大承办。 2006年由上海大学、清华和西电承办。 2007年:北航、南航、吉大、西华 2008年:哈工程、北交、合肥、杭电、西南民大
35
2011-9-5
今年比赛
2011(9.14-9.15) 湖南农业大学
2011-9-5
36
第三部分
我校ACM相关情况
2011-9-5 37
组建过程
Байду номын сангаас
2009-5-7 ACM/ICPC华中南区程序设 计大赛选拔考试(小范围,数计学院) 2009-5-8 组队报名、竞赛介绍、简单 培训 5月29日至5月31日 参加ACM/ICPC华 中南区程序设计大赛(湖南大学)
参赛队组成
ACM-ICPC以团队的形式代表各学校参赛, 每个 赛区的优胜队伍将获得参加ACM国际大学生程序 设计竞赛全球总决赛资格。 亚洲区的高校可以组队参加亚洲的任何一个或者 几个赛区的比赛,但每所高校最多只能有一队可 以获得参加全球世界决赛的资格。 每队由一名教练和三名队员组成, 有些赛区还允许 有一名候补队员。 亚洲区的每位参赛选手在一年内最多可参加两个 赛区的亚洲区预选赛, 每位选手最多可以参加五届 亚洲区预选赛和两届全球总决赛。
2010程序设计大赛决赛题及参考答案
1.大写字母:A,B,C...Z;
2.小写字母:a,b,c...z;
3.数字:0,1,2...9;
4.特殊符号:~,!,@,#,$,%,^;
给你一个密码,你的任务就是判断它是不是一个安全的为50),密码仅包括上面的四类字符。
输出
对于每个输入的密码,判断这个密码是不是一个安全的密码,是的话输出YES,否则输出NO。
样例输入1
Linle@ACM
样例输出1
YES
样例输入2
^~^@^@!%
样例输出2
NO
C参考答案:
#include <stdio.h>
#include <string.h>
int main(){
char s[51], b[4];
int len, i, r;
scanf("%s", s);
len = strlen(s);
样例输入:
2591
样例输出:
2*9+5+1
参考答案:
importjava.util.Scanner;
publicclassPoint24 {
publicstaticvoidmain(String args[])
{
booleant =false;
int[] m =newint[4];
Scanner input=newScanner(System.in);
{
if(treeNames[j].compareTo(treeNames[j+1])>0)
{
String temp=treeNames[j];
treeNames[j]=treeNames[j+1];
2010程序设计大赛决赛题及参考答案
}
4、(15分)网上流传一句话:"常在网上飘啊,哪能不挨刀啊~"。其实要想能安安心心地上网其实也不难,学点安全知识就可以。
首先,我们就要设置一个安全的密码。那什么样的密码才叫安全的呢?一般来说一个比较安全的密码至少应该满足下面两个条件:
(1).密码长度大于等于8,且不要超过16。
(2).密码中的字符应该来自下面“字符类别”中四组中的至少三组。
样例输入1
Linle@ACM
样例输出1
YES
样例输入2
^~^@^@!%
样例输出2
NO
C参考答案:
#include <stdio.h>
#include <string.h>
int main(){
char s[51], b[4];
int len, i, r;
scanf("%s", s);
len = strlen(s);
{
a[2]="";
switchห้องสมุดไป่ตู้i)
{
case0:
z[0] = m[0] + m[1];
a[0] ="("+m[0]+"+"+ m[1]+")";
break;
case1:
z[0] = m[0] - m[1];
a[0] ="("+m[0] +"-"+ m[1]+")";
break;
case2:
z[0] = m[0] * m[1];
printf("%10s%10s%10s\n”,”men”,”women”,”children");
2010年全国大学生高等数学竞赛总决赛(答案)
2010年全国大学生数学竞赛决赛答 tian27546这是献给博士论坛一个礼物 转载时请勿注明是博士论坛一、(20分)计算下列各题:1.求极限 211sin )1(lim n k n k n k n π∑-=→∞+解法1因211sin )1(n k n k n k π∑-=+211222sin sin 21(2sin 21n n k n k nn k πππ∑-=+=) )22cos 22(cos 1(2sin 2122112n k n k n k nn k πππππ+--+=∑-=) )22cos 22(cos 1(22112nk n k n k n n k πππππ+--+≈∑-=) 2112211222cos 1(22cos 1(n k nk n n k n k n n k n k ππππππ++--+=∑∑-=-=)) 222211222cos 11(22cos 1(n k n k n n k n k n nk n k ππππππ--+--+=∑∑=-=))2122222222cos 12)12(cos 11(2cos )11(n k n n n n n n n n n n n k πππππππ-+--+-+=∑-=) 21222222)12(cos 2)12(cos 12(2cos )11(nk n n n n n n n n n k ππππππ-+---+=∑-=)(*) 而2122)12(cos n k n k π-∑-=212222sin 2)12(cos22sin 21n n k nn k πππ∑-=-=])1(sin [sin2sin2121222n k n k nn k πππ--=∑-= 2222sin 2sin )1(sinn n n n πππ--=222sin2)2(sin 2cos n n n n πππ-=(**) 将(**)代入(*),然后取极限,得原式]2sin2)2(sin2cos2)12(cos 12(2cos )11([lim 222222n n n nn n n n n n n n n ππππππππ-+---+=→∞)]2)2(sin 2cos 2)8)12(1(12()11([lim 22342222n n n n n n n n n n n ππππππ-+----+=∞→) ]2)2(sin 2cos 2)21(12()11([lim 2232222n n n n n n n n n n ππππππ-+---+=∞→) )]48)2(2)2()(81(2)21(12()11([lim 633222232222nn n n n n n n n n n n πππππππ----+---+=∞→))]482)(81(2)21(12()11([lim 33222232222n n n n n n n n n n n ππππππππ---+---+=∞→) 65π=上式中含2n 的项的系数为0121=+-πππ,含n 的项的系数为0)2(111=-++πππ,常数项系数为656824ππππππ=-=--解法2 Step 1因∑-=112sin n k n k π211222sinsin 22sin 21n nk nn k πππ∑-==)22cos 22(cos2sin2122112n k n k nn k πππππ+--=∑-=)2)12(cos2(cos2sin21222n n n n πππ--=故)2)12(cos 2(cos 2sin 21lim sinlim 222112n n n nn k n n k n ππππ--=→∞-=→∞∑)2)12(cos2(cos1lim222n n n n n πππ--=→∞nn n n n 2sin 2)1(sin2lim22πππ-=→∞n n n n n 22)1(2lim22πππ-=∞→2π= Step 2因222)12(cosn k nk π-∑=22222sin 2)12(cos22sin21n n k nnk πππ∑=-=])1(sin [sin2sin212222nk n k nnk πππ--=∑= 2222sin 2sinsin n n n n πππ-=2222sin 2)1(sin 2)1(cos nn n n n πππ-+=因此∑-=112sin n k n k nk π211222sin sin 22sin 21n n k n k n n k πππ∑-== ]2)12(cos 2)12(cos [2sin 212112112n k n k n k n k nn k n k πππ+--=∑∑-=-= ]2)12(cos 12)12(cos [2sin 21222112n k n k n k n k nnk n k πππ----=∑∑=-=⎥⎦⎤⎢⎣⎡-+---=∑-=2122222)12(cos 12)12(cos 12cos 12sin 21n k n n n n n n n nn k ππππ ⎥⎦⎤⎢⎣⎡-+--=∑=222222)12(cos 12)12(cos 2cos 12sin 21n k n n n n nnnk ππππ(*) ⎥⎥⎥⎦⎤⎢⎢⎢⎣⎡-++--=2222222sin 2)1(sin 2)1(cos 2)12(cos 2cos 12sin 21nn n n n n n n n n n ππππππ 于是∑-=→∞112sin lim n k n n k nk π⎥⎥⎥⎦⎤⎢⎢⎢⎣⎡-++--=→∞2222222sin 2)1(sin 2)1(cos 2)12(cos 2cos 12sin 21lim nn n n n n n n n n n n ππππππ ⎥⎥⎥⎦⎤⎢⎢⎢⎣⎡-++---=→∞n n n n n n n n n n 22)1(sin2)1(cos 8)12(11lim 224222πππππ)( ⎥⎥⎥⎥⎦⎤⎢⎢⎢⎢⎣⎡---+-++-=∞→n n n n n n n n n n n 2)48)1(2)1()(8)1(1211lim 6332422222ππππππ(⎥⎦⎤⎢⎣⎡----++-=∞→)24)1(1)(81211lim 52322222n n n n n n n n n ππππ( ⎥⎦⎤⎢⎣⎡---++-=∞→)241()(81211lim 2222222n n n n n n n n ππππ( ⎥⎦⎤⎢⎣⎡---++-=∞→)2411)(81211lim 2222222n n n n n n n ππππ( )(222222282411211lim n n n n n n n ππππ---++-=→∞ )(22222228242lim n n n n n ππππ--=∞→62ππ-=3π=原式6532πππ=+=2.计算⎰⎰∑++++2222)(zy x dxdya z axdydz ,其中 ∑为下半球面222y x a z ---= 的上侧, 0>a .解 记1∑为平面 222,0a y x z ≤+= 的上侧,2∑为下半球面 222y x a z ---= 的下侧,Ω是由1∑和2∑所围成的立体,则422222211)(adxdy a dxdy a dxdy a z axdydz ay x ⎰⎰⎰⎰⎰⎰≤+∑∑===++π,设,sin ,cos θθr y r x ==则⎰⎰∑+∑++212)(dxdy a z axdydz ⎰⎰⎰Ω+++=dxdydz a z a )220(⎰⎰⎰Ω+=dxdydz a z )32(⎰⎰⎰≤+---+=2222220)32(a y x y x a dz a z dxdy⎰⎰≤+---+=22222202]3[a y x y x a dxdy az z⎰⎰≤+--+++-=222)3(222222a y x dxdy y x a a y x a ⎰⎰≤≤≤≤-++-=πθθ2002222d d )3(ar r r r a a r a⎰-++-=a r r r a a r a 02222d )3(2π ⎰-++-=ar r a a r a 022222)d()3(π⎰-++-=22122d ))(3(a u u a a u a π223222)(42a u a a uu a ⎥⎦⎤⎢⎣⎡--+-=π274a π=⎰⎰∑++++2222)(zy x dxdya z axdydz⎰⎰⎰⎰∑∑+∑+++++-=12122)(1)(1dxdy a z axdydz a dxdy a z axdydz a 227333a a a πππ-=+-=3.现 设计一个容积为V 的圆柱体容器. 已知上下两底的材料费为单位面积a元,而侧面的材料费为单位面积b 元. 试给出最节省的设计方案;即高与的上下底直径之比为何值时所需费用最少?解 设圆柱体的底半径为r ,高为h ,则h r V 2π=,2rVh π=总造价为222r a rh b P ππ+=222r a rbVπ+=, 则2322242r r a bV r a r bV P ππ--=+-=',由0='P 知,解得312⎪⎭⎫⎝⎛=πa bV r ,312⎪⎭⎫ ⎝⎛=ππa bV V h , 因为是惟一的驻点,所以当3122323131222222:2⎪⎪⎭⎫ ⎝⎛=⎪⎭⎫ ⎝⎛=⎪⎭⎫ ⎝⎛⎪⎭⎫ ⎝⎛=Vab a bV V a bV a bV V h r ππππππ 时,所需费用最少.4.已知 x x x f 33cos sin 1)(+=',)21,41(∈x ,求)(x f 解 因x x x f 33cos sin 1)(+=',)21,41(∈x ,故 ⎰+=x xx x f d cos sin 1)(33⎰+-+=x x x x x x x d )cos )(sin cos sin cos (sin 122⎰+-=x x x x x d )cos )(sin cos sin 1(1⎰+-=x x x d )4sin()2sin 211(21π⎰+⎪⎭⎫ ⎝⎛++=x x x d )4sin()22cos(211121ππ⎰+⎪⎭⎫ ⎝⎛++=x x x d )4sin()4(2cos 211121ππ 令)4(21π+=x t ,则⎰+=t tt x f d 2sin )4cos 211(2)(⎰+=t tt t d cos sin )4cos 2(2⎰-+=t t t t t d cos sin )2sin 2cos 2(222⎰+=t t t t t d cos sin )2sin 2cos 3(222 ⎰+-=t tt t t t t d cos sin )cos sin 4)sin (cos 3(222222⎰-++=t t t t t t t t t d cos sin )cos sin 2sin 3cos 3()cos (sin 22244222 ⎰-+++=t t t t t t t tt t t d cos sin )cos sin 2sin 3cos 3(cos sin 2sin cos 222442244⎰-+++=t t t t tt tan d tan )tan 2tan 33(tan 2tan 122424 令t u tan =,2u v =,则⎰-+++=u u u u u u x f d )233(212)(2424⎰-+++=224224d )233(2122u u u u u u ⎰-+++=v v v v v v d )233(212222⎰+-++=v v v v v v d )323(122222 令)()323(1222v R vAv v v v v +=+-++,则31=A ,)323(332336331)323(12)(22222+--+-++=-+-++=v v v v v v v v v v v v v v R )323(382+-=v v 因此⎰⎰+-+=323d 324d 62)(2v v vv v x f ⎰+-+=323d 324ln 622v v vv ⎰+-+=98)31(d 924ln 622v v v C v v +-+=32231arctan 3221924ln 62C v v +-+=2213arctan 32ln 62 C t t +-+=221tan 3arctan 32tan ln 6222C t t +-+=221tan 3arctan 32tan ln 6222C x x +-+++=221)82(tan 3arctan 32)82(tan ln 6222ππ 二、(10分)求下列极限1.⎪⎭⎫ ⎝⎛-+∞→e n n n n )11(lim解 设xx x f 1)1()(+=, 则))1ln()1(1()1()(21xx x x x x f x+-++=')1()1ln()1()(2x x x x x x f +++-= 原式=)(lim )1(lim010x f x e x x xx '=-+→→)()(lim )(lim 00x f x f x f x x '=→→)1()1ln()1(lim)(lim 20x x x x x x f x x +++-=→→20)1ln()1(limx x x x e x ++-=→22)1ln(lim 0e x x e x -=+-=→2.nnn n n c b a ⎪⎪⎪⎭⎫⎝⎛++∞→3lim 111,其中0>a ,0>b ,0>c 解 因300ln 3ln ln ln 3ln ln ln lim 33lim abc c b a c c b b a a x c b a x x x x x x x x =++=++=-++→→ 故 原式=333lim)13(1lim 10003lim abc ee c b a x c b a c b axxxx x x x x x x xx xx ===⎪⎪⎭⎫⎝⎛++-++-++→→→三、(10分)设)(x f 在1=x 处可导,0)1(=f ,2)1(='f ,求xx x x x f x tan )cos (sin lim 220++→ 解 设)(x f 在1=x 处可导,0)1(=f ,2)1(='f ,则xx x f x x f x x x x x f x x tan )1()cos (sin lim tan )cos (sin lim 220220+-+=++→→ 1cos sin )1()cos (sin lim 1cos sin lim tan lim 220220220-+-+-++=→→→x x f x x f x x x x x x x x x x 1cos sin )1()cos (sin lim 2sin cos sin 2lim cos 111lim220020-+-+-+=→→→x x f x x f x x x x xx x x 1cos sin )1()cos (sin lim 2sin cos sin 2lim 212200-+-+-=→→x x f x x f x x x x x x 1cos sin )1()cos (sin lim 21cos 2lim sin lim 2122000-+-+-=→→→x x f x x f x x x x x x1cos sin )1()cos (sin lim 41220-+-+=→x x f x x f x 1)1()(lim 411--=→t f t f t )1(41f '=21= 四、(10分)设)(x f 在),0[+∞上连续,⎰+∞0d )(x x f 收敛,求⎰+∞→yy x x xf y 0d )(1lim.解 令⎰=xt t f x G 0d )()(,则因⎰+∞0d )(x x f 收敛,故)(lim y G y +∞→,不妨设R A y G y ∈=+∞→)(lim ,则[]}d )()(1{lim )(d 1lim d )(1lim0000⎰⎰⎰-==+∞→+∞→+∞→y yy y y y y x x G x xG yx G x y x x xf y)d )(1)((lim 0⎰-=+∞→yy x x G yy G ⎰+∞→-=yy x x G y A 0d )(1lim 0)(lim =-=-=+∞→A A y G A y五、(12分)设函数)(x f 在]1,0[上连续,在)1,0(内可微,且0)1()0(==f f ,1)21(=f ,证明:(1)存在⎪⎭⎫⎝⎛∈1,21ξ使得ξξ=)(f ;(2)存在()ξη,0∈使得1)()(+-='ηηηf f .证 (1)记x x f x F -=)()(,则函数)(x F 在]1,21[上连续,且1)1(-=F ,21)21(=F ,故由零点存在性定理知存在⎪⎭⎫⎝⎛∈1,21ξ使得0)(=ξF ,即ξξ=)(f . (2)因x x x f x f e x d )1)()((⎰+-'--x e x xe x x f e x x f e x x x x d d d )(d )(⎰⎰⎰⎰----+-'-= x e e x x f e x x f e x x x x d d )(d d )(⎰⎰⎰⎰----++-=x x xe x f e --+-=)(故令x e x x f x F --=))(()(, 则函数)(x F 在],0[ξ上连续,在()ξ,0内可微,0)0(=F ,0)(=ξF ,x x e x x f e x f x F -----'='))(()1)(()(, 故由罗尔定理知,存在()ξη,0∈使得0)(='ηF , 1)()(+-='ηηηf f .六、设)(x f 在),(+∞-∞上有定义,在0=x 的某邻域内有一阶连续导数,且0)(lim 0>=→a x x f x ,证明级数∑∞=-1)1()1(n n n f 条件收敛. 证 因 0)(lim>=→a xx f x ,故存在一个正数δ,使得当δ<-<00x 时,有 2)(aa x x f <-因此x x f a )(2<(δ<-<00x ),于是,当δ1>n 时, δ<-<010n ,nn f a 1)1(2<,n a n f 2)1(>,这表明级数∑∞=1)1(n n f 发散,即级数∑∞=-1)1()1(n n n f 发散.下证原级数收敛:由0)(lim0>=→a xx f x 知,0)(lim lim )(lim )0(000====→→→a x x f x x f f x x x ,0)(lim )0()(lim )0(00>==-='→→a xx f x f x f f x x由)(x f 在0=x 的某邻域内有一阶连续导数知,)(lim )0(0x f f a x '='=→,因此存在一个正数η,使得当η<-0x 时,有2)(aa x f <-' 因此)(20x f a '<<(),(ηη-∈x ). 特别地,)(x f 在),0(η上单调增,于是当η1>n 时,)1()11(n f n f <+,且0)0()1(lim ==∞→f nf .最后由Leibniz 判别法知,原级数收敛.综上可知,原级数条件收敛.六、(14分)设1>n 为整数,⎰⎪⎪⎭⎫ ⎝⎛++++=-x n tt n t t t e x F 02d !!2!11)( ,证明:方程 2)(n x F =在⎪⎭⎫⎝⎛n n ,2内至少有一个根. 证 记!!2!11)(2n t t t t p nn ++++= ,)!!2!11()(2n t t t e t r ntn ++++-= ,则)()(t r e t p n t n -=,且当0>t 时,0)(>t p n , 0)(>t r n ,0)(>-t r e n t .记2)()(n x F x -=ψ,则⎰--=n n t t t r e nx 0d )(2)(ψ,因⎰⎪⎪⎭⎫⎝⎛++++=-x n tt n t t t e x F 02d !!2!11)( ,故函数)(x ψ在],2[n n 上连续,在⎪⎭⎫⎝⎛n n ,2内可微,且2)2()2(n n F n -=ψ⎰⎰<-=--=--20200d )(2d ))(1(nn t n n tt t r e n t t r e ,2d )()(0nt t p e n nn t -=⎰-ψ⎰⎰⎰⎰----+-=+--=202220d )(d )(d )(2d ))(1(n nn n t n t n n n t n n t tt p e t t r e tt p e nt t r e⎰⎰++-=---20202d )2(d )(n n n n t n tt n t p et t r e⎰⎰+++-=---20202d )2(d )!1(1nnn nt t t n t p e t e e n ξ ⎰⎰+-++-=+---202022d ))2((d )!1(1nnn nt nt t t n t r e e t e e n ξ ⎰⎰+---+-+-=202022d )!1(1d )!1(121nnnnt t t e e n t e e n n ξξ ⎰⎰--+-+-=2020d )!1(1d )!1(121n nt t t e e n t e e n n ξξ ⎰-+->202d )!1(22n nt t e e n n []202)!1(22nt ne e n n -++= )1()!1(222-+-=ne n n )!1(2)!1(222+++-=n n e n n )!1(22)!1(2222+-=+->n en n e n n n012>->n(若2>n ,则左边的两个不等式都成立) ()()⎰⎰-+-=-+=-=--101021d 121d 121)1()1(t te t t t e F ψ()[]⎰-++-=--101021d 1t e e t t t 032321)1(2111>-=--+-=--ee e 031)2(>->eψ01223!4223)3(1223144144314923232333>-=->⇒>⇒>>>e e e e ψ 01232452!522)4(2>->->->e e e ψ,0122212e e 12)(>->++->n n n n n e n n ψ 故由零点存在性定理知, 存在),2(n n ∈ξ使得0)(=ξψ, 即2)(nF =ξ.七、(12分)是否存在R 中的可微函数)(x f 使得53421))((x x x x x f f --++=? 若存在,请给出一个例子;若不存在,请给出证明.解 不存在假如存在R 中的可微函数)(x f 使得54321))((x x x x x f f -+-+=,则4325432)))((x x x x x f x f f -+-=''(, 若1)1(=f ,则025432)1))1(()]1[2<-=-+-=''='((f f f f 矛盾。
2010全国大学生数学建模竞赛福建赛区获奖名单
院校名:01厦门大学(A22队送全国一等3队、二等2队,赛区一等11队、二等6队;B15队送全国一等2队、二等3队,赛区一等8队、二等2队)院校名:02集美大学(A37队送全国一等2队、二等1队,赛区一等5队、二等9队;B13队送全国一等1队、二等0队,赛区一等0队、二等2队)院校名:04厦门大学嘉庚学院(A2队送全国一等0队、二等0队,赛区一等0队、二等1队;B6队送全国一等1队、二等0队,赛区一等3队、二等2队)队;B2队送全国一等0队、二等0队,赛区一等0队、二等0队)院校名:06华侨大学(A13队送全国一等0队、二等1队,赛区一等1队、二等2队;B11队送全国一等0队、二等1队,赛区一等0队、二等2队)院校名:07泉州师范学院(A10队送全国一等2队、二等1队,赛区一等0队、二等3队;院校名:08泉州师范学院软件学院(A送全国一等0队、二等0队,赛区一等0队、二等1队;B无)区一等1队、二等0队;B4送全国一等0队、二等0队,赛区一等0队、二等1队)B1队送全国一等0队、二等0队,赛区一等0队、二等1队)队送全国一等0队、二等0队,赛区一等1队、二等0队)院校名:12莆田学院(A13队送全国一等0队、二等1队,赛区一等1队、二等5队;B 送全国一等0队、二等1队,赛区一等0队、二等3队)院校名:13三明学院(A14队送全国一等0队、二等1队,赛区一等1队、二等4队;B6队送全国一等0队、二等0队,赛区一等0队、二等2队)队送全国一等1队,二等0队,赛区一等1队、二等1队)队送全国0队、二等0队,赛区一等0队、二等1队)B5队送全国一等0队、二等0队,赛区一等0队、二等2队)7 u& q; K7 U; l) p4 d4 m" k$ \( b- S6 r: l' X& [, K& B" Z/ L4 ^6 y/ y7 A7 g$ f: y5 A* e( T( C7 _$ K/ L1 B7 M9 t1 ]+ |9 Q) D7 Z( R+ Z3 v$ J$ ?% N9 i! d- X, f3 F5 X3 t) r: U$ s/ e! D# A! d* w5 u# J) G4 h7 ~* x& i6 L6 j0 Z0 @2 \6 M, d K% Y9 M7 x+ v* l) H' i0 \ / W8 R6 N! A3 O4 J+ Q& D0 U7 y. {) k2 j: s/ ?! G3 P i/ W! r3 U! H/ n% N/ r: T8 F' ]$ t9 c- ]6 i) x' T$ y9 Y- N, P0 H5 R队送全国一等1队、二等0队,,赛区一等1队、二等3队)院校名:22福建农林大学金山学院(A2队送全国一等0队、二等0队,赛区一等0队、二等2队;B2队送全国一等0队、二等0队,赛区一等2队、二等0队)院校名:23福建交通职业技术学院(C1队送全国一等0队、二等0队,赛区一等0队、二等0队;D3队送全国一等1队、二等0队,赛区一等0队、二等1队)院校名:24福建信息职业技术学院(C4队送全国一等0队、二等0队,赛区一等1队、二等0队;D无)队、二等0队,赛区0队)队;D2队送全国一等0队、二等0队,赛区一等0队、二等1队)(C5队送全国一等0队、二等0队,赛区一等1队、二等1队;D2队送全国一等0队、二等0队,赛区一等1队、二等0队)队;D无)院校名:31厦门海洋职业技术学院(C2队送全国一等0队、二等0队,赛区一等0队、二等1队;D无)院校名:32福建林业职业技术学院(C2队送全国一等0队、二等0队,赛区一等0队、二等1队;D无)。
中南大学acm2010校赛题目
The 4th Collegiate Programming Contest ofCentral South UniversityProblem SetHosted by School of Information Science and EngineeringApril 25, 2010This problem set contains 11 problems; pages are numbered from 1 to 19.Problem A. AvatarDescriptionIn the planet Pandora, Jake found an old encryption algorithm. The plaintext, key and ciphertext are all four decimal numbers and all greater than 0. The way to get the ciphertext from the plaintext and the key is very simple: the ciphertext is the last four digits of the product of the plaintext and the key (for example: the plaintext is 2010 and the key is 4024, and then the product is 8088240. So the ciphertext is 8240). Note that the plaintext and the key don‟t have leading 0, while the ciphertext might have. Now given the plaintext and the key, you are asked to figure out the ciphertext for Jake quickly.InputThe first line is an integer T, which presents the number of test cases. Then there are T lines, each line has two integers, the first integer is the plaintext and the second is the key.OutputFor each test case, output the ciphertext.Sample Input22010 40241234 1111Sample Output82400974Problem B. Simple Line Editor DescriptionEarly computer used line editor, which allowed text to be created and changed only within one line at a time. However, in line editor programs, typing, editing, and document display do not occur simultaneously (unlike the modern text editor like Microsoft Word). Typically, typing does not enter text directly into the document. Instead, users modify the document text by entering simple commands on a text-only terminal.Here is an example of a simple line editor which can only process English. In addition, it has two commands. …@‟ and …#‟. …#‟ means to cancel the previous letter, and …@‟ is a command which invalidates all the letters typed before. T hat is to say, if you want type “aa”, but have mistakenly entered “ab”, then you should enter …#a‟ or …@aa‟ to correct it. Note that if there is no letter in the current document, …@‟ or …#‟ command will do nothing.InputThe first line contains an integer T, which is the number of test cases. Each test case is a typing sequence of a line editor, which contains only lower case letters, …@‟ and …#‟.OutputFor each test case, print one line which represents the final document of the user. There would be no empty line in the test data.Sample Input2ab#aab@aaSample OutputaaaaProblem C. 真三国无双Description真三国无双是魔兽的一个游戏,该游戏是以中国三国的历史背景而制作的,该游戏是5 V 5的游戏模式,敌对双方各5个英雄,推掉了对方的大本营就算取得了胜利。
NUPT_ACM_2010_Asia_Contest_20101014
Time Limit: 1000MS Memory Limit: 32767K分礼物描述:出去春游一趟回来后,ZZ带回来很多礼物。
每个礼物有一个价值。
他将所有礼物排成一列,并将这些礼物分成M份,每一份是由一个或多个礼物组成的连续的序列。
他要将这M份礼物分别送给他的M个朋友。
这样的划分有个要求,那就是使总价值最大的片段的总价值尽量小。
输入:第一行为两个整数N(1<=N<=100,000),M(1<=M<=N)。
接下来N行按顺序给出每个物品的价值v(1<=v<=10,000)输出:输出为一个整数,为满足题目条件的最大的连续序列的总价值样例输入:7 5100400300100500101400样例输出:500提示:满足题意的一个划分如下所示:(100 400) (300 100) (500) (101) (400)Time Limit: 1000MS Memory Limit: 32767K组合问题描述:一个组合 C(n,m)=n!/m!/(n-m)!.告诉你n和m,你需要计算C(n,m).输入:多组数据。
读到n=0 m=0结束每组数据输入两个数字,n,m(0<=m<=n<30)输出:每组数据对应输出 C(n,m) .保证答案小于 2147483648.样例输入:3 14 20 0样例输出:36Time Limit: 1000MS Memory Limit: 32767K费解的开关描述:你玩过“拉灯”游戏吗?25盏灯排成一个5x5的方形。
每一个灯都有一个开关,游戏者可以改变它的状态。
每一步,游戏者可以改变某一个灯的状态。
游戏者改变一个灯的状态会产生连锁反应:和这个灯上下左右相邻的灯也要相应地改变其状态。
我们用数字“1”表示一盏开着的灯,用数字“0”表示关着的灯。
下面这种状态1011101101101111000011011在改变了最左上角的灯的状态后将变成:0111111101101111000011011再改变它正中间的灯后状态将变成:0111111001110011010011011给定一些游戏的初始状态,编写程序判断游戏者是否可能在6步以内使所有的灯都变亮。
2010ACMICPC亚洲赛区 成都预选赛题目Ensure
Problem E.Ensure No AbsenceTime limit:1secondMemory limit:256megabytesIn the year2022,the scu acmers decide to hold a party,and most of the old scu acmers have recieved the invitation,including onmylove,tanlinghang,and zsasuke(the original members of the scu isap team). As they graduated from scu ten years ago,they live in different cities currently.They are all very arrogant, and each believes himself to be the best runner among all the scu acmers.To prove this,they all decide to spend days running to the destination(the city where the party is to be held),and to save energy, they each will choose the shortest route for himself(there may exist more than one shortest routes,in such cases,they would choose one of them at random).But this lead to a series of problems:they may stop to rest occasionally,and once they meet each other on one same road,they will stop running and begin to argue for days who is the best runner,entirely forgetting the party.The scu leaders are all very considerate,they don’t want the absence of anyone,so they will select a suitable city to hold the party to guarantee that the isap team members will not meet each other on their way to the party.But they are all very busy,so the task is assigned to you,brilliant icpcer!InputProcess till EOF.Each case contains two positive integers n,m(3≤n≤3000,1≤m≤200000)in thefirst line.Indicating the number of cities to choose from,and the number of the edges(onmylove lives in city1,tanlinghang lives in city2,and zsasuke,city3),then m lines follow,each line contains3positive integers a,b,c (1≤a,b≤n,1≤c≤10,b=a,there is at most one edege between two distinct cities)indicating that it takes each of them(onmylove,tanlinghang,or zasuke)c days to get to city b from city a,or c days to get to city a from city b if running at full speed(from this,you know they all run at the same speed,so there is no point in arguing at all,but they are all very unreasonable!)OutputFor each case,if there are no cities satisfying the conditions above,you should puts“impossible”in a single line,otherwise,you should print a number n(the number of cities satisfying the conditions)in a line,the second line contains n integers,meaning the ids of the cities satisfying the conditions,and besides,sort them in increasing order.Sample input and outputinput output32 121 231 43 142 241 343 55 152 452 523 245 3411 2 1 4 1 5HintIn thefirst case,we could not choose city3to hold the party,since tanlinghang may rest on the roadbetween2and3,so onmylove may meet tanlinghang on the same road and fall into arguing.so we choose city2to hold the party.In the third case,we could not choose city4for the same reason.suppose we choose city4,the shortest route for onmylove is1–5–4,and the shortest route for tanlinghang is2—5—4or2—4,if tanlinghang choose the route2—5—4,he may meet onmylove on the road between5and4,and arguing is inevitable. Problemsetterzsasuke。
2010acm
The History Of CUGB ACM
09年哈尔滨赛区
信息工程学院 ACM/ICPC 集训队
The History Of CUGB ACM
信息工程学院 ACM/ICPC 集训队
信息工程学院 ACM/ICPC 集训队
信息工程学院 ACM/ICPC 集训队
The History Of CUGB ACM
The History Of CUGB ACM
08年合肥赛区
队员:王皓玉、王锦鹏、崔珂瑾 教练:王栋 中间:ICPC亚洲区主席,黄金雄
信息工程学院 ACM/ICPC 集训队
The History Of CUGB ACM
08年杭州赛区
队员:李志强、王锦鹏、曾富涔
信息工程学院 ACM/ICPC 集训队
» 2011世界总决赛:埃及
信息工程学院 ACM/ICPC 集训队
2010 World Final Rank
» » » » » » » » » » » » » » » 1 3 6 10 11 上海交通大学 台湾大学 清华大学 中山大学 复旦大学 北京邮电大学 北京大学 北京交通大学 香港大学 东南大学 电子科技大学 武汉大学 西安电子科技大学 浙江大学 …… 冠军 金牌 银牌 铜牌 铜牌
信息工程学院 ACM/ICPC 集训队
Responsibility
» 例赛制度: » 周赛和月赛保证队员的竞技水平,加强队 员的算法深度。
» 暑期集训: » 高强度训练,多校合练。为ACM/ICPC亚洲 预选赛最后冲刺。 » 常年赛事: » 全年参加多场邀请赛、商业公司公开赛
信息工程学院 ACM/ICPC 集训队
信息工程学院 ACM/ICPC 集训队
Resource
ACM程序大赛选拔初赛试题 - 参考答案
a[n]=n+1; int x=0; while(n>=1) {
if(a[i]!=0) {
if(x%2==0) { if(n==2) printf("\n"); printf("%d ",a[i]); n--; a[i]=0; } x++; } if(i+1>=size) i=0; else i++; } }
4、解方程 难度系数:★★☆☆☆
(注意此题只供 10 级的同学,08,09 级的同学请做第三题) 题意:形如 ax2+bx+c=d 的方程。其中 a,c,d 均为整数,b 为正整数。请你用计算机求出对 应的 x 的值(只考虑实数根)。
输入:依次输入 a,b,c,d 的值。注意:只要输入一组数据。用空格隔开。
char temp,str[10]; scanf("%s",str);
for(int i=0;i<9;i++) for(int j=i+1;j<10;j++) if(str[i]>str[j]) { temp=str[i]; str[i]=str[j]; str[j]=temp; }
cout<<str<<endl; }
输入:依次输入函数的四个系数中的 a,b,c,d 的值。用空格隔开。
输出:如果有极值点则全部输出,结果保留两位小数,格式为“(x1=#,y1=#) (x2=#,y2=#)”,如果没有则输入“no answer。
Noip2010提高组初赛试题及详细解析(C语言)
第十六届全国青少年信息学奥林匹克联赛初赛试题(提高组C 语言二小时完成)●● 全部试题答案均要求写在答卷纸上,写在试卷纸上一律无效●●一.单项选择题(共10题,每题1.5分,共计15分。
每题有且仅有一个正确选项。
)1.与16进制数A1.2等值的10进制数是(C )A.101.2B.111.4C.161.125D.177.25解析1:看进制转换的表原式等于10(A)×161+1×160+2×16-1=161.1252.一个字节(byte)由()个二进制位组成。
A.8B.16C.32D.以上都有可能解析2: 一个字节(byte)由( 8 )个二进制位组成,即一个字节等于八比特3.一下逻辑表达式的值恒为真的是()A.P∨(┐P∧Q)∨(┐P∧┐Q)B.Q∨(┐P∧Q)∨(P∨┐Q)C.P∨Q∨(P∧┐Q)∨(┐P∧Q)D.P∨┐Q∨(P∧┐Q)∨(┐P∧┐Q)解析3:各个逻辑符号的问题,可以进行一定的假设。
设P,Q都为假"∨" 表示"或" 相当于生活中的“或者”, "∧" 表示"与". 相当于生活中说的“并且” "┐"表示"非". 真或真为真:真或假为真:假或假为假:假与假为假,假与真为假,真与真为真。
真为真,非真为假,假为假,非假为真。
4.Linux下可执行文件的默认扩展名为()A.exe Baaa C.dll D.都不是解析4:Linux下常见的文件名后缀、文件类型1、系统文件*.conf配置文件*.rpm rpm包*.a 一种存档文件*.lock 一种琐文件*.~ 备份文件*. 隐藏文件2:程序或脚本*.c c语言源程序文件*.cpp c++语言源程序*.h c或c++头文件*.o 程序对象文件*.pl perl语言源程序*. php php语言源程序*.tcl tcl脚本程序*.so/.lib 库文件*.sql sql语言文件3:格式文件*.txt 无格式的ascii码文件*.html/.htm 静态web页*.ps postScipt文件*.au 一种声音文件*.wav 一种声音文件*.xpm一种图像文件*.png一种图形,图像文件4:存档与压缩文件*.tar tar归档文件*.Z/.gz/.bz2压缩文件*.tar.gz/.tgz/.tar.bz2/.tbz为压缩后的tar 包linux本身是没有扩展名这个概念的。
ACM竞赛第十题
10-20-30有一种称为10—20—30的用52张不考虑花色的纸牌游戏。
人头牌(K、Q、J)的值是10,A的值是1,任何其他牌的值是它们的面值(如2、3、4等)。
牌从牌堆的顶端发起。
你先发7张牌,从左至右形成7组。
当给最右边一组发了一张牌后,下一张牌就应发最左边的一组。
每给一组发一张牌时,查看这组牌的以下三张牌的组合的总和是否为10、20或30:前两张和最后一张,第一张和最后二张,或最后三张。
如果是这样,就抽出这三张牌并将其放在牌堆的底部。
对于这个问题,总是按上面给出的顺序查看牌。
按牌在组中出现的顺序将它们取出并放在牌堆的底部。
当抽出三张牌时,又有可能出现三张可以抽出的牌。
如果是这样,再将它们抽出。
如此重复直至再也不能从这组牌抽出符合条件的牌为止。
举例来说,假设有组牌含5、9、7、3,5是第一张牌,然后发出6。
前两张牌加最后一张牌(5+9+6)等于20。
抽出这三张牌后这组牌成为7、3。
而牌堆的最底部变成6,6上面的一张牌是9,9上面的一张牌是5(如图6.2-1)。
图6.2-1如果发的不是6而是Q,那么5+9+10=24,5+3+10=18,但7+3+10=20,因此最后三张牌可以抽走,剩下5、9(如图6.2-2)。
图6.2-2如果有一组只含有三张牌且这组牌的和为10、20或30,那么这组牌被抽走后就“消失”了。
这就是说,随后的发牌将跳过现在成为空的这组牌的位置。
当所有牌组都消失,你就获胜。
当你无牌可发时,你游戏失败。
当前两种情况都不发生时,出现平局。
编写一个程序,将初始的牌堆作为输入,完成10—20—30游戏。
输入每组输入由52个整数组成,由空格和/或行结束(end 0f line)分开。
整数表示初始牌堆的面值。
第一个整数是牌堆的最顶端的牌。
在最后一张牌后输入0标志输入结束。
输出对每组输入,输出游戏结果是胜、负还是平局,并输出游戏结果决定前所发的牌数。
(假如游戏状态发生重复,意味着平局)使用“输出范例”部分中表明的格式。
2010ACM程序设计亚洲域哈尔滨初赛试题
DescriptionIn our high school, we had learn a theorem: "if two numbers have the invariablenes sum, they will get the maximum product when they are equal", on the side, another is "if two numbers have the invariablenes product, they will get the minimum sum when each of them equals the other one".Now, I will give you a same equations, you should give me the result that you can get from the above theorems.InputThere are several test cases. Each case contains a string, it is an equation, and its length is less than 1024. In the equation, the variants are different, and only contain lower letters, the number is a legality double number variants , operator sign and number are separate by spaces.OutputOutput the result that you can get from the two theorems(the result is rounded to two decimal digits). And the result should express as ranges, ranges will be united by letter "U", each range have a left value and a right value and the range should begin with "(" and end with ")", if the value is infinite it should be replace with "inf", all numbers, signs, values should separate by space.Sample Inputx + y = -4.00a *b = 4.0401s * t = -0.000i * j = 0.01Sample Output(-inf < x * y <= 4.00)(-inf < a + b <= -4.02) U (4.02 <= a + b < +inf)(-inf < s + t < +inf)(-inf < i + j <= -0.20) U (0.20 <= i + j < +inf)DescriptionOne day,XiaoA is calculating an upright expression(A is not zero):ABCD*) 9------DCBAHe found the answer is ABCD=1089, and then, he think about a hard question (it is below), what is the answer?ABCDEFGH...RST*) X--------------------------TSR...HGFEDCBAInputThere are several test cases. Each case contains two integer L and X, L indicates the length of the variant above and X is the value of the factor (0<L<=1024,0<=X<=9).OutputYou should output the solution for the upright expression, if there is more than one solution, you should output the minimum solution, and if there is not solution, you should output "No solution"Sample Input4 96 53 1Sample Output1089No solution101HintThe different letters can indicate same number.DescriptionWe define that if Integer X and N satisfy that : X*X <= N < (X+1)*(X+1), X can be called as the root of N. Now, I give you a integer N, you should tell me what is the root of it, and the result is binary digits.InputThere are several test cases, each case contains an Integer N(0<=N<=10^200) # indicates the end of input.OutputOutput the root of input in binary digits.Sample Input456100#Sample Output1010101010DescriptionHank was potty about Rubik’s cube; Rubik's cube is an intelligence toy. Hank spent hours each day exercising, so the Rubik's cube breaks frequently. Hank had to buy new Rubik’s cube often.Today, hank buys a new Rubik's cube, and it is chaotic. Can you help him to find the colors in opposite faces?InputThere are several test cases; the first integer T indicates the number of test cases. Each case includes an integer N and six blocks, N indicates the rank of the Rubik’s cube(1<=N<=11), and the six blocks indicate the colors of the six faces of the Rubik’s cube.OutputOutput the case number and the pairs of colors in order of [B, G, O, R, W, Y], like this:B-[opposite-face-color]G-[opposite-face-color]O-[opposite-face-color]R-[opposite-face-color]W-[opposite-face-color]Y-[opposite-face-color]After each case there is a blank line.Sample Input12YYYYOOOOBBBBRRRRGGGGWWWWSample OutputCase #1:B-GG-BO-RR-OW-YY-WDescriptionXiaoz' teacher gives him a very hard problem. Teacher gives him two strings S, T, and asks xiaz judge that if string S is a substring in string T, xiaoz is exultingly, because The KMP algorithm is suitable, but then teacher says, if string T has a substring which can become string S by edit some characters, it is also accept. This problem makes xiaoz be headache, so he ask for your help.InputThere are several test cases. In each case, the first line contains an integerk(K<=100), indicate the maximum times you can edit with string T. Then the second line contains a string, indicate string S, and the third line contains a string, indicate string T. Both of lengths of the strings will be less than 10010.OutputIf the string S can be the substring of string T by editing string T and no more than K times then print "YES!" else print "NO!".Sample Input2annualannealingSample OutputYES!DescriptionGeometry transformation is a widely used technology in computer graphics. The problem you need to solve today is to compute the area of the cubic projection. Refer to the following Fig.1, the projection of the cube on face xoy is shown as the grey area on xoy.Fig.1 A simple example of projectionIn graphical processing, rotation around a line is a foundational operation. Fig.2 gives an example. In Fig.2, the right cube is obtained by rotating the left cube counterclockwise around vector L by 180 degrees.Fig.2 A rotation exampleGive a cube C, a vector L and an angle A, your job is to calculate the area of the projection of C on face xoy after rotating cube C counterclockwise around vector L by angle A degree. The cubes are always given with edge w parallel to x-axis, edge h parallel to y-axis and edge l parallel to z-axis, same as Fig.1. So a known side length and a known coordinate of vertex p can determine the cube. Vertex p is the closest vertex to point o.InputWe test the problem in many cases. The first line is the number of test cases. In each case, the side length of the cube and the coordinate of vertex p are give first. Following that is the vector L. vector L is given as the form of start coordinate and the end coordinate. Finally, the angle A is presented. All the numbers given are integers and are in interval [-10000, 10000].OutputThe output consists of the areas of all the projection. The results must be round to 2 decimal numbers.Sample Input2205 5 50 15 15 -15 15 15315100 0 00 0 0 10 10 10275Sample Output565.69148.80DescriptionNowadays, the society is developed economy, and consumes a lot of resources, especially the oil.Now, some pipes transport oil from city A to city B for the consuming of city B, but the distance from city A to city B is too long, there are many transfer stations, and K levels among the transfer stations, city A and city B, city A is level 1, and city B is level K, and the levels of transfer stations are between 2 and k-1, and only the transfer stations which has consecutive levels can be connected.We know all the volumes of the pipes, the citymaster of city B employs builders to expand some pipes, avoid the leavings in pipes, but the builders hope the less expandedness the better, achieve the require of the citymaster of city B minimally. The citymaster of city B want know the values of the flow before and after the expansion.In figure, the values of the flow before and after the expansion is 2 and 4.InputThere are several testcases, each case is a block, there are five integers in the first line,N,M,K,A,B indicate the number of nodes is N,the number of edges is M,the number of levels is K, the source point and the join point. the second line contains N integers, the i-th number indicates the level of the i-th transfer station. then M lines follow, each line contains three integers s,t,c, indicate the volume of the pipe from point s to point t icc.(2<=N<=1000,1<=M<=50000,1<=A,B<=N,1<=c<=100) there is no rings and no refrain edges.Process to the end of file.OutputEach case output two lines, each line include an integer indecates the values of the flow before and after the expansion.Sample Input4 3 4 1 41 2 3 41 2 22 3 33 4 4Sample Output24。
2010数学建模竞赛A题获奖作品答案
承诺书我们仔细阅读了中国大学生数学建模竞赛的竞赛规则.我们完全明白,在竞赛开始后参赛队员不能以任何方式(包括电话、电子邮件、网上咨询等)与队外的任何人(包括指导教师)研究、讨论与赛题有关的问题。
我们知道,抄袭别人的成果是违反竞赛规则的, 如果引用别人的成果或其他公开的资料(包括网上查到的资料),必须按照规定的参考文献的表述方式在正文引用处和参考文献中明确列出。
我们郑重承诺,严格遵守竞赛规则,以保证竞赛的公正、公平性。
如有违反竞赛规则的行为,我们将受到严肃处理。
我们参赛选择的题号是(从A/B/C/D中选择一项填写):A我们的参赛报名号为(如果赛区设置报名号的话):A甲1105所属学校(请填写完整的全名):中国海洋大学参赛队员 (打印并签名) :1.刘润华2.赵利娜3.刘泽指导教师或指导教师组负责人(打印并签名):指导教师组日期:2010年9月13日赛区评阅编号(由赛区组委会评阅前进行编号):编号专用页赛区评阅编号(由赛区组委会评阅前进行编号):全国统一编号(由赛区组委会送交全国前编号):全国评阅编号(由全国组委会评阅前进行编号):储油罐的变位识别与罐容表标定摘要本文研究的是罐体变位对罐容表的影响。
通过建立空间直角坐标系,利用体积的二重积分求出进油量,得出罐内油位高度与储油量的关系。
对于问题一,我们分别对储油罐无变位和倾斜角为 4.1α= 的纵向变位两种情况分别进行研究,对罐体无变位情况我们建立直角坐标系求出进油量的底面进行求解即可得到罐内油的体积;对于有倾斜积,利用柱体的体积公式V S h=底角的情况我们先利用定积分求出沿罐外壁方向切面的面积,再根据油浮子示数与实际油面与罐底之间的关系,沿油罐外壁对切面面积进行积分求出罐内油的总体积。
对于问题二,我们首先根据油罐中的液面分布情况,将问题分为三种情况,可是考虑到实际因素,只对液面与两端球冠有交点并且不接触到油罐的顶端这种情况进行考虑。
又因为储油罐的横向和纵向的变位在实际中非常小,所以将此问题两端球冠处的液面分布进行平行简化,进而针对两球冠和中间的柱体分别进行积分,进而建立储油罐内的容量V与桶内油浮子所表示的液面高度h之间的数学模型。
ACM程序设计竞赛例题[1]
备战ACM 资料习题1.0-1 背包问题在0 / 1 背包问题中,需对容量为 c 的背包进行装载。
从n 个物品中选取装入背包的物品,每件物品i 的重量为wi ,价值为pi 。
对于可行的背包装载,背包中物品的总重量不能超过背包的容量,最佳装载是指所装入的物品价值最高。
程序如下:#include <stdio.h>void readdata();void search(int);void checkmax();void printresult();int c=35, n=10; //c :背包容量;n:物品数int w[10], v[10]; //w[i] 、v[i]:第i 件物品的重量和价值int a[10], max; //a 数组存放当前解各物品选取情况;max:记录最大价值//a[i]=0 表示不选第i 件物品,a[i]=1 表示选第i 件物品int main(){readdata(); // 读入数据search(0); // 递归搜索printresult(); }void search(int m){if(m>=n)checkmax(); // 检查当前解是否是可行解,若是则把它的价值与max比较else{a[m]=0; // 不选第m 件物品search(m+1); // 递归搜索下一件物品a[m]=1; // 不选第m 件物品search(m+1); // 递归搜索下一件物品}}void checkmax(){int i, weight=0, value=0;for(i=0;i<n;i++){if(a[i]==1) // 如果选取了该物品{weight = weight + w[i]; // 累加重量value = value + v[i]; // 累加价值}}if(weight<=c) // 若为可行解if(value>max) // 且价值大于maxmax=value; // 替换m ax}void readdata(){int i;for(i=0;i<n;i++)scanf("%d%d",&w[i],&v[i]); // 读入第i 件物品重量和价值 }void printresult(){printf("%d",max);}2.装载问题是c1、c2,n 个集装箱,重量是wi (i=1⋯n),且所有集有两艘船,载重量分别c1+c2。
全国信息学奥林匹克联赛(NOIP2010)复赛_普及组_解题报告(pascal)
全国信息学奥林匹克联赛(NOIP2010)复赛_普及组_解题报告(pascal)全国信息学奥林匹克联赛(NOIP2010)复赛普及组解题报告1.数字统计(two.pas/c/cpp)【问题描述】请统计某个给定范围[L, R]的所有整数中,数字2 出现的次数。
比如给定范围[2, 22],数字2 在数2 中出现了1 次,在数12 中出现1 次,在数20 中出现1 次,在数21 中出现1 次,在数22 中出现2 次,所以数字2 在该范围内一共出现了6次。
【算法思路】枚举法,依次将L至R转化为字符串,查找当中有多少个”2”.【程序代码】program two;varl,r:1..10000;i,j,h,c:longint;s:string;beginassign(input,'two.in');assign(output,'two.out');reset(input);rewrite(output);readln(l,r);c:=0;for i:=l to r dobeginstr(i,s);h:=length(s);for j:=1 to h doif s[j]='2'then c:=c+1;end;writeln(c);close(input);close(output);end.2.接水问题(water.pas/c/cpp)【问题描述】学校里有一个水房,水房里一共装有m 个龙头可供同学们打开水,每个龙头每秒钟的供水量相等,均为1。
现在有n 名同学准备接水,他们的初始接水顺序已经确定。
将这些同学按接水顺序从1到n 编号,i号同学的接水量为w i。
接水开始时,1 到m 号同学各占一个水龙头,并同时打开水龙头接水。
当其中某名同学j 完成其接水量要求w j 后,下一名排队等候接水的同学k马上接替j 同学的位置开始接水。
这个换人的过程是瞬间完成的,且没有任何水的浪费。
全国青少年信息学奥林匹克竞赛(NOI)2010 试题
【输出格式】
输出文件 plane.out 由两行组成。 第一行包含 n 个整数,表示一个可行的起飞序列,相邻两个整数用空格分隔。 输入数据保证至少存在一个可行的起飞序列。如果存在多个可行的方案,输出任 意一个即可。 第二行包含 n 个整数 t1, t2, „, tn,其中 ti 表示航班 i 可能的最小起飞序 号,相邻两个整数用空格分隔。
【运行时限】
1 秒。
【运行空限】
512M。
Copyright © 2010 中国计算机学会, 版权所有.
全国青少年奥林匹克竞赛(NOI)2010 试题
超级钢琴
【问题描述】
小 Z 是一个小有名气的钢琴家,最近 C 博士送给了小 Z 一架超级钢琴,小 Z 希望能够用这架钢琴创作出世界上最美妙的音乐。
这架超级钢琴可以弹奏出 n 个音符,编号为 1 至 n。第 i 个音符的美妙度为 Ai,其中 Ai 可正可负。
小 Z 搜集到了世博园的地图,她发现从整体上看世博园是一块非常狭长的区 域,而每一个展馆占用了其中一个几乎相同大小的方块。因此可以将整个园区看 成一个 n × m 的矩阵(n≤3),其中每一个格子为一个主题展馆。
输出文件为 piano.out。 输出文件只有一个整数,表示乐曲美妙度的最大值。
- 1、下载文档前请自行甄别文档内容的完整性,平台不提供额外的编辑、内容补充、找答案等附加服务。
- 2、"仅部分预览"的文档,不可在线预览部分如存在完整性等问题,可反馈申请退款(可完整预览的文档不适用该条件!)。
- 3、如文档侵犯您的权益,请联系客服反馈,我们会尽快为您处理(人工客服工作时间:9:00-18:30)。
Output
Output one line for each test case. It contains an integer indicating the least number of moves needed for the knight to reach its destination. Output "IMPOSSIBLE" if the knight may never gets to its target position.
Sample Input
2 0066 5 12
~1~
21 22 13 31 0055 2 12 21
Sample Output
3 IMPOSSIBLE
~2~Biblioteka Problem B. Nubulsa Expo
Description
You may not hear about Nubulsa, an island country on the Pacific Ocean. Nubulsa is an undeveloped country and it is threatened by the rising of sea level. Scientists predict that Nubulsa will disappear by the year of 2012. Nubulsa government wants to host the 2011 Expo in their country so that even in the future, all the people in the world will remember that there was a country named “Nubulsa”. As you know, the Expo garden is made up of many museums of different countries. In the Expo garden, there are a lot of bi-directional roads connecting those museums, and all museums are directly or indirectly connected with others. Each road has a tourist capacity which means the maximum number of people who can pass the road per second. Because Nubulsa is not a rich country and the ticket checking machine is very expensive, the government decides that there must be only one entrance and one exit. The president has already chosen a museum as the entrance of the whole Expo garden, and it ’s the Expo chief directory Wuzula ’s job to choose a museum as the exit. Wuzula has been to the Shanghai Expo, and he was frightened by the tremendous “people mountain people sea” there. He wants to control the number of people in his Expo garden. So Wuzula wants to find a suitable museum as the exit so that the “max tourists flow” of the Expo garden is the minimum. If the “max tourist flow” is W, it means that when the Expo garden comes to “stable status ”, the number of tourists who enter the entrance per second is at most W. When the Expo garden is in “stable status ”, it means that the number of people in the Expo garden remains unchanged. Because there are only some posters in every museum, so Wuzula assume that all tourists just keep walking and even when they come to a museum, they just walk through, never stay.
~3~
there are 5 museums and 5 roads connecting them, and the No. 1 museum is the entrance. The next M lines describe the roads. Each line contains three integers X, Y and K, representing the road connects museum X with museum Y directly and its tourist capacity is K. Please note: 1<N<=300, 0<M<=50000, 0<S,X,Y<=N, 0<K<=1000000
Input
The first line contains an integer T ( T < 20) indicating the number of test cases. Each test case begins with a line containing four integer: fx fy tx ty(-5000<=fx,fy,tx,ty<=5000). The knight is originally placed at (fx, fy) and (tx, ty) is its destination. The following line contains an integer m(0<m<=10), indicating how many kinds of moves the knight can make. Each of the following m lines contains two integer mx my(-10<=mx,my<=10; |mx|+|my|>0), which means that if a knight stands at (x,y), it can move to (x+mx,y+my).
Sample Input
551 125 246 137 343 5 1 10 000
Sample Output
8
~4~
Problem C. Shade of Hallelujah Mountain
Description
On the planet Pandora, huge rocks are floating in the sky. Despite the beautiful scenery, these rocks bring some critical problem: they block the sunshine, and shade on the ground. Na'vi ("people" living on the planet) cannot grow plants in the shade because of the lack of sunshine. In order to predicate the amount of food they can get, they have to calculate the area of the shade. Let’s assume the "sun" as a point-source of light, and the ground as a infinite flat plane. Also, to simplify this problem, assume all rocks are convex polyhedrons. Now here is a mathematical problem. Given the position of the point-source of light, the position of a convex polyhedron and the position of an infinite plane, you are required to calculate the area of the shade. Please note that light travels in a strictly straight line and the light source and the convex polyhedron are on the same side of the plane. The light source is not placed in the convex polyhedron, nor on the polyhedron or on the plane.
Problem A. Knight's Problem
Description
You must have heard of the Knight's Tour problem. In that problem, a knight is placed on an empty chess board and you are to determine whether it can visit each square on the board exactly once. Let's consider a variation of the knight's tour problem. In this problem, a knight is place on an infinite plane and it's restricted to make certain moves. For example, it may be placed at (0, 0) and can make two kinds of moves: Denote its current place as (x,y), it can only move to (x+1,y+2) or (x+2,y+1). The goal of this problem is to make the knight reach a destination position as quickly as possible (i.e. make as less moves as possible).