| Показать все ветки Спрятать все ветки Показать все сообщения Спрятать все сообщения |
| 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 | Problemset Maintainer | 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 |
| error in test#9 | Cawa222 | 1639. Шоколад 2 | 25 июл 2013 00:45 | 1 |
#include <iostream> #include <math.h> using namespace std; void main(void) { int a,b,c; cin>>a>>b; c=0; c=a/2+a%2+b/2+b%2;
if (((a==1)&&(b!=1))||((a!=1)&&(b==1))) { c=c-1; } if (c%2) cout <<"[:=[first]" ; else cout <<"[second]=:]" ;
} whot is wrong? Edited by author 25.07.2013 00:45 |
| Please give test 2 | Alexander Goncharov | 1200. Рога и копыта | 24 июл 2013 20:23 | 2 |
Please give test 2 for this problem. I don't know test#2. But I think that I know hint. Try this: 5 -5 20 Answer: 6.00 2 0 |
| Can i use Greedy ? | Lifanov | 1389. Дорожные работы | 24 июл 2013 17:15 | 5 |
I take the list (any City with 1 road) and delete this road, then going to connected city and mark all road from it as non-delete, then i going to near city and repeat first step. For example 5 4 1 2 2 3 3 4 3 5 Start with 1 City, delete (1 2) then go in 3 city, and remove (3 4) or (3 5)? Why WA2 ? Sorry fo my English. here is example: 8 7 1 2 2 3 3 4 3 5 4 7 7 8 5 6 Answer depends on the way you go from city 3. Yes. But your algorithm probably realy work wrong. My greedy: While graph is not empty 1. We choose any vertex v: deg(v)=1 (e=(v,u)) 2. Add to the answer edge e. 3. Delete v and u with all its edges from the graph. @Burunduk1 I used the same greedy algorithm as u did but I get WA#2, can u please help me? Edited by author 24.07.2013 17:16 |