| Show all threads Hide all threads Show all messages Hide all messages |
| Why do i always got CE ??? | Александр | 1636. Penalty Time | 20 Sep 2022 22:37 | 2 |
#include <stdio.h> int main() { int t1,t2,n; int c=0; scanf("%d %d", &t1, &t2); for (int i=0; i<=9; i++) { scanf("%d", &n); c+=(n*20); } t2-=c; if (t2<t1) { printf("Dirty debug :("); } else { printf("No chance."); } } Если я не ошибаюсь, вам стоит подключить пространство имён. using namespace std; |
| WA5 | Mohammad Sadegh Jazayeri | 1484. Film Rating | 20 Sep 2022 16:46 | 2 |
WA5 Mohammad Sadegh Jazayeri 3 Apr 2010 22:26 Re: WA5 LetsSolveSomePuzzles 20 Sep 2022 16:46 In WA5 X=Y and thus the answer should be "0" |
| If you had trouble with 13/27 tests | Aleksey[TheCrawfish]Bykov'` | 1269. Obscene Words Filter | 18 Sep 2022 21:42 | 1 |
If you have WA 13, try this test: 1 a 1 b....ba , where b repeated ~130000 times If you've got rte 27: m can be more than 10000 |
| Yeah! Some hints | Blum | 1396. Maximum. Version 2 | 18 Sep 2022 06:08 | 4 |
With help of my friend that was just looking at maximums index sequense and found an idea, finally, I got AC. Some hints: 1) Find an idea to calculate next maximum indices from previous ones: all the maximum's indices can be obtained from previous ones in such ways: i = s*2 + 1; or i = s*2 - 1; or i = s*4 + 1; or i = s*4 - 1; for example f(21)=8 is maximum for 21<=n<=34 so 21 = 2*11-1, where 11 is one of previous maximums indices. And so on using all the formulas above. but 2*11+1 = 23 is not a maximum index. so we have to cancel this number (23). 2) Learn to calculate f(n) in O(logn) 3) Generate all maximums indices (about 1500). You can store them in heap to get an access to the smallest maximum index. 4) than read n and just search for it in maximums index array. P.S. who can prove the first and the main idea? If you can, please post here you proof. Why OZone3 5 Jul 2009 21:07 How did you invent it? Edited by author 05.07.2009 22:51 It seems that only test s*2 - 1 and s*4 - 1 is OK. I've tested by bruteforce program in range [0, 20000000]. I will try it. Edited by author 15.10.2016 08:24 This is exactly how my accepted program runs. Suppose i is a maximum index, i = 2*i1+1, i2 = i1+1, then either 1) i1 is even, at least one of i1/2, i2 is a maximum index; or 2) i2 is even, at least one of i2/2, i1 is a maximum index. But I don't know how to prove it. Thus candidate indices from 2^n to 2^{n+1} can be generated from calculated maximum indices from 2^{n-2} to 2^n. |
| Hints | Abid29 | 1887. Frequent Flyer Card | 16 Sep 2022 23:03 | 1 |
Hints Abid29 16 Sep 2022 23:03 You only have four things to pick from, so you can calculate each step explicitly. This equation follows the notation in the article: T is the time to collect all of the items, and ti be the time to collect the i-th item after i−1 items have been collected. E(T)=E(t1)+E(t2)+E(t3)+E(t4)=p1−1+p2−1+p3−1+p4−1. The probability p1 of picking a new one if you have picked none yet is 1. The probability p2 of picking a new one if you have picked one depends on which one you picked first. Let's call the items A through D and the probabilities of picking each item if they're all in the box pa through pd. Then p2 would be pa(pb+pc+pd)+pb(pc+pd+pa)+pc(pd+pa+pb)+pd(pa+pb+pc). The above expression is the probability of picking a new one given that A had been picked already, plus the probability of picking a new one given that B had been picked already, and so on. The expression for p3 will have six terms in the sum; one of these will be papb(pc+pd). The expression for p4 will have four terms in the sum (actually, it's the same term four times!) |
| WA12 | Borozdin Kirill | 1027. D++ Again | 16 Sep 2022 16:18 | 2 |
WA12 Borozdin Kirill 2 Nov 2010 18:13 What can I do?.. My program passes all testes here, but still WA12... Any test cases? |
| enjoyed it | Abid29 | 1238. Folding | 16 Sep 2022 12:54 | 1 |
it takes a lot of my times. |
| what is the mistake here and why the limit of 10 cans? | hellknife | 1409. Two Gangsters | 15 Sep 2022 23:48 | 1 |
#include<iostream> using namespace std; int main() { int a, b; cin >> a >> b; cout << b-1 << ' ' << a - 1; } |
| Some tests | Конобейцев Иван Олегович | 1129. Door Painting | 15 Sep 2022 09:36 | 1 |
Some tests Конобейцев Иван Олегович 15 Sep 2022 09:36 4 2 2 3 2 1 3 3 1 2 4 1 3 6 5 2 3 4 5 6 5 1 3 4 5 6 5 1 2 4 5 6 5 1 2 3 5 6 5 1 2 3 4 6 5 1 2 3 4 5 8 7 2 3 4 5 6 7 8 7 1 3 4 5 6 7 8 7 1 2 4 5 6 7 8 7 1 2 3 5 6 7 8 7 1 2 3 4 6 7 8 7 1 2 3 4 5 7 8 7 1 2 3 4 5 6 8 7 1 2 3 4 5 6 7 6 2 2 3 2 1 3 2 1 2 2 5 6 2 4 6 2 4 5 |
| wrong constant of earth | yyll | 1030. Titanic | 15 Sep 2022 08:39 | 1 |
diameter of 6875 miles (/ 2 = 3437.5)??? the mean radius of earth is 6371.0 km (3958.8 miles) |
| Runtime error WA 14( Python) | Akashi | 1493. One Step from Happiness | 13 Sep 2022 23:20 | 1 |
a = input() minussum=0 plussum=0 b =[0:3] c =[3:6] c=int(c) minus = c-1 plus = c+1 minus=str(minus) plus=str(plus) for i in minus: i=int(i) minussum+=i for i in plus: i=int(i) plussum+=i n=0 for i in b: i=int(i) n+=i if n == minussum or n == plussum: print("Yes") else: print("No")
Help please) Why re? Edited by author 13.09.2022 23:21 |
| To admins: python files with UTF-8 BOM | Nikolay Shelukhin | | 13 Sep 2022 02:21 | 1 |
Python files encoded in UTF-8 with BOM always get "Runtime Error 1". It would be nice if it was fixed. |
| LOL I USED SUPER bRuTeFORCE AND GET TLE | 👑TIMOFEY👑 | 1673. Admission to Exam | 12 Sep 2022 17:27 | 1 |
I just do maxsimum 30 iteration on my super all doing bruteforce and this give me right ans and i got ac |
| Is it possible to solve it with Discrete Logarithm? | Igor Parfenov | 1132. Square Root | 12 Sep 2022 02:15 | 1 |
I could solve it using trivial bruteforce. But I get TL, using more clever and probably expected solution. I used this: https://e-maxx.ru/algo/discrete_root (Read only first section, we don't need anything else). The slowest part here is Discrete Logarithm, which I calculate in \sqrt{n} * log_from_map. |
| Asking for help at WA-17 | alexwangxiang | 1951. Complex Root | 9 Sep 2022 21:34 | 2 |
My program stuck at WA-17 for several times and I don't know the reason why. Can anyone give me some challenging test cases? Update: accepted now. Key point is to run unit test for the integral division function that I wrote. Both self-written complex division and std::complex<long double> division can be used to get approximate value of the quotient. |
| Anybody give me some tests please! | Landsknecht | 1602. Elevator | 8 Sep 2022 15:45 | 4 |
The more - the better! 'cause I have no idea what I'm doing wrong :\ 50 49 8.4 5.5 //1 50 49 8.4 5 //25 50 49 8.4 4 //28 50 49 8.4 2.0 //37 50 49 8.4 0.2 //48 The answer of second test case is 1, not 25. My ac programm gives 1 for second and 25 for third test |
| Runtime error c++ can't find solution | Ionut Marian | 1787. Turn for MEGA | 8 Sep 2022 12:29 | 1 |
#include <iostream> using namespace std; int main() { int leavingCars, minutes; int carPerMinute[100]; int totalCars = 0;
cin >> leavingCars >> minutes; int carsLeavingPerMinute = leavingCars * minutes;
for(int index = 1; index <= minutes; ++index) { cin >> carPerMinute[index]; totalCars += carPerMinute[index]; }
cout << totalCars - carsLeavingPerMinute;
return 0; } |
| i'm shoked i'm just play with precision and got many wa and by that ac | 👑TIMOFEY👑 | 1864. Get-Together at Den's | 7 Sep 2022 15:37 | 1 |
|
| JS Support | Поддержка JS | Inugami | | 7 Sep 2022 00:42 | 1 |
Are you going to add javascript (especially nodejs) support for this online judge | Планируется ли добавить на сайт поддержку javascript или nodejs? |
| easy bfs | 👑TIMOFEY👑 | 1490. Fire Circle | 6 Sep 2022 20:53 | 1 |
|