Expression | Defined as Member Functions | Defined as Non-Member Functions |
a+b | myarray operator+(myarray b) | myarray operator+(myarray a, myarray b) |
1+a | N/A | myarray operator+(int a, myarray b) |
a+1 | ||
a=b | ||
a>b | ||
10<b | ||
cin>>a |
ArkPhaze, either I'm a mathematical genius or I'm just not seeing something that you are, i went to the very end, and the question with the least solves is rathe rsimple still.
First off why the snippiness? I said most were rather simple and they are at least the ones i looked at. I was hoping for a more civil response. for that one, anyone whose taken a statistics or numerical analysis class should be fine. Which you as a software engineer would have taken. I might take a look at it later, work and all.
I'm not promising anything though, term paper two midterms and group project with a set of idiots trumps proving something to you :D you know the old irl > internet guy thing
I suppose it comes down this; according to my university profs at least...
The Software Engineer Identifies the problems and solutions.
The Computer Scientist creates the algorithms and routines required for the solution.
The Developers apply them.
But they all take very similar classes.
So I'd say some of these programming questions are geared towards the middle section, who traditionally need to be able to do higher level math/ think laterally/ etc.
You did actually manage to make a point with that question (i pondered it at work on a break). It is overall a rather simple question, but upon looking further the amount of meals created could be infinite (if each meal is found unfavorable) but the tendency for that to happen would be smaller and smaller as it goes on (lim(p)=0). I suppose you did raise a valid point, and i apologize for my harshness beforehand. I looked at this one: https://projecteuler.net/problem=484 which youll see is piss easy. And i was doing so on the run, as I often do, if I had looked at more problems I would have been more inclined to agree with you. Actually looking over it again i see its the same one you looked at :)
Tl;DR: We both raised valid points but how quickly I read/responded made me seem cunty, and made me think you were being snippy/assuming i was talking out my ass. (pet peeve)
Also; I apologize for hogging this thread from OP, ArkPhaze, Id probably enjoy a PM convo with you. I'm peacing from this thread though, unless OP comments on my Practice problems for him :p
The problem I keep having with 80% of the project euler problems, after about Q#~150 or so especially, is that the majority of them require a math genius that understands how to derive mathematical patterns out of a solution set, or common logic between possible solutions, rather than a programmer that is able to come up with an algorithm to do as such. Regardless if your algorithm is accurate and efficient, and whether or not it's a bruteforce, seems like it's not enough once you solve a few.
The questions up to about Q#50 are good though. After that it requires less of a programmer and more of a mathematician, and increasingly so, onwards...
I never said all of them are complex, which is why if you read my post you'll notice that I put a percentage of the latest questions that are complex. If you'd like to prove something, then solve it:
https://projecteuler.net/problem=481 (https://projecteuler.net/problem=481)
Full explanation and code required. I'll be waiting for it.
typedef struct {
int id, // chef id
skill; // chef skill level
} Chef;
std::set<Chef> *S; // set of chefs to test, iteratively
typedef struct {
int id, // chef id
skill; // chef skill level
} Chef;
std::set<Chef> *S; // set of chefs to test, iteratively
/*
* somehow filling the set with data
*/
std::set<Chef>::iterator i, max, omax;
i = max = omax = S->begin();
do {
if (i->skill > max->skill) {
omax = max;
max = i;
} else if (i->skill > omax->skill) // still need to test against omax or else we could end up accidentally missing the second-place winner
omax = i;
} while (i++ != S->end());
S->erase(omax);
typedef struct {
int id, // chef id
skill; // chef skill level
} Chef;
std::set<Chef> *S; // set of chefs to test, iteratively
/*
* somehow filling the set with data
*/
std::set<Chef>::iterator i, max, omax;
i = max = omax = S->begin();
do {
if (i->skill > max->skill) {
omax = max;
max = i;
} else if ((max == omax) || (i->skill > omax->skill)) // still need to test against omax or else we could end up accidentally missing the second-place winner; inefficient, I know, but this should help us ensure that we don't eliminate the winner
omax = i;
} while (i++ != S->end());
S->erase(omax);
Enter your phrase: WTF 19.
Whiskey Tango Foxtrot One Niner STOP
Enter your phrase: .