Moderators: Darobat, RecursiveS, Dante Shamest, Bugdude, Wizard, raimo
Good thinking of you guys, I've also had some problems with his way of posing the problem.Alvaro wrote:The guy that writes the problems for mathschallenge.net (let's call him Euler), has screwed up a couple of times, either proposing a problem with poor or incorrect wording, or introducing the wrong number as the answer. A few other members of the "100% club" and I offered our help with testing the problems before they are released.
That's fair, true sportmanship!Alvaro wrote:So, actually, I have already solved the three problems. I will probably send in the solutions one day after the problems are released.
#include "fstream"
main()
{
int value=1, pos=31, op=1;
char grid[832];
std::ifstream f("input.txt");
while (f.getline(grid+op++*32, 32));
while (op)
{
int delta = "AAAAAAAAAAAAAAAAAAAAAAAAAAA `?A `?A `?A"[op]-64, g = grid[pos+=delta] - '0';
op<31 ? value*=g : value += op<35?g:-g;
op = "The quick brown fox jumps over a lazy dog. The quick brown fox jumps over a lazy dog. Out of spac\035 \036\000\041\040\042\043\045\044\046 \034\037 \033"[grid[pos+=delta]];
}
printf("%i\n", value);
}I think you should have exploited the fact that globals are initialized at zero and that x - y == x + -y. Furthermore, the while loop can be one statement (comma operator).Beer Hunter wrote:Well, now that we've hit the time limit, here's my 117-token entry:<snip>
#include <stdio.h>
char*_="XxTIHRCXCxTIHRXRCxTIHXHRCxTIXIHRCxTXTIHRCxXxTIHRCX";
int main(int l){for(l+=7;l!=putchar(010);++l);if(*(++_))main
(*_!=88?(putchar(*_^073)|putchar(33))&1:0xffff2a8b);}Users browsing this forum: No registered users and 1 guest