Показать все ветки Спрятать все ветки Показать все сообщения Спрятать все сообщения |
Why wrong answer in case 12 ? | Al Mahfuz | 1501. Чувство прекрасного | 2 янв 2018 07:19 | 1 |
|
WA, Case 12, Help please. | Al Mahfuz | 1501. Чувство прекрасного | 2 янв 2018 07:19 | 1 |
Edited by author 02.01.2018 07:25 |
I have two solutions and neither is correct. Why? | pimiento | 1264. Трудовые будни | 1 янв 2018 23:14 | 3 |
In Python 3.0: N = int(input()) M = int(input()) result = N*(M+1) print(result) #It produces runtime error In C: #include <stdio.h> int main(void) { short int n, k; scanf("%4hd%4hd", &n, &k); printf("%hd\n", n * (k+1)); return 0; } # It produces wrong answer for test N7 SHORT_MAX, probably, is 32767. Replace short with long or long long. Edited by author 26.11.2013 10:16 scanf("%4hd%4hd", &n, &k); /// you dont need this scanf("%i %i", &n, &k); // like this |
WA #10 | Rustam | 2033. Девайсы | 1 янв 2018 23:08 | 6 |
WA #10 Rustam 18 янв 2015 16:00 Can somebody give me this test ?! Please ! I guess all devices are unique. I've passed test 10 when i've passed this:
q a 1 q b 2 q c 3 q d 4 q e 5 q f 6 so what's the output for that test ??? If you're getting WA #10, better try this test where prices aren't already sorted: a 1 6 b 2 4 c 3 5 d 4 3 e 5 1 f 6 2 Correct answer is "5", got AC after this test passed. Re: WA #10 Khujamurod Murtozakulov (Tashkent U of IT) 1 янв 2018 23:08 |
I have WA8. Please check my tests and add your tests | <-UnderFelixAbove-> | 1067. Структура папок | 1 янв 2018 14:48 | 5 |
input#1: 3 a\b\c a\b\c b output#1: a _b __c b input#2: 9 a a\b a\b\c a\b\c a\b\c\d b\f b\f\e b\f\d b\e output#2: a _b __c ___d b _e _f __d __e input#3: 3 a a\b\c\d\e\f a\b\r\t\p output#3: a _b __c ___d ____e _____f __r ___t ____p input#4: 4 a\b b\a a\c\d a\c\e output#4: a _b _c __d __e b _a input#5: 4 a a\b\c\d\e b\f\e\t a\b\p output#5: a _b __c ___d ____e __p b _f __e ___t Edited by author 01.10.2007 23:38 Edited by author 01.10.2007 23:42 Edited by author 01.10.2007 23:46 Yeah, your tests are absolutelly correct... caz my AC solution has the same outputs.... try this test 1 ab\c\d\e my be it'll help... 4 a\baba a\bab a\babab a\bab\ba a bab ba baba babab MR.qo`y yaxshiroq test yoz thank you very much for the tests |
Is it right to ouput any path with minimal cost? | tjq(killer of zju) | 1016. Кубик на прогулке | 31 дек 2017 23:57 | 4 |
the output part states that: "The only line of the output must contain the minimal sum followed by the optimal route (one of possible routes with minimal sum)", but I got wrong answer! why? my output for sample input is: 5 e2 e1 d1 d2 e2 e3 I think it's also right. Yes Right! my AC program outputs "5 e2 e1 d1 d2 e2 e" for sample test :) 5 e2 e1 d1 d2 d3 e3 is another correct answer for the sample input. |
WA #1 for c++ use DOUBLE and SETPRECISION ! | Khujamurod Murtozakulov (Tashkent U of IT) | 1457. Теплотрасса | 30 дек 2017 21:03 | 1 |
double res = ...; cout << setprecision(6) << fixed << res; |
WA #1 for c++ use DOUBLE and SETPRECISION ! | Khujamurod Murtozakulov (Tashkent U of IT) | 1457. Теплотрасса | 30 дек 2017 21:02 | 1 |
|
AC | Dashka_Bu | 1581. Работа в команде | 30 дек 2017 16:27 | 3 |
AC Dashka_Bu 10 мар 2012 20:11 program idiots; var n,i,h:integer; a: array [1..1000] of integer; begin readln(n); for i:=1 to n do read(a[i]); h:=1; for i:=1 to n do begin if a[i]=a[i+1] then h:=h+1; if a[i]<> a[i+1] then write(h,' ',a[i],' '); if a[i]<> a[i+1] then h:=1; end; end. Re: AC kami_botanik 14 мар 2013 20:05 but, I don't understood! for i:=1 to n do begin if a[i]=a[i+1] then h:=h+1; if a[i]<> a[i+1] then write(h,' ',a[i],' '); if a[i]<> a[i+1] then h:=1; end; You must get error in this stroke if a[i]=a[i+1] then h:=h+1; because your for loop is going untill n this must give Indexout of range exception isn't? Re: AC SeaEagle 30 дек 2017 16:27 Nope, its neither c++ nor Java. It`s Pascal. Here you can do a lot of forbidden things without getting runtime error or Exception |
How to use dynamic programming to solve this problem? | Nick | 1225. Флаги | 27 дек 2017 18:09 | 5 |
How to use dynamic programming to solve this problem? I used fibonacci. As far as I understand, this problem is about combinations and not about fibonacci. If there was only the first condition, then for any N we have only 2 possibilities to create the flag. That is, f(1) = 2, f(2) = 2, f(3) = 2, f(4) = 2, ..., f(N) = 2; This is true, because the choice of the first stripe determines the rest of the flag automatically. If you choose the first stripe to be white-colored then you are destined to choose the red stripe to be the second one. And vice versa. Don't make my words a HOLY WISDOM - think about it till you can feel it yourself. Don't read next, until you fully and completely get it. The second condition is here to complicate your life. It doesn't do anything to our function f(x) if x equals to 1 or 2. That is, f(1) and f(2) are still equal to 2. (By the way, I've just noticed that I've pulled the function from under the pillow. Well, in my mind this function returns the amount of different flags that can be created if you need to make it from x stripes. Ok, now we're moving on...) But it allows us to INSERT the blue stripe between the two: white and red stripes. This concept of INSERTION is really the key here. Think about it. If you were supposed to gain anything intellectually from solving this task at all, I bet, it was this very concept. If we have some sequence of 2-colored flag: WRWRWRWRWRWRWR (White and Red), and this sequence contains all the N stripes that we need, then we really don't have any place to INSERT our blue stipe. You think, ok, that's fair, and remove one of the stipes (e.g. the left-most). Now you have the place for your blue stripe ... and you can insert it in many ways: wBrwrwrwrwr or wrBwrwrwrwr or wrwBrwrwrwr ... well, you get the point :) This way, by removing one of the stripes you have created X COMBINATIONS. This word is also important, that is why it is all upper-case :) If you remove ONE MORE stripe (think about removing as n - 1 or better n--), you now have to INSERT 2 blue stripes somewhere in the sequence wrwrwrwrwrwr... E.g. wBrBwrwrwrwrwrwr, or wBrwrwrwrwrwrwBr. Now there should be more COMBINATIONS than in the previous case (figure out yourself, how many :) ). The last point I want to make is that you have to know your limits. That is, you have to understand when to stop removing stipes from the flag and stop INSERTING blue stripes in it. When you get to this point (keeping in mind all the previous points), you will figure this out by yourself easily... Edited by author 20.08.2015 02:16 Edited by author 20.08.2015 02:18 Edited by author 20.08.2015 02:23 Edited by author 20.08.2015 02:23 Edited by author 20.08.2015 02:25 Edited by author 20.08.2015 02:26 Edited by author 20.08.2015 02:27 Edited by author 20.08.2015 02:27 Edited by author 15.10.2016 20:15 Edited by author 15.10.2016 20:16 Edited by author 15.10.2016 20:20 Edited by author 15.10.2016 20:21 Edited by author 15.10.2016 20:21 This is really extremely helpful in reasoning about the problem, thank you Егору зачет! За крутое решение и за знание англ) |
WA#2 | Zhanibek | 1146. Maximum Sum | 26 дек 2017 10:59 | 1 |
WA#2 Zhanibek 26 дек 2017 10:59 Please, give me some tests! |
(C)what's error 7!! | alireza | 1083. Факториалы!!! | 26 дек 2017 02:56 | 2 |
#include <stdio.h> #include <stdlib.h> int main(int argc, char *argv[]) { int a,k=-1,fact=1,term=1,i=0; char c; scanf("%d",&a); getchar(); do{ c=getchar(); k++; } while(c==33); if(k>a) fact=-1; while(fact>0){ term*=fact; fact=(a-i*k); i++; }
if(k<=a) printf("%d",term); system("PAUSE"); return 0; } Edited by author 01.07.2012 19:03 #include <stdio.h> #include <stdlib.h> int main(int argc, char *argv[]) { int a,k=-1,fact=1,term=1,i=0; char c; scanf("%d",&a); getchar(); do{ c=getchar(); k++; } while(c==33); if(k>a) fact=-1; while(fact>0){ term*=fact; fact=(a-i*k); i++; } if(k<=a) printf("%d",term); system("PAUSE"); return 0; } |
Test 4 | LiZheng | 1118. Нетривиальные числа | 25 дек 2017 17:51 | 18 |
Test 4 LiZheng 15 июл 2005 13:53 I always get WA on test 4,who can give me the testdata of test4.Help me!Thank you. Thank's for help! You're completely right! AC now! Of course I have same bugs. AC now I also have the same mistake.thanx a lot. Thank you very much!!!!!!! It is a very good advice! Thank you for your advice. I've gotten AC now.I wrote "1" if i=1. а как выглядит второе число? ведь тест - 2 числа, через пробел. Can you tell how look test4? the first is one, and the second is ..? Triviality(1) = 1 Triviality(1)=0 Edited by author 17.09.2015 23:28 Edited by author 17.09.2015 23:28 |
WA2 please help | Ghiorghiu Ioan-Viorel | 1658. Сумма цифр | 25 дек 2017 04:15 | 2 |
I keep getting WA2, but none of the threads posted here seem to help me: every example i found worked on my program, and i just can't see what's wrong with it. Can someone please tell me if they see anything that doesn't work within my program? Thank you in advance. #define DM 8101 #define DN 901 #include <iostream> #include <set> #include <queue> using namespace std; int n, v, vp, s, sp, cf[DN][DM], dp[DN][DM]; multiset <int> ord;//ordering the elements queue <int> q;//rebuild void formare(int nrc, int car, int sum, int ptr)//no of digits, digit, sum, sumof squares { if (nrc > 100 || (cf[sum][ptr] && cf[sum][ptr] <= nrc)) return; cf[sum][ptr] = nrc; dp[sum][ptr] = car; for (int i = 9; i >= 1; --i) formare(nrc + 1, i, sum + i, ptr + i*i); } void realc(int s, int sp) { if (!s || !sp || !dp[s][sp]) return; q.push(dp[s][sp]); v+=dp[s][sp]; vp+=dp[s][sp]*dp[s][sp]; realc(s - dp[s][sp], sp - dp[s][sp]*dp[s][sp]); } int main() { cin >> n; for (int i = 9; i >= 1; --i) formare(1, i, i, i*i); cf[0][0] = 1; dp[0][0] = 0; while (n--) { cin >> s >> sp; if (s > 900 || sp > 8100) cout << "No solution\n"; else if (s == 0 && sp == 0) cout << "0\n"; else { realc(s, sp); if (q.size() <= 100) { while (!q.empty()) { if (v == s && vp == sp) ord.insert(q.front()); q.pop(); } for (auto i:ord) cout << i; ord.clear(); if (v != s || vp != sp) cout << "No solution"; cout << '\n'; } else { cout << "No solution\n"; while (!q.empty()) q.pop(); } } v = vp = 0; } return 0; } Nevermind, apparently I was calculating the number the wrong way, I found the mistake. |
WA #19 | Aditya Singh | 1837. Число Исенбаева | 23 дек 2017 01:46 | 1 |
WA #19 Aditya Singh 23 дек 2017 01:46 What is the test 19? Help please! |
Who have a WA1, 2, 3 | Kirom `Ekexity [SESC17]💻 | 1535. Хоббит или Туда и обратно | 23 дек 2017 01:04 | 1 |
Timus Sistem have: Test1: n = 4 Test2: n = 2 Test3: n = 3 Right answers for n = 15 1 14 3 12 5 10 7 8 9 6 11 4 13 2 15 1 3 5 7 9 11 13 15 14 12 10 8 6 4 2 n = 16 1 15 3 13 5 11 7 9 8 10 6 12 4 14 2 16 1 3 5 7 9 11 13 15 16 14 12 10 8 6 4 2 Enjoy by problem) |
What? | Rabbit Girl ♥ | 1354. Палиндром. Он же палиндром | 22 дек 2017 13:19 | 1 |
What? Rabbit Girl ♥ 22 дек 2017 13:19 |
nice problem | CaCO3 | 1081. Двоичная последовательность | 22 дек 2017 08:10 | 1 |
|
Finally! It wasn't, so hard at all | Rabbit Girl ♥ | 1393. Average Common Prefix | 22 дек 2017 00:40 | 1 |
Oh. My. God. JEBUS! I ACed it! Just use suffix array + Kasai and it will work out just fine. Trust me :) But also here is what I collected about test 30 : * Size of the string = 250000. * All letters of English alphabet are being used. * If we divide the string into heterogeneous and homogeneous regions, then the latter forms a majority. Moreover, longest homogeneous region = 396 and heterogeneous = 6. * The amount of divergent adjacent characters is between 5000 and 10000. Hope it helps :3 |
WA #1 Why??? | B@R5uk | 1285. Нитка в гиперкосмосе | 21 дек 2017 22:27 | 3 |
I submitted some algo which on my computer gives correct result for sample input given in problem statement and I got WA in test #1. Then I tried this code: public class Problem_1285 { public static void main(String[] args) { System.out.println("1.00"); } } ...and got the same WA #1. What's going on??? Seems like test #1 is not the sample test Seems like test #1 is not the sample test It is often the case. |