Search found 1 match

by sizogee
Tue Sep 09, 2008 10:24 pm
Forum: Volume 9 (900-999)
Topic: 913 - Joana and the Odd Numbers
Replies: 32
Views: 17451

Re: 913 - Joana and the Odd Numbers

Getting TLE...


#include <stdio.h>

int main(void) {
long long x = 1;
int done = 0;

while (done != 1) {
scanf("%ld", &x);
if (x == 0)
done = 1;
else {
x += 1;
x /= 2;
printf("%ld\n", (3 * ((2 * (x * x)) - 3)));
}
}
return 0;
}


99999999 and 1000000001 both work. Entering a non ...

Go to advanced search