Show all threads Hide all threads Show all messages Hide all messages |
Почему ваш компилятор не видит директиву "stdafx.h" | Ilya | 1000. A+B Problem | 5 Jun 2019 15:50 | 2 |
#include "stdafx.h" #include <iostream> int main() { int a; int b; int c; scanf_s("%d%d\n", &a, &b); c = a + b; printf("%d\n", c); return 0; } Зачем тебе эти директивы вообще? Нужна только айострим. И пишется так: <stdafx.р> |
Всё оч просто.с++ | Kostya | 1000. A+B Problem | 5 Jun 2019 15:47 | 1 |
#include <iostream> using namespace std; int main() { long long a, b; cin >> a >> b; cout << a+b; } |
Any other suggestion? | adityarev | 1589. Sokoban | 5 Jun 2019 12:53 | 2 |
Hi guys, i've tried to solve this problem with A*. I came with pull distance as heuristic and calculate the distance table with Floyd's algorithm. I also have put deadlock detector (for Simple and Frozen) on my code. Is there something i miss? Or do you have any other suggestion? I am very happy if i can discuss with you guys. Thanks before for your help :) I know some interesting optimisations which helped me get TLE 78 but I don't understand how to use A* in this problem. Let's discuss it. My email is imoskovchenko72@gmail.com |
for those ,who don't know what to do with WA 7,8; | Ivan | 1131. Copying | 4 Jun 2019 22:49 | 1 |
I tried to pick up to my occasion all data types ,but there was some problem ;Then i tried using data type "auto" and it's worked! |
What's test#19 ? anything must notice? | tbtbtb | 1332. Genie Bomber | 4 Jun 2019 11:08 | 6 |
I got WA#19 too! Any tricky test here? test 19 is like this 2 1 1 101 101 2 1 Your answer is probably 0 The right one is 1 Thank you, that was really helpful! |
Thanks for such a cool problem | Md sabbir Rahman | 2124. Algebra on Segment | 4 Jun 2019 07:06 | 1 |
Whoever made this problem, thanks a lot! Seeing group theory applied in cp felt pretty cool. Alos learnt a lot thanks to this problem |
Precision errors? | Timothy Mou | 2121. Intersection of Parabolas | 3 Jun 2019 20:29 | 3 |
I believe I am having precision errors when calculating the solution. I changed from doubles to long doubles and got one more test case, so I believe my solution is correct but not precise enough. Any tips to resolve this? Never mind, there was simplification in the calculations and then I just hard-coded printed out the decimals. This problem is just cancer Yes Some tests: a = 1 ans = 3.666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666667 a = 1.5 ans = 5.666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666667 a = 666 ans = 2663.66666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666674 a = 1000000000000000000 ans = 3999999999999999999.666666666666666666666666666666666666666666666666666666666666666333333333 Edited by author 03.06.2019 20:30 |
wa16 (+) | AlMag(VNTU) | 1701. Ostap and Partners | 2 Jun 2019 20:02 | 4 |
have no ideas. i've runned my random test generator and my program passed over 1000 tests, but wa. help, please. This hand-made test helped me with WA#16: 5 3 1 2 -2 4 3 2 4 2 -1 The possible answer is: Possible 0 1 3 0 2 Good luck. Глащенко Никита, thank you very much! Really useful test! |
Crash (access violation) test #17 | alex270295 | 1837. Isenbaev's Number | 30 May 2019 08:47 | 8 |
can anybody help me with this problem? can somebody tell what kind of test is it i have already checked. all right. maximum number of participants is 300. [code deleted] Edited by moderator 19.11.2019 23:09 Maybe you found the error, but i got stuck on this problem and tried your solution. I hoped to find the problem of my submission. When there are 300 different names without Isenbaev, your program added Isenbaev with number 301 and crashes because of the array index > 300 setting array to [1..301] did the trick and AC thank you! your reply help me a lot! thank you, you saved my day |
If you have WA2 | Andrew Sboev | 1010. Discrete Function | 27 May 2019 21:32 | 7 |
1) Maybe, you are reading long long variable with this command : scanf("%d",&arr[i]); It is not right. You should do, for example, it with next command scanf("%I64d",&arr[i]); 2) Maybe, you were confused by statement. You have to choose such two points so line that passing through this points has maximal absolute value of inclination, not just inclination. 3) Maybe, you are doing something like this : for ( int i = 1 ; i <= n ; ++i ) { long long d = abs2(arr[i+1] - arr[i]); if ( d > x ) { x = d; m1 = i; } } There is a mistake in first line. Right way is for ( int i = 1 ; i < n ; ++i ) { It was my biggest mistake, because the problem itself is so simple. Thannnnnnnnnnnnnnnnnk youuuuuuuuuuuuuu verrrrrrrrrrrrry mucccccccccccccch! Thannnnnnnnnnnnnnnnnk youuuuuuuuuuuuuu verrrrrrrrrrrrry mucccccccccccccch! Thanks a lot! The definition of inclination is ambiguous in the problem statement. Thanks a lot! I have ignored "absolute value" too. Thannnnnnnnnnnnnnnnnk youuuuuuuuuuuuuu verrrrrrrrrrrrry mucccccccccccccch! Thannnnnnnnnnnnnnnnnk youuuuuuuuuuuuuu verrrrrrrrrrrrry mucccccccccccccch! |
Statement is incomplete? | mouse_wireless2 | 1382. Game with Cards | 23 May 2019 17:45 | 1 |
Problem statement says "His friends write numbers from 1 to N on cards", but it doesn't mention that these numbers should be distinct. Yet, it seems like the problem only accepts solutions in which the numbers are distinct (i.e. the numbers on the N cards are a permutation of [1..N]). |
Running the java applet | Whyyes | 1365. Testing Calculator | 23 May 2019 02:31 | 2 |
Since you're able to download it, you can actually decompile it and submit the code to get accepted. There's a Thread.Sleep(3000) in there that you'll need to comment out. |
To admins: Wrong answer getting accepted | basuki | 1576. Telephone Tariffs | 22 May 2019 17:52 | 1 |
The cases when all times are less than 6 seconds are neglected. So the cost of each plan should be zero as all calling will be free but adding the basic plan to the cost leads to AC. |
В чем проблема такого решения на ruby? | ypavlov | 1000. A+B Problem | 22 May 2019 11:41 | 1 |
puts gets.split(' ').sum { |s| s.to_i } а вот так ок: puts gets.split(' ').map { |s| s.to_i }.inject(0) {|sum,x| sum + x } что не так с с sum? Edited by author 22.05.2019 11:43 Edited by author 29.05.2019 02:44 |
Any proof? | bsu.mmf.team | 2121. Intersection of Parabolas | 20 May 2019 18:15 | 1 |
|
Any hints? | Henry Nguyen | 1579. Coat Transportation | 19 May 2019 08:10 | 1 |
Any hints for solution? I am completely stuck at TLE. |
This is a cool problem | Rabbit Girl ♥ | 1320. Graph Decomposition | 18 May 2019 19:02 | 2 |
So, we can decompose like this any connected graph G = (V, E), |E| = 2k, k in Z+? This is lovely, this is nice (I proved it using induction, I'm proud of myself, yay!). I came up to this idea, but failed to proof. |
Accepted simple approach for this problem | Gleb Dubosarskii | 1467. Sum of Degrees | 17 May 2019 19:39 | 2 |
It is easy to solve this problem by using such recursive formula (k+1)P_k(N)=(N+1)^(k+1)-1-sum_(l=0)^(k-1) C_(k+1)^l P_l(N), where P_k(N) is a sum of powers k from 1 up to N, C_k^l is a binomial coefficient. I assume that P_0(N)=N. You can check this formula by summing up from 1 to N following identities (n+1)^k-n^k=sum_(l=0)^(k-1) C_k^l n^l. However, P_k(x) has non-integer coefficients, so it is better to introduce polynomials Q_k(x) by formula Q_k(x)=(k+1)!P_k(x). It can be proven by induction based on recursive formula above that Q(x) has integer coefficients!!! So, use BigIntegers in Java, otherwise you would have overflow. Good luck! Edited by author 08.05.2017 19:44 Edited by author 08.05.2017 19:44 You can make a system of linear equations with k+2 variables and equations, which would look like: A_0 * 1^0 + A_1 * 1^1 + ... + A_(k+2) * 1^(k+2) = 1^k A_0 * 2^0 + A_1 * 2^1 + ... + A_(k+2) * 2^(k+2) = 2^k ... A_0 * (k+2)^0 + A_1 * (k+2)^1 + ... + A_(k+2) * (k+2)^(k+2) = (k+2)^k So, you only need to find A_i coefficients using Gaussion elimination. |
Hint | xyqxyq | 1052. Rabbit Hunt | 17 May 2019 14:41 | 1 |
Hint xyqxyq 17 May 2019 14:41 n^3 is suitable for which n<=200 but pay attention to the collinear problem Edited by author 17.05.2019 14:43 |
To admins | basuki | 1590. Bacon’s Cipher | 17 May 2019 00:16 | 1 |
|