| Показать все ветки Спрятать все ветки Показать все сообщения Спрятать все сообщения |
| I have some mistakes, help me find it!!! | Sergey Volodin | 1263. Выборы | 7 янв 2018 17:36 | 1 |
a=input().split() t=0 for i in range(len(a)): c=a[t] v=int(c) a[t]=v t=t+1 e=[0] s=[0] z=[0] q=[0] y=1 for i in range(a[1]): d=int(input()) s.append(d) s.remove(s[0]) for i in range(0,a[0]): w=s.count(y) z.append(w) w=0 y=y+1 z.remove(z[0]) t=0 for i in range(len(z)): c=z[t] v=int(c) z[t]=v t=t+1 t=0 c=0 for i in range(len(z)): c=z[t]/a[1] c=c*100 q.append(c) t=t+1 q.remove(q[0]) t=0 c=0 for i in range (len(q)): c=round(q[t],2) e.append(c) t=t+1 e.remove(e[0]) t=0 for i in range (len(e)): print(e[t],"%") t=t+1 |
| No subject | Sergey Volodin | 1327. Предохранители | 7 янв 2018 14:21 | 1 |
Edited by author 07.01.2018 14:22 Edited by author 07.01.2018 14:23 |
| easy bfs | Aditya Singh | 1080. Раскраска карты | 7 янв 2018 09:27 | 1 |
|
| Which is the father node? | Roby | 1471. Расстояние в дереве | 6 янв 2018 11:31 | 4 |
u and v,which is the father node? There's no father node. You can do topsort and choose it yourself. Um... You can't topsort a given tree, because it's an undirected graph. |
| Runtime error in python | Yeahia Md Abid | 1086. Криптография | 4 янв 2018 23:16 | 1 |
import math def getList(maxNumber): primeLst = [] for num in range(2,15000): if all(num%i!=0 for i in range(2,int(math.sqrt(num))+1)): primeLst.append(num) if len(primeLst)==maxNumber: return primeLst lst = [] for x in range(int(input())): lst.append(int(input())) primeNumbers = getList(max(lst)) for x in lst: print(primeNumbers[x-1]) I don't know why my code is error in testcase 2 Can anybody help me out of here ? |
| what is the 19test? | Vaganov | 1297. Палиндромы | 2 янв 2018 18:57 | 4 |
'qwerSOMETEXTrewq' isn`t 19 test. I got WA10 and my program was printing TEXT as my if condition was wrong at one place. I believe this is the test case for 10 as i got AC after fixing this. Thanks for that :) Hey, i seemed to have failed at Test 10 > <, with the input as "qwerSOMETEXTrewq", the output i get is qwer, which is right isn't it ? it should be "ETE",because "qwer" and "rewq" are separated |
| What about test #23? | Dmitriy99 | 1800. Закон бутерброда | 2 янв 2018 16:12 | 2 |
I can't understand what i do not correctly. Help me, please. Бутерброд изначально довольно близок к Земле |
| help | Zayakin Andrey[PermSU] | 1730. Челмедведосвин | 2 янв 2018 12:39 | 4 |
help Zayakin Andrey[PermSU] 7 фев 2010 03:03 what is 5th test ? Edited by author 07.02.2010 03:04 I also got WA on the 5th test...Who can help me... man-bear-pig 10/20 170/680 3/12 Same answer as for man-bear-pig 1/2 1/4 1/4 Re: help Smilodon_am [Obninsk INPE] 2 янв 2018 12:39 Great thanks for this helpful test. |
| 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; } |