Common Boardrun_id = 2970301 test: 10 10 1 1 10 10 1211211212 2111221212 2221001111 1112112012 2112102112 2111200222 1112021212 2222011211 2112222222 2012122122 right_answer: 12 1 my program produces answer 14 1 I found that an AC program(by others) gave me a incorrect answer in this test: #XO X#O X#O my program outputs:Ouths win but the AC program outputs:Crosses win So i think this test should be added up and the problem should be rejudged.thanks. Read "Site news". Your test is incorrect, because game is already finished by Noughts. Rashad 1409 [4] 14 Apr 2010 07:51 Getting WA in case number 2. Do anyone know what is test #2???? Please help. dAFTc0d3r [Yaroslavl SU] Re: 1409 [3] 15 Apr 2010 09:59 This problem is very easy. Just try to think a little bit. I am having some problem with input 10 10. One is starting from left side another is starting from right side. Can they shot 10 can each???? What should I do?? Can you send me some easy problem list for solving. I wanna build up my confidence. Will you help me??? dAFTc0d3r [Yaroslavl SU] Re: 1409 18 Apr 2010 23:18 1 2 3 4 5 6 7 8 9 x 9 8 7 6 5 4 3 2 1 The ans for 10 10 is 9 9. Algorithm right, but what in 8 test? Please, give me test; OH I've found my mistake!!!!! Edited by author 19.04.2010 17:58 Edited by author 19.04.2010 17:59 I have a good test. Can you add it? Send it to our support email I've sent a test to "timus_support@acm.timus.ru". Have you received it? I have got new good test. Can you add it? Send it to our support email I've sent a test to "timus_support@acm.timus.ru". #include<iostream> using namespace std; double a[100],s1,s2; int n; void read() { int i; cin>>n; for(i=0;i<n;i++) cin>>a[i]; } void z() { int i; s1=a[0]; for(i=1;i<n;i++) { if(s1<s2) s1+=a[i]; else s2+=a[i]; } if(s1<s2) cout<<s2-s1<<endl; else cout<<s1-s2<<endl; } int main () { read(); z(); return 0; } Edited by author 03.11.2009 03:34 Hello. I write program and test it on input example. It works. But when i send it i receive wrong answer at test #1. Please tell me what test fail and tell what need more in program for complete all tests. #include <iostream> #include <vector> #include <string> #include <stdlib.h> using namespace std; int table[256]; string convert(string str) { char buf[1]; string res; res.resize(str.length()); for (int i = 0; i<str.length(); i++) { sprintf(buf, "%d", table[str[i]]); res[i] = buf[0]; } return res; } void fill() { table['i'] = table['j'] = 1; table['a'] = table['b'] = table['c'] = 2; table['d'] = table['e'] = table['f'] = 3; table['g'] = table['h'] = 4; table['k'] = table['l'] = 5; table['m'] = table['n'] = 6; table['p'] = table['r'] = table['s'] = 7; table['t'] = table['u'] = table['v'] = 8; table['w'] = table['x'] = table['y'] = 9; table['o'] = table['q'] = table['z'] = 0; } int main() { fill(); string number; int numword; while(1) { cin >> number; int z = number.find('-'); if (z!=-1) break; cin >> numword; vector<string> dict(numword); for (int i = 0; i<numword; i++) { cin >> dict[i]; } int pos = 0; bool flag = false; for (int i = 0; i<numword; i++) { if (convert(dict[i]).compare(number.substr(pos, dict[i].length()))==0&&pos+dict[i].length()<=number.length()) { cout << dict[i]; if (pos+dict[i].length()<number.length()) { cout << " "; } flag = true; pos += dict[i].length(); } } if (flag==false) { cout << "No solution.\n"; } else { cout << "\n"; } } return 0; } Who can explain me: if N == 1, what numbers (a, b, c) the knight can say? You are right! N can not be equal to 1. Problem statement is updated. Does anybody gain it? Your ideas? Well, my fault, didn't read statement carefully. # include <string.h> # include <iostream.h> int main() { char a[100][30]; int N,i,j,k,h; cin>>N; if (0<=N && 100>=N) { for (i=0;i<N;i++) cin >>a[i]; for (i=0;i<N;i++) { k=0; for (j=0;j<N;j++) { if (strcmp(a[i],a[j])==0) k++; } if (k>=2) { h=0; for(j=0;j<i;j++) { if(strcmp(a[i],a[j])!=0) h++; } if (h==i) cout<< a[i]<<endl; } } } return 0; } char a[100][30]; - here is your mistake i change it to char a[128][32]; and I got AC Thanks Boss, I changed from char a[100][30] to char a[128][32] and now i got accepted. Can u explain the reason for it. in the end of string is two system Edited by author 17.04.2010 21:41 Edited by author 17.04.2010 21:41 nvm. Edited by author 25.03.2010 20:45 Code got AC: #include<stdio.h> // #include<conio.h> int kq[200]; int Mod(int x,int n,int m); void Sort(int l,int r); int main() { int n,m,y,i; int t=0; scanf("%d%d%d",&n,&m,&y); for(i=0;i<m;i++) if(Mod(i,n,m)==y) { t++; kq[t]=i; } if(t==0) printf("%d",-1); else { Sort(1,t); for(i=1;i<=t;i++) printf("%d%s",kq[i]," "); } // getch(); return 0; } int Mod(int x,int n,int m) { if(n==0) return 1; if(n%2==0) { return (((Mod(x,n/2,m)%m)*(Mod(x,n/2,m)%m))%m); } else return ((Mod(x,n-1,m)*x)%m); } void Sort(int l,int r) { int t,p,g,mid,tam; t=l; p=r; g=(t+p)/2; mid=kq[g]; while(t<=p) { while(kq[t]<mid) t++; while(kq[p]>mid) p--; if(t<=p) { tam=kq[t]; kq[t]=kq[p]; kq[p]=tam; t++; p--; } } if(t<r)Sort(t,r); if(l<p)Sort(l,p); } How is possible to exceed memory limit on test 19, and I'm using static memory in Pascal... That memory should be exceeded on the first test if it's larger than 32MB ? Problem 1248 disappeared from my list of solved problems, but didn't appear in the list of unsolved problems. Now I've got AC but problem 1248 appeared in my list of unsolved problem... And I have 567 solved problems on my "author's page", but there are 568 solved problems in rating... Edited by author 16.04.2010 22:43 Oops! :) This problem will be investigated. vector<set<int> > and if WA 5 then test this: 9 1 2 3 4 5 6 7 8 and 10 1 2 3 4 5 6 7 8 9 Hmmmmm.... O(n^2) is too slow (-_-). I know O(N+M) solution.You have just to delte leaves, while number of vertex>2.If you will do it righ,you will get O(N+M)solution. Hi, could you please tell me what was the response of my program to the first test since it gives me a "Wrong Answer"? Any1 could give me details about it? No idea wheres my mistake I have no f... idea:/ i have WA #4 or #8. could you tell me why?:( answer of 9*9 is 88.87005769. Is it right? Edited by author 30.10.2008 07:13 Hm...my AC solution say yes Можно как-нибудь исправить эту ошибку? - Edited by author 10.02.2010 00:21 Edited by author 10.02.2010 00:21 решить задачу по-другому =) |
|