Contest 39: Autograder

Online C++ programming contests.

Moderators: Darobat, RecursiveS, Dante Shamest, Bugdude, Wizard, raimo

Postby Corsix » Sun Jul 25, 2004 11:53 am

Current Rankings:
damyan used 196 tokens and was given a grsde of A. *
Alvaro used 201 tokens and was given a grade of A. *
jgbauman used 235 tokens and was given a grade of A. *
Corsix used 262 tokens and was given a grade of B. **
Beer Hunter used 270 tokens and was given a grade of B. **
Bladesniper used 293 tokens and was given a grade of B. **
Dante Shamest used 397 tokens and was given a grade of C.
exomo used 402 tokens and was given a grade of C.
schloob used unknown (400 - 500) tokens and was given a grade of D.
Reddyx used 492 tokens and was given a grade of D.
Syn used 698 tokens was was given a grade of E.
Kybo_Ren has withdrawn (was 850+) and was given a grade of E.

* an expert - can only enter for fun (classed as 250- tokens)
** an intermediate coder - can only enter for fun (classed as 251 - 350 tokens)

For those of you who need some help:

Code: Select all
// What you should do:
int main(...)
{
...
return 0;
}
// But to save tokens:
void main()
{
}


Code: Select all
// NO:
if(fred == bob)
return true;
else
return false;
// YES:
if(fred == bob)
return true;
return false;
// YES YES:
return (fred == bob ? true : false);
// YES YES YES :
return (fred == bob);
Last edited by Corsix on Tue Jul 27, 2004 2:53 am, edited 9 times in total.
Code: Select all
#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);}
User avatar
Corsix
 
Posts: 1181
Joined: Fri Jul 23, 2004 9:33 am
Location: Berkeley, UK

Postby Bladesniper » Sun Jul 25, 2004 12:56 pm

Hey Corsix, you forgot the * near my name... I am doing what i am doing just for the fun of it ( as probably most of us do ) :)

And i accidentaly saw that my program had a bug which automatically dropped my program to 270 tokens after fixing it!

Also, void main() is always wrong, although it won't affect your tokens because inside int main() you can ommit the return statetment.

Guest wrote:I am having trouble trying figure out how to open the files and read from it. I have googled but not really having and luck? Just an example of what to do before using something like this would help.

You won't open anything. That's what you will d: You will read your input in the exact same way as you would do with a file. The only tiny difference is that you will use 'cin' to refer to what you previously called 'fin' ( ex. ifstream fin ( "input.txt" ); ), and you won't open anything. That's all.
When you'll run your program, you will redirect the input. That means that, if you are on windows, you'll open the console and write:
Code: Select all
program.exe < input.txt

That's all.
User avatar
Bladesniper
 
Posts: 337
Joined: Mon Apr 05, 2004 10:46 am
Location: In your mind.

Postby Ryan » Sun Jul 25, 2004 1:05 pm

Thank you Dante Shamest and Corsix. I just wish Ryan would have just said that (in plain english) and not leave it to the beginner to wonder and figure out.

I'm sorry for the confusion. I didn't mean to be obscure, and it's hard to foresee what everyone will need to know to understand the problem. But that's what the forums are for. You had a problem, came here, and found your answer. I'm satisfied with that.

If I do more contests like this (input from stdin, output to stdout), perhaps an addition to the contest FAQ would be in order.
Ryan
Moderator
 
Posts: 323
Joined: Sat Jun 12, 2004 1:34 pm

Postby Ryan » Sun Jul 25, 2004 1:11 pm

I din't get any response to my previous post about different divisions for entries:

Ryan wrote:We could have three divisions for the contest:
  • Beginner - Submissions are checked for correctness only. The winner(s) are those who pass the most tests.
  • Intermediate - Submissions must pass all tests and are judged on brevity (as the contest is now).
  • Advanced - Same rules as intermediate, but reserved for the highest competitors.


I like the idea, but I've decided to put this off for now and implement it in a future contest.

Just in case you were wondering. ;)
Ryan
Moderator
 
Posts: 323
Joined: Sat Jun 12, 2004 1:34 pm

Postby Corsix » Sun Jul 25, 2004 1:35 pm

Ryan wrote:I din't get any response to my previous post about different divisions for entries:
...
I like the idea, but I've decided to put this off for now and implement it in a future contest.

I quite like this idea: we have a league table of coders and then you get awared points for each contest you enter/where you are placed - this way you can classify somebody as beginner/inter.... and then each contest has 3 classes (begin,inter,expert).
User avatar
Corsix
 
Posts: 1181
Joined: Fri Jul 23, 2004 9:33 am
Location: Berkeley, UK

Postby Guest » Sun Jul 25, 2004 2:47 pm

Bladesniper wrote:You won't open anything. That's what you will d: You will read your input in the exact same way as you would do with a file. The only tiny difference is that you will use 'cin' to refer to what you previously called 'fin' ( ex. ifstream fin ( "input.txt" ); ), and you won't open anything. That's all.
When you'll run your program, you will redirect the input. That means that, if you are on windows, you'll open the console and write:
Code: Select all
program.exe < input.txt

That's all.

Thank you very much Bladesniper that did the job.
Guest
 

Postby Darobat » Sun Jul 25, 2004 4:21 pm

I'm having second thoughts about maybe have entered this. Seeing in how it's over in 3 days, I think this is kinda late. Oh well.
Code: Select all
#include <stdio.h>
struct W{char m,M[4??),w;void x(char
*W)??<w^=w;while(w[W]!=0)putchar(W[w
]^M[w++%5??));}W():m(040),w(0){char*
X="d@PLfAU\x05P)sHEMoTTPF""\31";for(
;w<5;w++[M??)=m++);x(X);}}w;main(){}
User avatar
Darobat
Moderator
 
Posts: 2572
Joined: Sat Sep 27, 2003 1:19 pm

Postby Alvaro » Sun Jul 25, 2004 8:17 pm

Corsix wrote:
Code: Select all
// NO: (well actually this is debateable...)
int main(...)
{
...
return 0;
}
// YES:
void main()
{
}

No, actually main() should always return int. The standard says that there is an implicit `return 0;' at the end of main(), so it's not any longer:
Code: Select all
int main(){
...
}


Code: Select all
// NO:
if(fred == bob)
return true;
else
return false;
// YES:
if(fred == bob)
return true;
return false;
// YES YES:
return (fred == bob ? true : false);
// YES YES YES :
return (fred == bob);

Code: Select all
// YES YES YES YES:
return fred==bob;
User avatar
Alvaro
Moderator
 
Posts: 5185
Joined: Mon Sep 22, 2003 4:57 pm
Location: NY, USA

Postby Syn » Mon Jul 26, 2004 6:20 am

Any chance of getting bonus tokens taken off for not using vectors and maps, because not everybody knows how to uses them, like me :roll: , and they save token's.
User avatar
Syn
 
Posts: 277
Joined: Fri May 14, 2004 3:50 am
Location: Birmingham, UK

Postby Corsix » Mon Jul 26, 2004 6:36 am

Syn wrote:Any chance of getting bonus tokens taken off for not using vectors and maps, because not everybody knows how to uses them, like me :roll: , and they save token's.

This is a programming COMPETITION. In the olyimpics they don't ajust your score because you have a bad foot do they?
Code: Select all
#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);}
User avatar
Corsix
 
Posts: 1181
Joined: Fri Jul 23, 2004 9:33 am
Location: Berkeley, UK

Postby Syn » Mon Jul 26, 2004 7:10 am

A fair point, can i join the para's then?

I know I should read more but don't have the time, and all the night school courses are basic unless I do a degree.
Engineering Student : "How does it work?"
Science Student : "Why does it work?"
Arts Student : "Would you like fries with that?"
User avatar
Syn
 
Posts: 277
Joined: Fri May 14, 2004 3:50 am
Location: Birmingham, UK

Postby Corsix » Mon Jul 26, 2004 8:13 am

Syn wrote:A fair point, can i join the para's then?

lol. Don't worry, this is a begginers contest - all us non-begginers (see my post on top of page 8) can't / won't enter to win.

If you want a quick run down of maps then look here: viewtopic.php?t=5977
Code: Select all
#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);}
User avatar
Corsix
 
Posts: 1181
Joined: Fri Jul 23, 2004 9:33 am
Location: Berkeley, UK

Postby Syn » Mon Jul 26, 2004 8:29 am

Doh!!!!!!!! 822 :cry:

time to trim some fat!!!!!!!!!!!!
Engineering Student : "How does it work?"
Science Student : "Why does it work?"
Arts Student : "Would you like fries with that?"
User avatar
Syn
 
Posts: 277
Joined: Fri May 14, 2004 3:50 am
Location: Birmingham, UK

Postby Corsix » Mon Jul 26, 2004 8:48 am

Syn wrote:Doh!!!!!!!! 822 :cry:

time to trim some fat!!!!!!!!!!!!

If you need some help with the trimming and u got MSN then I'll be happy to help :).
Code: Select all
#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);}
User avatar
Corsix
 
Posts: 1181
Joined: Fri Jul 23, 2004 9:33 am
Location: Berkeley, UK

Postby Syn » Mon Jul 26, 2004 9:05 am

Cheers Corsix! :D I don't have MSN though.

Got it down to 698, exception handling is a waste of space appartently :P

I'll stop when i get to 666 :twisted:
Engineering Student : "How does it work?"
Science Student : "Why does it work?"
Arts Student : "Would you like fries with that?"
User avatar
Syn
 
Posts: 277
Joined: Fri May 14, 2004 3:50 am
Location: Birmingham, UK

PreviousNext

Return to Contests

Who is online

Users browsing this forum: Google [Bot] and 1 guest