Another Training Contest
Aug. 8th, 2015
An NOIP2015 Training Contest Prepared by hhw && mxh1999
A very tough contest, right?
Time: 8:00 a.m. ~ 11:30 a.m.
Number of Prob.s: 3
Result:
I didn't know why I became the last contestant... T_T
A car starts with velocity v1 and ends with velocity v2. The car can change its velocity immediately in the area of ±d. There is t that shows total time the car spends on the road. Then what's the longest distance can the car travel? Input: v1 v2 t d Output: S(indicating the longest distance) Sample Input: 5 6 4 2 Sample Output: 26 Explanations: 5+7+8+6=26 (+2 +1 -2) For all 20 testcases: 1<=v1,v2<=100; 2<=t<=100; 0<=d<=10; It is confirmed that there is only one fixed answer for each of the testcases.
Prob. A was considered as "a bottle of purified water", but I didn't get 100 pts.. In fact I had never realized that until I got the result. Why, only 60 pts.?
After comparing my program with Mars_cat's, I was perfectly shocked! I just made a mistake in searching for the answer, which led to missing of 40 pts. because of WA.
#include <iostream> #include <cstdio> #include <cstdlib> #include <cmath> #include <ctime> #include <cstring> #include <algorithm> #define DONS 1010 using namespace std; int v1,v2,t,d,i,j,sum,f[DONS],g[DONS]; int main() { freopen("trip.in","r",stdin);freopen("trip.out","w",stdout); scanf("%d%d%d%d",&v1,&v2,&t,&d); for(i=1;i<=t;i++){f[i]=v1+(i-1)*d;g[i]=v2+(t-i)*d;} for(i=1;i<=t;i++)if(f[i]-g[i]==0 || (f[i+1]-g[i+1])*(v1-v2)<0)break; for(j=1;j<=t;j++)sum+=min(f[j],g[j]);/*Mistake: for(j=1;j<=i;j++)sum+=f[j];for(j=i+1;j<=t;j++)sum+=g[j];*/ printf("%d\n",sum); fclose(stdin);fclose(stdout);return 0; }
Wondering why I was wrong? Here is an example: (trip8.in)
2 1
2 2
When testing my first version of code, I got WA because my output was 6. But, obviously, the standard answer is 3.
Carelessness led to failure? Now I am sure about that...
Prob. B & Prob. C were difficult. Waiting for discussion to solve.
I am always a WEAK DISH, so I haven't correct the other two programs into std's yet.
Just like my Chinese nickname, participating in the unscientific contest is exactly "getting a bottle of Soy Sauce".
(Comments are welcomed and it is recommended that you reply in English.)
Fri, 12 Apr 2019 17:32:29 +0800
How do I use cookies or chrome in chrome? enable cookies chrome You can learn to go here and see it in a very simple way.
Sat, 29 Jun 2019 16:15:46 +0800
How do I use cookies or chrome in chrome? enable cookies chrome You can learn to go here and see it in a very simple way.
Sat, 20 Mar 2021 13:25:34 +0800
Tue, 18 May 2021 18:52:52 +0800
I simply want to tell you that I am new to weblog and definitely liked this blog site. Very likely I’m going to bookmark your blog . You absolutely have wonderful stories. Cheers for sharing with us your blog.
Sat, 10 Jul 2021 01:50:52 +0800
The Hot and sexy Girls are here to give all sorts of fun and enjoyment here.
Sat, 10 Jul 2021 16:59:34 +0800
I read this article. I think You put a lot of effort to create this article. I appreciate your work.
Sat, 17 Jul 2021 14:50:36 +0800
The Girls here will give all sorts of fun.
Mon, 04 Oct 2021 19:56:25 +0800
This site gives a brilliant and informative message to us.
Wed, 04 May 2022 20:08:13 +0800
I am interested in such topics so I will address page where it is cool described https://6243ef2e8c96c.site123.me/
Wed, 04 May 2022 20:10:13 +0800
This is such a great web page with such wonderful content. 6243ef2e8c96c.site123.me/Guys to make your day I have the best link here
Wed, 04 May 2022 20:13:33 +0800
Hi, This is a High-Profile VIP Independent girl To Your lusty Desires with a curvy and juicy body, To visit me just click on the link.
Wed, 04 May 2022 20:14:34 +0800
Tremendous, Nice post and the content is very well with simplicity so may everyone read and get it easily.
Wed, 04 May 2022 20:15:37 +0800
Fantastic post on this web page but luckly, I am here for those people who want Escorts who may fulfill their sexual desires. To take advantage visit the link.
Wed, 04 May 2022 20:17:16 +0800
This post has really great knowledge with getable words, I appreciate the person who worked on it, Keep it continue, To get something Extraordinary click on the link.
Wed, 04 May 2022 20:18:58 +0800
Nice post, Amazing content you have written here, I personally liked it, Great work and i personally shared it with my friend.
Wed, 04 May 2022 20:20:52 +0800
Hey guys, There is something Extra and far better even you didn't think about it, To check just click on the link.
Wed, 04 May 2022 20:21:45 +0800
wow, This is such an informative and unique page but guys I have also something unique links.
Tue, 09 Aug 2022 19:42:47 +0800
You can view, download, and print the present or old duplicate bills, but bill downloading for BSNL landline or broadband restricted to 12 months usage or six issued telephone bills. BSNL Bill View Nowadays many customers can do BSNL bill payment at quick pay portal on getting SMS to their mobiles, where sometimes the customer wants the copy for which also paid. At that time they are not having due to some common reasons, It is like, misplaced the BSNL bill copy or didn’t get the invoice through post or courier.
Thu, 25 Aug 2022 18:42:18 +0800
Meghalaya Board Model Paper 2023 Class 8 Pdf Download with Answers for Bengali Medium, English Medium, Hindi Medium, Urdu Medium & Students for Small Answers, Long Answer, Very Long Answer Questions, and Essay Type MBOSE Model Paper Class 8 Questions to Term1 & Term2 Exams at official website. New Exam Scheme or Question Pattern for Sammittive Assignment Exams (SA1 & SA2): Very Long Answer (VLA), Long Answer (LA), Small Answer (SA), Very Small Answer (VSA), Single Answer, Multiple Choice and etc.
Sat, 17 Dec 2022 13:18:44 +0800
It is truly superb, unintentionally, to look at the information with this handle.
Sat, 17 Dec 2022 13:19:06 +0800
I'm perseveringly looking on the web for stories that can oblige me. There is obviously a substitute to sort out this.
Thu, 13 Apr 2023 18:31:42 +0800
What are the best things to do near me in Quebec, - one of the most famous cities of Canada?
Sun, 23 Apr 2023 10:38:07 +0800
Xin cam ơn!
Xây nhà trọn gói tại tphcm Thi cong alu Giá thi công nhà khung thép Sua nha gia re Giam sat cong trinh Xay nha gia re Wincons Wincons 8 Wincons 9 Wincons 10Thu, 11 May 2023 20:40:37 +0800
YouTube views can also be impacted by external factors, such as changes to the platform's algorithm or shifts in popular culture.
Tue, 16 May 2023 20:36:44 +0800
Limescale build-up restricts the flow of steam and reduces the heat-transferring ability in these appliances. This also increases energy usage and can cause them to fail prematurely. It is far easier to prevent limescale build up than it is to remove it. The easiest way to prevent it being to substitute purified water for tapwater in all appliances that have tanks.
Thu, 12 Dec 2024 13:14:20 +0800
Great Information sharing .. I am very happy to read this article .. thanks for giving us go through info.Fantastic nice. I appreciate this post.If possible, as you gain expertise, would you mind updating your blog with more information. It is extremely helpful for me.I just found this blog and have high hopes for it to continue. Keep up the great work, its hard to find good ones. I have added to my favorites. Thank You.I can set up my new idea from this post. It gives in depth information. Thanks for this valuable information for all,.. https://www.posterprintcenter.com/