Search found 8 matches

by Ashganek
Wed Mar 15, 2006 2:35 am
Forum: Volume 105 (10500-10599)
Topic: 10586 - Polynomial Remains
Replies: 6
Views: 5218

It is not that x^0 + 1 = 1 + 1 = 1.

Try to div by x^0 + 1:

x^2 - x^2
-------------------
x^2 + 2x + 4 : x^0 + 1
-x^2 - x^2
-------------------
-x^2 + 2x + 4
+x^2 + x^2
-------------------
x^2 + 2x + 4

you got a neverending loop.
by Ashganek
Tue Jan 24, 2006 7:25 pm
Forum: Volume 103 (10300-10399)
Topic: 10359 - Tiling
Replies: 12
Views: 7093

Ok, I defined my own max and switched to cstdio and I got it :)
by Ashganek
Tue Jan 24, 2006 7:04 pm
Forum: Volume 103 (10300-10399)
Topic: 10359 - Tiling
Replies: 12
Views: 7093

dev-cpp.

since when or is undeclered ? :o

which header i have to include to get max in gcc then?
by Ashganek
Tue Jan 24, 2006 5:16 pm
Forum: C++
Topic: Compile error, could someone take a look?
Replies: 1
Views: 1735

Compile error, could someone take a look?

Could someone compile it using gcc and show me what is wrong (since it works in dev-cpp).

#include <cstdlib>
#include <iostream>

using namespace std;

typedef struct {
int len;
char digits[100];
} bint;

bint *results[251];

void init_bint(bint *b)
{
for( int i = 0; i < 100; i++ )
b->digits[i ...
by Ashganek
Tue Jan 24, 2006 4:40 pm
Forum: Volume 103 (10300-10399)
Topic: 10311 - Goldbach and Euler
Replies: 98
Views: 33772

I guess too many for and while ;P

I made it this way:

1. get primes into array
2. if n lower then 5 - not sum
3. if n is odd
3.1 if n-2 is prime - sum of 2 and n-2
3.2 else not sum
4. if n is even get half of it and serach for first prime bigger and lower then n/2
4.1 if sum of them is n - sum of ...
by Ashganek
Tue Jan 24, 2006 2:09 pm
Forum: Volume 103 (10300-10399)
Topic: 10359 - Tiling
Replies: 12
Views: 7093

10359 - Tiling - CE

Could anyone take a look and tell me why I got CE? (it works on my computer)

// cut... :)
by Ashganek
Fri Jan 20, 2006 12:56 am
Forum: Volume 105 (10500-10599)
Topic: 10583 - Ubiquitous Religions
Replies: 33
Views: 20388

Ok, I made it using other way :)
by Ashganek
Thu Jan 19, 2006 10:46 pm
Forum: Volume 105 (10500-10599)
Topic: 10583 - Ubiquitous Religions
Replies: 33
Views: 20388

10583 - Runtime Error :(

#include <cstdlib>
#include <iostream>
#include <list>

using namespace std;

int main(int argc, char *argv[])
{
int n, m, l, r, d, w, c = 0, x = 0;
list<int> lista;

while( cin >> n >> m ) {
if( n == 0 and m == 0 )
break;


int *students[n+1];
int religions[n+1], temp[n+1];
c++; d = 1 ...

Go to advanced search