| Показать все ветки Спрятать все ветки Показать все сообщения Спрятать все сообщения |
| WA#4 - I don't know why | Leonid (SLenik) Andrievskiy | 1075. Нитка в пространстве | 30 июл 2013 22:44 | 3 |
AB, AC, BC - Vectors. r - Radius. Arctangent(y, x) - Coprocessor function FPATAN, calculates an angle between vectors A(x, y) and X(1, 0)(using y and x coordinates of the A point). My algorithm: d = Abs(VectorMultiply(AC, BC)) / AB if (d >= r) then Write(Length(AB)) else begin s1 = Sqrt(Length(AC) * Length(AC) - r * r) angle1 = Arctangent(Sqrt(Length(AC) * Length(AC) - d * d), d) - Arctangent(s1, r); s2 = Sqrt(Length(BC) * Length(BC) - r * r) angle2 = Arctangent(Sqrt(Length(BC) * Length(BC) - d * d), d) - Arctangent(s2, r); s = r * (angle1 + angle2) Write(s1 + s + s2) end ----- Am I wrong? I think if you'll get following test, then you'll get 4th. 1 2 0 3 3 0 0 0 0 2 The answer is 2.24 (not 2.30) Thank's Anatoly, that helped me. Don't know, how I've missed this :) |
| Test#10 OR Can it be solved with monte carlo alogrithm? | Alex Svetkin [OrelSTU] | 1333. Джинн-бомбардировки 2 | 30 июл 2013 20:24 | 6 |
Can it be solved with monte carlo alogrithm? I used 10^6 points for checking and got WA at test #10. Then changed number of points to 10^5 and still get WA#10. Edited by author 19.10.2004 02:09 I cut the square into 10^5 stripes and WA #10. Then I magnified the picture by 10^4 times and changed real into extended, WA #10 still. Wrong test, or wrong algo? I used 10^6 points checking and I got AC=) Try to post your code I'm sure the problem there I've solved it with monte carlo alogrithm. So, i can say that it is possible |
| Test | Zeva [USU] | 1502. Точки домино | 30 июл 2013 17:55 | 18 |
Test Zeva [USU] 28 окт 2006 17:07 1000 => 501501000 500 => 62875500 333 => 18629685 1 => 3 3 => 30 4 => 60 But Wa#5 Edited by author 28.10.2006 17:09 The same with me: WA#5 can anybody tell me why Re: Test emotional blind 28 окт 2006 17:30 Re: Test emotional blind 28 окт 2006 17:31 Re: Test Madiyar Tursunbayev 29 окт 2006 12:11 Just use int64 instead of longint; Re: Test Todor Tsonkov 30 окт 2006 16:02 My solution is very short and I also get WA5, my answers are the same as those posted, can anyone give some hint ? Re: Test USTU-FTF KOIBAS Team 30 окт 2006 16:30 I got Accepted using BrutForce!!! Re: Test Todor Tsonkov 30 окт 2006 17:02 Already solved this problem, read the hint below :) Edited by author 30.10.2006 21:20 Re: Test N.M.Hieu ( DHSP ) 30 окт 2006 18:28 Yes , me , too . WA#5 but AC now , you should change "int n" into "long long n" . Re: Test Todor Tsonkov 30 окт 2006 21:20 Yup, 10x pal, you saved me from reading again and again this task and to wonder where I was wrong :) WA on 5 Alexander Prokazyuk (TKTL) 2 ноя 2006 07:17 Who can find my mistake? [code deleted] it passes all my tests, but it can't pass 5 Edited by moderator 29.12.2006 09:16 This is my formula for (int i = 0; i <= n; ++i) res += (i + n) * (n - i + 1) / 2 + i * (n - i + 1); This one is mine: n*-~n*-~-~n>>1 Have fun! Re: WA on 5 Mihran Hovsepyan <<RAU>><<1 kurs>> 8 ноя 2007 16:00 Re: Test Petromil Petkov 10 ноя 2006 01:00 Thanks for the advice. Could you tell me what brings this change? n=10000 fits in an int, doesn't it? Ha! Got accepted only with __int64 and not with long long... my djgpp returns a compilation error on such a line... could anybody explain me what should that be? Edited by author 10.11.2006 01:16 Edited by author 02.03.2008 12:54 Edited by author 02.03.2008 12:53 |
| WA 25 | Al.Cash | 1378. Искусственный интеллект | 30 июл 2013 11:41 | 3 |
WA 25 Al.Cash 20 июн 2009 15:06 Can somebody tell me the possible reason of this WA? Or at least what figure is in that test? I would be very thankful! |
| #2 | Domacles | 1071. Никифор 2 | 30 июл 2013 10:43 | 1 |
#2 Domacles 30 июл 2013 10:43 |
| WA on 6 test | R. Dubinin | 1210. Добрые духи | 29 июл 2013 23:51 | 1 |
please, give me some tests. |
| WA # 3. please help | R. Dubinin | 1306. Медиана последовательности | 29 июл 2013 16:56 | 1 |
|
| WA 8 | Yagudin Ruslan | 1339. Рыцари и леди | 29 июл 2013 15:48 | 1 |
WA 8 Yagudin Ruslan 29 июл 2013 15:48 |
| can this problem solved with dp. | runtime_error | 1517. Свобода выбора | 29 июл 2013 15:07 | 1 |
i tried to solve this problem with dp. O(N*2) time and O(N) memory: here is my code #include<iostream> #include<string> #include<vector> #include<algorithm> using namespace std; int n; string s,t; string Longest_common_substr(void) { int place; int longest=0; vector<int> m(n); for(int i=0;i<n;i++) { for(int j=n-1;j>=0;j--) { if(s[j]==t[i]) { if(j!=0)m[j]=m[j-1]+1; else m[j]=1; } else m[j]=0; if(m[j]>longest) { longest=m[j]; place=j-longest+1; } if(longest==n)return s.substr(place,longest); } } if(longest==0)return ""; else return s.substr(place,longest); } int main() { ios::sync_with_stdio(0); cin.tie(); cin>>n; cin>>s; cin>>t; cout<<Longest_common_substr()<<endl; return 0; } can you please suggest any modifications? |
| help me!!! WA 32 | zzyzzy12 | 1912. Руины титанов: проходя сквозь стены | 28 июл 2013 20:20 | 1 |
|
| WA#1 | Stolyarov Artyom | 1228. Массив | 28 июл 2013 19:11 | 1 |
WA#1 Stolyarov Artyom 28 июл 2013 19:11 I have WA 1 but on my computer all ok. Is first test not like in statement? |
| AC Python 3.3 | lomobit | 1319. Отель | 28 июл 2013 00:16 | 1 |
num = int(input()) arr = [] for i in range(num): arr.append([]) for j in range(num): arr[i].append([])
check = 1 for i in range(num-1,-1,-1): x = 0 y = i while y != num: arr[x][y] = check check += 1 y += 1 x += 1 for i in range(1,num,1): x = i y = 0 while x != num: arr[x][y] = check check += 1 y += 1 x += 1 string = '' for i in range(num): for j in range(num): string += (str(arr[i][j]) + ' ') print(string) string = '' |
| AC Python 3.3 | lomobit | 1313. К вопросу о спорте | 27 июл 2013 23:54 | 1 |
num = int(input()) arr = [] for i in range(num): temp_arr = input().split(' ') arr.append(temp_arr) string = '' for i in range(num): k = i j = 0 while k >= 0: string += (arr[k][j] + ' ') k -= 1 j += 1 for i in range(1,num,1): k = num - 1 j = i while j != num: string += (arr[k][j] + ' ') k -= 1 j += 1 print(string) |
| No subject | Mariana | 1572. Екатеринозаводский колодец | 27 июл 2013 13:54 | 1 |
Edited by author 27.07.2013 13:58 Edited by author 27.07.2013 13:58 |
| @admin I think #42 is illegal. | William Chou | 1915. Руины титанов: воссоздание былого | 27 июл 2013 11:07 | 4 |
The problem say that "It is guaranteed that during the experiment each time a coin was to be removed the stack was not empty." But when I submit such a brute force code: -------------------- if (x > 0) a[t++] = x; else if (x == 0) { if (t + t < maxn) { copy(a, a + t, a + t); t += t; } } else printf("%d\n", a[--t]); -------------------- It crashed at #42. Then, I modified the last "else branch" into: -------------------- else if (t) printf("%d\n", a[--t]); -------------------- I got WA at #42. What if t = maxn/2 + 1 and than t + 1 pop operations? For example: 1000000 1 0 0 .. 0 (20 times) -1 -1 .. -1 (1000000 - 21 times) You will store only 2^19 copies in array, and get crash Oh..Sorry..It's my fault. I only set the size of a to 1000001 * 2, but I forgot to modify the maxn.... I apologize for asking so stupid question.T_T Accepted now, thank you very much. Yeah,I've made the same mistake,and thank you so much! |
| WA3 I cant find the error | Arturo | 1723. Книга Сандро | 27 июл 2013 05:49 | 1 |
#include<iostream> #include<stdio.h> #include<string.h> using namespace std; char v[53];int ch[53]; char vi[53][5],*punt=NULL,vf[53],vc[53],vp[53],*a,vt[53],chr[3]; int maxl=0,maxt=0,k,b,max2,l=0; int n,j=0,i,ind; main() { gets(v); n=strlen(v); if(n==1){cout<<v;} else{ for(i=0;i<n-1;i++) { // carga inicial vi[i][0]=v[i] ; vi[i][1]=v[i+1] ; ch[i]=0; } for(i=0;i<n-1;i++) { punt=strstr(v,vi[i]); if(punt!=NULL) { ch[punt-v]++; } } for(i=0;i<n-1;i++) { if(ch[i]>maxt) { maxt=ch[i]; ind=i; } } strcpy(vc,vi[ind]); strcpy(vp,v); punt=strstr(v,vi[ind]); i=0; strcpy(vf,vi[ind]); if (maxt!=0) { while(1) { b=1; punt=strstr(v,vf); chr[0]=punt[2+l]; strcat(vf,chr); k=2+l; k++; l++; if(l==strlen(punt))break; max2=0; strcpy(vp,v); while(1) { punt=strstr(vp,vf); if(punt!=NULL) { j=strlen(punt); for(i=0;i<j-1;i++) { vp[i]=punt[i+1]; } vp[i]='\0'; max2++; if (max2>=maxt) { maxt=max2; strcpy(vc,vf); b=0; } } if(punt==NULL)break; } if(b==3) break; } } cout<<vc; }} |
| Problem 1392. Dreaming of Stars has been rejudged | Vladimir Yakovlev (USU) | 1392. Тяга к звёздам | 26 июл 2013 21:06 | 1 |
New tests were added to the problem. First tests were replaced with examples from the problem statements. 106 authors have lost AC after the rejudge. |
| Getting WA #7 | paarth | 1297. Палиндромы | 26 июл 2013 12:01 | 5 |
I have used manacher'a algorithm and tried all the test cases discussed in these discussions and getting correct solution.... I have used manacher for even and odd palindromes separately and found the longest and if longest comes again... as in the same length..take the smaller start.. but now,... I got WA #7 ...I initially faced some problem in compilation too..please suggest some test case P.S. : m doing while(getline(cin,string)) and also tried while(cin>>string) is something to be done here...please suggest Got AC...small error in code: basically typo :D It's just bruteforce task. if string is like : abcdef you can tranform it like: ^#a#b#c#d#e#f#$ so,even and odd palindromes all is transformed like odd palindromes. |
| WA test#8 | R. Dubinin | 1493. В одном шаге от счастья | 25 июл 2013 14:00 | 3 |
What in test #8? Edited by author 25.07.2013 00:58 Admins, give me some tests, please. i am understand!! need to write std::scanf("%d", &a); insteadd of std::scanf("%i", &a); |
| I found the reason for me WA on 13# | fytain | 1039. Юбилейная вечеринка | 25 июл 2013 09:50 | 1 |
my method is DP: //invite int sum = 0; for (Integer c : guest.children) { sum += DP[c.intValue()][0]; } DP[index][1] = sum + RATE[index]; // do not invite sum = 0; for (Integer c : guest.children) { int max = Math.max(DP[c.intValue()][0], DP[c.intValue()][1]); sum += max; } DP[index][0] = sum; at first, I got WA on 13#, DP the tree should from leaf to root, but at first I sort the guests by its children count, the right way is sort the guests by depth Edited by author 25.07.2013 09:50 |