Search found 16 matches
- Fri Aug 06, 2004 1:47 pm
- Forum: Volume 102 (10200-10299)
- Topic: 10245 - The Closest Pair Problem
- Replies: 92
- Views: 14830
10245 - The Closest Pair Problem - brute force => WA :|
J get WA by brutr force, first j sort all points by x next check all n^2 , witch some optimalization by x end get WA plese give mi some sample input/output or find bug im my prog meybe problem is in rounding ?? [c] #include<stdio.h> #include<stdlib.h> #include<math.h> struct point { long double x,y;...
- Thu Jul 29, 2004 1:01 pm
- Forum: Algorithms
- Topic: can any body inform me the best prime generating algorithm ?
- Replies: 17
- Views: 6528
Jdont like Sieve of Eratosthenes :P somthing like that take les memory (only prime numbers) for(i=6;i<=2000000;i+=6) { for(j=0;;j++){ if((i-1)%fst[j]==0)break; if((fst[j]*fst[j])>(i-1)) {fst[liczp]=i-1; countprime++; break;}} for(j=0;;j++){ if((i+1)%fst[j]==0)break; if((fst[j]*fst[j])>(i+1)) {fst[li...
- Thu Jul 29, 2004 12:15 pm
- Forum: Volume 106 (10600-10699)
- Topic: 10604 - Chemical Reaction
- Replies: 24
- Views: 15545
J get AC 0:00.158 after one modification j was geting TLE J using dymic programing + recurence all data stored in int tst[11][11][11][11][11][11]; table and all secret is DO NOT CLEAR TABLE it take too much time beter is declarate second table tst[11][11][11][11][11][11]; end for valible data who ca...
- Thu Jul 29, 2004 9:52 am
- Forum: Algorithms
- Topic: Segmentation Fault
- Replies: 6
- Views: 1839
- Thu Jul 29, 2004 9:30 am
- Forum: Algorithms
- Topic: tree matching algorithm
- Replies: 3
- Views: 3723
- Thu Jul 29, 2004 9:28 am
- Forum: Algorithms
- Topic: I'm collecting cool graph algorithms problems
- Replies: 13
- Views: 5211
- Thu Jul 29, 2004 9:26 am
- Forum: Algorithms
- Topic: BigInteger
- Replies: 10
- Views: 3406
- Wed Jul 28, 2004 5:00 pm
- Forum: Volume 6 (600-699)
- Topic: 640 - Self Numbers
- Replies: 47
- Views: 19414
- Wed Jul 28, 2004 4:52 pm
- Forum: Algorithms
- Topic: BACKTRACKING
- Replies: 5
- Views: 2349
same problems can be slove by itteration by cheacking all ways witchaut backtraicing for example knapsack problem can be sloved by backtraicing end also you can benerate all numbers in binary n=3 000 001 010 100 011 .... means you take thing where is 1 all numbers can be grenrate witchaut bactraicin...
- Wed Jul 28, 2004 9:32 am
- Forum: Volume 1 (100-199)
- Topic: 167 - The Sultan's Successors
- Replies: 21
- Views: 4312
- Wed Jul 28, 2004 9:13 am
- Forum: Algorithms
- Topic: Euler circuit
- Replies: 2
- Views: 1781
- Fri Jul 09, 2004 10:21 pm
- Forum: Volume 106 (10600-10699)
- Topic: 10680 - LCM
- Replies: 38
- Views: 13837
- Tue Jul 06, 2004 8:28 am
- Forum: Volume 106 (10600-10699)
- Topic: 10680 - LCM
- Replies: 38
- Views: 13837
j use this algoritm but j get wa pleas give me some simple input output program pased all input who was on forum #include <stdio.h> unsigned int pierwsze[100000]; unsigned int fstost[100000]; unsigned int liczp=2; unsigned int oset; unsigned int iled; unsigned int ilep; unsigned int inline mnoz(unsi...
- Wed May 19, 2004 7:51 pm
- Forum: Volume 5 (500-599)
- Topic: 530 - Binomial Showdown
- Replies: 137
- Views: 37267
- Fri Apr 23, 2004 2:54 pm
- Forum: Volume 100 (10000-10099)
- Topic: 10062 - Tell me the frequencies!
- Replies: 235
- Views: 44076
10062 tell me frequences!!!! WA 10062
hello why j get wa ?? #include<stdio.h> char stat [512]; void pw(void) { int i,j; for(i=1;i!=1024;i++) { j=500; while(j--) { if(stat[j]==i)printf("%d %d\n",j,stat[j]); } } } main() { int i; char ch; while(1) { ch=getchar(); if(ch=='\n'|| ch=='\r'){pw(); for(i=0;i!=512;i++)stat =0; printf(&...