morris821028 / uva Goto Github PK
View Code? Open in Web Editor NEW:love_letter: UVa and other online judege workspace
:love_letter: UVa and other online judege workspace
想請問您這題
https://github.com/morris821028/UVa/blob/master/volume112/11236%20-%20Grocery%20store.cpp
為什麼要加上
if(fabs((a+b+c+d)/100.0 - ((double)a*b*c*d)/100000000.0) < 1e-12)
我以為 d 是直接用整數運算 d = (s * 1000000) / (p - 1000000); 算出來所以應該是對的
而且 if(s > 2000 || d < c) continue; 檢查過 d 的範圍了應該直接是答案了
為什麼要重新檢查一次呢?
我不加那行結果 WA 了 QQ
謝謝您
Hello, Vinit. ^_^
UVa#972
https://www.udebug.com/UVa/972
It seems like sol on uDebug has some precision Error.
For Below Input
4
2.0 2.5
6.9 2.1
7.4 3.3
1.0 2.1
10
-0.3 2.1
1.4 0.1
3.8 0.1
-2.0 0.1
3.2 1.1
-1.9 0.1
9.9 3.1
3.3 0.1
1.5 1.1
7.9 2.1
My Output
2.000
Output of uDebug or morris
https://github.com/morris821028/UVa/blob/master/volume009/972%20-%20Horizon%20Line.cpp
1.5
So, How about (1) or (2)?
Thanks
~/Anjupiter
Hi,
i just simply run this program but could not run all test cases. Problem #868
Numerical Maze
Why N++ and K++?
Please, I can't understand.
大佬多久才把这些题刷完的
UVa/volume117/11729 - Commando War.cpp
Lines 7 to 9 in 080fb3a
The above code fails to provide consistent sorting order when y
is the same for different x
. For example -
3
3 10
2 10
1 10
Comparator must be -
if(a.y == b.y) { return a.x < b.x; } return a.y > b.y;
Hi morris821028,
It'll be great if you could briefly describe the logic of your solution.
Thanks,
Hi morris821028,
In the solution '10065 - Useless Tile Packers', why you are using the following code to find the hull area.
double cont = calc_area(CH, m-1);
Especially the 'm-1' part. Is the algorithm returns actual hull?
Thanks
Hello, I'm trying to solve the problems from ACM ICPC 2015 South America. All of them were easy to medium, but I'm stuck at J - Just a bit sorted. Would you explain to me how did you solve it? What approach did you use? what is necessary to know before tackling this problem?
I don't understand your comments, and even if I did, I wouldn't know the analysis that led you to this solution.
Cheers from Chile, thanks!
I got some from the internet.. sorry for bothering..
Hello, Vinit. ^_^
It seems like sol is wrong. I've cross-checked with Moriss' code(https://github.com/morris821028/UVa/blob/master/volume009/953%20-%20The%20Incredible%20Pile%20Machine%5Bv2%5D.cpp)
For below Input
---
1
3 7 18 9 15 9 8 15 17 2
----
Output should be
---
120 59
---
but, uDebug gives
---
201 59
---
Explanation
---
If we choose "120"
본문 이미지 1
If we choose "201"
본문 이미지 2
(ans) = (sum of all number)-(yellow number)
At glance, It seems like all correct, but In problem statement, It says
In case there are more than one possibility of pile assignment, choose always the one with lower order (e.g. if 012 and 210 yield 9 operations, choose 012).
So, correct answer is 120 59
---
And, It seems like Morris' code also wrong :(
For below input
----
1
3 10 17 1 9 9 8 12 19 11
---
My output and uDebug's output
---
021 59
---
but, Morris' code gives
---
012 59
---
Explanation
---
본문 이미지 3
본문 이미지 4
(ans) = (sum of all number)-(red number)
So, Correct answer is 021 59
---
If you agree, How about this?
(1) Swap sol with another AC one(I'm enclosing my code ^_^)
(2) Can you send morriss this information?
Thanks,
~/Anjupiter
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.