| Show all threads Hide all threads Show all messages Hide all messages |
| WA #5 | Vaganov | 1083. Factorials!!! | 4 Dec 2010 13:40 | 2 |
WA #5 Vaganov 27 Oct 2010 14:46 use long long... this test has big n |
| TO ADMINS: Why I get WA instead of RE after call "assert(false)" or just "abort()" (C++) ?? | Lezhankin Petr [Ufa] | | 4 Dec 2010 13:20 | 1 |
1) #include <iostream> #include <assert.h> int main() { assert(false); int a, b; std::cin >> a >> b; std::cout << a + b; return 0; } 2) #include <iostream> #include <assert.h> int main() { abort(); int a, b; std::cin >> a >> b; std::cout << a + b; return 0; } 3) #include <iostream> #include <assert.h> int main() { int a, b; std::cin >> a >> b; std::cout << a + b; return 1; } all of this solution gets WA1 submitted as problem 1000. Is it normal behavior?? I haven't ever seen Judge System that interprets calls of assert() in such a way. Edited by author 06.12.2010 00:20 |
| WA31 | TheDreamCatcher | 1793. Tray 2 | 4 Dec 2010 09:50 | 1 |
WA31 TheDreamCatcher 4 Dec 2010 09:50 |
| binary search, but Wrong Answer Test 4. (1196) | fsb4000 | 1196. History Exam | 4 Dec 2010 00:04 | 1 |
Sorry, I have confused. Edited by author 04.12.2010 00:06 |
| Some tests | Rustam Ganeyev | 1198. Jobbery | 3 Dec 2010 19:30 | 2 |
Very good problem. Thx to autors! Some tests, that helped me to to solve that problem. 7 2 7 0 3 0 4 0 5 0 3 0 1 0 6 0 answer: 1 6 7 0 9 3 5 0 3 0 2 8 0 5 0 4 6 0 7 9 0 6 0 9 0 0 answer: 1 0 9 2 0 3 4 0 1 0 5 8 0 6 0 4 0 3 8 0 9 0 7 0 answer: 1 2 3 4 5 6 7 8 9 0 3 2 0 3 0 0 answer: 1 0 3 2 0 3 0 1 0 answer: 1 2 3 0 5 2 0 3 0 0 3 0 4 0 answer: 0 4 2 3 0 1 0 0 1 0 answer: 4 0 Edited by author 05.12.2009 04:56 |
| I got WA on the test2 | zhuaiyaa | 1030. Titanic | 3 Dec 2010 17:13 | 1 |
Can anyone give me a test?Thanks a lot. |
| Can you help me? | Nike_1 | 1112. Cover | 3 Dec 2010 12:40 | 1 |
My english ability is very poor!So I can't express correctly~I feel very sorry. About this problem,I have tried many data.But I am sorry I can't found that anything is wrong.Next I will give my code,I hope somebody can help me,or give me some hints.Thank you very much~ #include "stdio.h" #include "malloc.h" int main() { int amount,i,j; int **endpoint; int *flag,temp; int max,index = -1; int condition = 0,count = 0; int test = 0; scanf("%d",&amount); // if(amount <= 0 || amount >= 100) // { // return 0; // } endpoint = (int **)malloc(sizeof(int*) * amount); flag = (int *)malloc(sizeof(int) * amount); for( i = 0;i < amount;i ++) { endpoint[i] = (int *)malloc(sizeof(int) * 2); } flag = (int *)malloc(sizeof(int) * amount); for( i = 0;i < amount;i ++ ) { scanf("%d%d",&endpoint[i][0],&endpoint[i][1]); if( endpoint[i][0] == endpoint[i][1] || endpoint[i][0] > 999 || endpoint[i][0] < -999 || endpoint[i][1] > 999 || endpoint[i][1] < -999) { return 0; } flag[i] = 0; if(endpoint[i][0] > endpoint[i][1]) { temp = endpoint[i][0]; endpoint[i][0] = endpoint[i][1]; endpoint[i][1] = temp; } } //排序 for(i = 0; i < amount - 1 ;i ++) { for(j = i + 1;j < amount;j++) { if(endpoint[i][0] > endpoint[j][0]) { temp = endpoint[i][0]; endpoint[i][0] = endpoint[j][0]; endpoint[j][0] = temp; temp = endpoint[i][1]; endpoint[i][1] = endpoint[j][1]; endpoint[j][1] = temp; } } } while(condition != 0 || count == 0 ) { condition = 0; test = 0; for(i = 0;i < amount;i ++) { if(endpoint[i][0] !=0 || endpoint[i][1] != 0) { for(j = 0;j < amount;j ++) { if(endpoint[j][0] !=0 || endpoint[j][1] != 0) { if(endpoint[i][0] > endpoint[j][0] && endpoint[i][0] < endpoint[j][1] ) { flag[i] += 1; } else if(endpoint[i][0] <= endpoint[j][0] && endpoint[i][1] >= endpoint[j][1] ) { if(i != j && ( endpoint[i][0] != 0 || endpoint[j][0] != 0 )) flag[i] += 1; } else { if(endpoint[i][1] > endpoint[j][0] && endpoint[i][1] < endpoint[j][1]) { flag[i] += 1; } } } } } } max = flag[0]; index = 0; condition += flag[0]; flag[0] = 0; for( i = 1 ;i < amount;i ++ ) { condition += flag[i]; if(max < flag[i]) { max = flag[i]; index = i; } flag[i] = 0; } if(index != -1 && condition != 0 ) { endpoint[index][0] = 0; endpoint[index][1] = 0; } count ++; } printf("%d\n",amount - count + 1); for(i = 0 ;i < amount;i ++) { if(endpoint[i][0] != 0 || endpoint[i][1] != 0) { printf("%d %d\n",endpoint[i][0],endpoint[i][1]); } } return 0; } |
| 0.046s. Who's better? (-) | Kraev Alexey | 1462. Uncle Scrooge's Gold | 2 Dec 2010 12:17 | 9 |
Please, send me your solution or algorithm!!! my email: xujand000@rambler.ru Edited by author 23.10.2006 19:00 I'm also interested in a c++ solution of this problem, please send to tabledott@gmail.com Simple problem... FFT can be used to solve it, but for what purpose??? |
| some test | hoan | 1302. Delta-wave | 1 Dec 2010 23:47 | 1 |
input: 1 1000000000 1 27 1 29 1 31 74 74747474 output: 63243 9 9 9 17275 GOOD LUCK!!! |
| Why WA#9? | Michael Evdokimov | 1227. Rally Championship | 1 Dec 2010 19:49 | 2 |
Why WA#9? Michael Evdokimov 24 Sep 2006 17:10 try this: input: 3 2 12 1 2 10 2 3 5 output: YES if you WA#17 try this: input: 4 3 12 1 2 5 1 3 4 3 4 4 output: YES GOOD LUCK!!! |
| if you have WA#3 swap x and y. | hoan | 1250. Sea Burial | 1 Dec 2010 18:04 | 1 |
|
| 1584 test 3 WA | Sergey Papayan (RAU) | 1083. Factorials!!! | 1 Dec 2010 17:28 | 1 |
3 3 abc def ghi 5 __________ 4 3 baab aaaa baab 0 ___________ 4 4 aaaa abba abba aaaa 0 ________ и.т.д. ВСЁ ВРОДИ ПРАВИЛЬНО НИ КАК НЕ НАЙДУ ОЩИБКУ!!! |
| 1584 WA 3 | Sergey Papayan (RAU) | 1001. Reverse Root | 1 Dec 2010 17:27 | 1 |
1584 WA 3 Sergey Papayan (RAU) 1 Dec 2010 17:27 3 3 abc def ghi 5 __________ 4 3 baab aaaa baab 0 ___________ 4 4 aaaa abba abba aaaa 0 ________ и.т.д. ВСЁ ВРОДИ ПРАВИЛЬНО НИ КАК НЕ НАЙДУ ОЩИБКУ!!! |
| Why WA in test 2. My code here. Please help me. | ductam | 1055. Combinations | 1 Dec 2010 13:47 | 3 |
#include<stdio.h> #include<conio.h> long int i,j,n,m,aa,bb,cc,lap,k,l; int a[50001],sont; int dem[50001]; long int kq; void InitPrime(); long int Max(long int x,long int y); long int Min(long int x,long int y); void InitDem(); void Test(); int main() { scanf("%ld %ld",&n,&m); aa=Max(n,m); bb=Min(n,m); cc=aa-bb;
InitDem(); InitPrime(); // Test();
lap=Max(bb,cc); i=lap+1; // tinh so nguyen to o tren tu while(i<=aa) { k=0; l=i; while(l!=1) { k++; while((l%a[k])==0) { l=l/a[k]; dem[a[k]]++; } } i++; }
// tinh so nguyen to duoi mau lap=Min(bb,cc); i=2; // tinh so nguyen to o tren tu while(i<=lap) { k=0; l=i; while(l!=1) { k++; while((l%a[k])==0) { l=l/a[k]; dem[a[k]]--; } } i++; }
//dem ket qua kq=0; i=2; while(i<=aa) { if(dem[i]!=0) kq+=dem[i]; i++; } printf("%ld",kq);
getch(); return 0; } void InitDem() { i=1; while(i<=aa) { dem[i]=0; i++; } } long int Max(long int x,long int y) { if(x<=y) return y; return x; } long int Min(long int x,long int y) { if(x<=y) return x; return y; } void InitPrime() { int flag; long int x; a[1]=2; a[2]=3; a[3]=5; a[4]=7; i=4; x=11; while(x<aa+1) { j=2; flag=1; while(j*j<x) { if(x%j==0) { flag=0; break; } j++; } if(flag==1) { a[++i]=x; } x+=2; } sont=i; } void Test() { for(i=1;i<=sont;i++) printf("%d\n",a[i]); // getch(); } Hi, Try these test cases: Test Cases 200000 40000 9011 100000 35000 6109 123456 12345 3892 987654 98765 25861 560011 12000 5255 340999 43560 11372 235000 34001 8723 89340 10000 3123 98112 23 35 4567 456 212 Varun Hi, Try these test cases: Test Cases 200000 40000 9011 100000 35000 6109 123456 12345 3892 987654 98765 25861 560011 12000 5255 340999 43560 11372 235000 34001 8723 89340 10000 3123 98112 23 35 4567 456 212 Varun N M between 1 & 50 000 |
| <TOP SECRET> 15 лет колоний и лагерей будет | [Kontur]andrew_iv | 1055. Combinations | 1 Dec 2010 11:13 | 3 |
#include <iostream> using namespace std; int i,o,n,m,k,nm[50001],n_m[50001],n_n[50001],c; bool bb[50001]; int main() { cin>>n>>m; bb[1]=true; for(i=2;i<=n;i++) if (!bb[i]) for(o=2*i;o<=n;o+=i)bb[o]=true; for(i=2;i<=n;i++) if (bb[i]) { k=i; for(o=2;o<=i;o++) if (!bb[o]) { while(k%o==0) { nm[o]++; k/=o; } if (k==1) break; } } else { nm[i]++; } for(i=2;i<=m;i++) if (bb[i]) { k=i; for(o=2;o<=i;o++) if (!bb[o]) { while(k%o==0) { n_m[o]++; k/=o; } if (k==1) break; } } else { n_m[i]++; } for(i=2;i<=n-m;i++) if (bb[i]) { k=i; for(o=2;o<=i;o++) if (!bb[o]) { while(k%o==0) { n_n[o]++; k/=o; } if (k==1) break; } } else { n_n[i]++; } for(i=2;i<=n;i++) { nm[i]-=n_n[i]+n_m[i]; if (nm[i]>0) c++; } cout<<c; return 0; } |
| WA#3 | hoan | 1245. Pictures | 30 Nov 2010 22:16 | 1 |
WA#3 hoan 30 Nov 2010 22:16 in this test ther is only one pictures need, like this: input: 1 100 0 0 output: 40000 GOOD LUCK!!! |
| Here some tests... They saved me... | Liceum 145(Lexus,Valero) | 1245. Pictures | 30 Nov 2010 22:15 | 2 |
>2 0 0 8 2 2 6 My output: 10000 3 745 852 22 49 235 549 856 460 11 My output: 3412016 |
| Что не так?( Why WA test 2) | fsb4000 | 1048. Superlong Sums | 30 Nov 2010 20:05 | 1 |
#include<iostream> #include<cstdlib> #include<vector> #include<string> using namespace std; typedef vector<long> lnum; const long base=1000*1000*1000; void print(lnum a){ printf ("%d", a.empty() ? 0 : a.back()); for (int i=(int)a.size()-2; i>=0; --i) printf ("%09d", a[i]); } void a_plus_b_a(lnum &a, lnum b){ long carry = 0; for (size_t i=0; i<max(a.size(),b.size()) || carry; ++i) { if (i == a.size()) { a.push_back (0); } a[i] += carry + (i < b.size() ? b[i] : 0); carry = a[i] >= base; if (carry) { a[i] -= base; } } } lnum string_to_Super_long_number(string s){ lnum a; for (int i=(int)s.length(); i>0; i-=9) { if (i < 9) { a.push_back (atoi (s.substr (0, i).c_str())); } else { a.push_back (atoi (s.substr (i-9, 9).c_str())); } } while (a.size() > 1 && a.back() == 0){ a.pop_back(); } return a; } int main(void){ lnum a,b; long i; long m; char c; string s1="",s2=""; cin>>m; for(i=0;i<m;i++) { cin>>c; s1=s1+c; cin>>c; s2=s2+c; } a=string_to_Super_long_number(s1); b=string_to_Super_long_number(s2); a_plus_b_a(a,b); print(a); cout<<endl; system("pause"); return 0; } |
| WA24 | TheDreamCatcher | 1354. Palindrome. Again Palindrome | 30 Nov 2010 18:53 | 1 |
WA24 TheDreamCatcher 30 Nov 2010 18:53 I used in my program char a[10000]; cin>>a; after I used char a[10001]; cin>>a; and got AC |
| WA #2 | Pavel Kovalenko | 1303. Minimal Coverage | 30 Nov 2010 16:54 | 2 |
WA #2 Pavel Kovalenko 30 Nov 2010 16:37 I really do not understand where the error occurred. For most useful i shift all coordinates on 1 to right. Here is my code: http://pastebin.com/LpZfCwYgI find my error. I misunderstood statement. I thought that I cover the cell matrix 1xM. |