The contest is over. 13 people solved all problems — you guys are amazing!
The editorial will be available here.
Today's language is FALSE, stack-based esoteric programming language invented over 20 years ago.
The traditional A+B problem (integers A and B are separated with a space) can be solved like this.
To test your solutions, you can:
- download source code in C of the original interpreter here. Testing system uses this interpreter with -q option.
- use "Custom Invocation".
- use online interpreters (they differ from the reference interpreter a bit but make debugging much easier): 1, 2.
Useful links:
- language description by its author Wouter van Oortmerssen
- Progopedia article
- examples at Rosetta Code
Notes:
- Language description contains instructions ø and ß. The reference interpreter uses O and B instead (both online interpreters support ø and ß).
- End of file is encoded as #-1, end of line — as #13#10.
- The stack MUST be empty when program completes, otherwise the interpreter will post an error to stdout, and output will be judged as incorrect.
Surprise Language Round #7 will take place on September 13th, the Programmers' Day.
The rules of the contest are as follows:
- The contest is unrated for everybody.
- The round uses ACM ICPC rules: the standing is defined by the number of solved problems, ties are resolved based on penalty time. Initially the penalty is 0, and for each solved problem it is increased by submission time (since the start of the contest) + 20 minutes for each failed submission. The solution is considered to be correct if it passes all tests from a predefined test set; you know whether the solution is right immediately after sending it. There are no hacks.
- The round has 8 problems, sorted by estimated complexity, and you have 2 hours to solve it.
- Solutions are accepted only in one language, which will be announced at the beginning of the contest. The language was created a while ago, we didn't invent it for this occasion.
- Please reread this post at the beginning of the contest: we will announce the language and add instructions to install the compiler (the contest interface will provide an option to run your solutions online as well) and links to useful manuals. Other than that, learning the language is up to the competitor. You can use any resources to solve the problems (as long as you remember that this is an individual competition); you don't have to limit yourself to the manuals provided in the post.
I hope that the language I chose will be unknown to most of the competitors. For reference, here is the list of previous Surprise/Unknown Language Rounds.
Good luck! And happy Programmers' Day!
Is the language and instructions provided at the very start of the round or a little before? (like 5 or 10 min?)
This sounds fun :)
A couple of minutes before the start. People need time to overcome the surprise :-)
Waiting until the last second to release the language?
You might want to add the time of the contest (usual time, 15.30 UTC, according to the Contests page). Unless you want to make this Surprise Round to have a Surprise Start Time too.
I dont think they want to test whether you log in frequently or not! This will needlessly reduce participation.
Yes, the second sentence was a joke.
can install compiler in both linux and windows? or just one of them?
Should be both, we're checking this now. You'll also be able to run your code online ("Custom Invocation" tab of the contest interface).
but it's not User friendly (for me) !
We are fully aware of people who refuse to use online compilers (although their reasons are a mystery to me). We do our best to make sure that compiler for the chosen language is available on all platforms. However, we cannot give a 100% guarantee of this, so we also provide alternative methods of running your code. Using "Custom Invocation" has an added benefit of running your code in the same conditions as your submission runs, which might be good for figuring out why your submission works locally but gets WA at the server.
P.S. If you have a look at the languages used in previous rounds, you might notice that "user-friendly" is never part of the design :-)
So, where's the guy hoping for more maths ? :D
Hope for the language to be TI Basic.
Hope for the language to be C++.
Well, that would be too surprising! :D
The blog writer said this:
I hope that the language I chose will be unknown to most of the competitors.
So I don't think he will be choosing C++! :)
:(
AkshajK reports to duty .. hope for math..ematica!
Last contest, the surprise language is ADA, then I spent 2 hour in reading the introduction and the grammar of this language.... After I can write the "a+b" and "hello world!" in online compiler... the contest is over... A sad story...XD
I wish the language in this contest is whitespace...then we can see a lot of "empty" code...
:D
The language of the problem statements will be unknown as well?
Maybe you are thinking too deep.
They will be on Whitespace
How can we know the syntax rules of your language ? Will you explain ; or are the languages currently known worldwide ?
The language is "known" worldwide as in there should be a free documentation on the internet, which you can look up.
sounds like it could be Swift
Kinda hope it'll be Assembly :D
MikeMirzayanov has registered for this contest :) It's going to be an exciting contest.
Sorry, I've just tested the registration.
FALSE((
As if ADA was not bad enough :(
I think FALSE is not a programming language at all!!
Not true. We have evidence of at least 80 contest participants now that it is possible to write a program in it :-)
What is this thing ... OMG !!!
I'm ready to work with Assembly instead of this FALSE programming language!
You know a programming language is bad when you can sort an array by hand faster than you can code it even for input size n = 105
Input is underspecified; some problems end the input with a newline (and apparently #10 only, not #13#10), and others don't have a newline at the end of the input. This makes comparing whether we've found the EOF different (either 10 or -1).
Aha, there were endl instead of EOF!
Luckily the
while
condition is just slightly changed, you simply need to check for more than one symbol in it, and that's all. I didn't encounter any problems with the input ending with newline instead of EOF, I just started using this "improved" condition.Oh, right, I should have checked for characters less than 33 (EOF (-1), line feed (10), carriage return (13), space (32)) instead; I coded
[^$10=~]
as the condition and should have[^$32>~]
instead.Or even shorter,
[^$33<]
:)<
doesn’t exist.Yep, my bad. Double-checked my code, turns out I used
>~
too, and now I remember why :)Awwww, this explains my "Wrong answer on test 1" in C!
I haven't thought of that :(
Huge thank you for the contest, was fun as usual! Hopefully the next one will be sooner than a year from now.
Hopefully the next one will feature a language that is more comprehendable and easier to code in. This one was a FALSE language.
I think this language is fun to learn.
The challenge is to code in a language that is completely different from what you used to code in.
Thanks a lot for the contest.
It was fun recollecting things about stack based programming. :-)
The language was actually fun once you get a hang of it. (Took me over 1 and a half hour)
Thanks for contest.
After being fun, I think trying to understand new library's and new languages in a short while is a good practice to face real ones.
PS: I wrote A & B directly and a c++ code generator for E CODE
Both sample test outputs in problem H (array sorting) are wrong:
The first one should be: "1 2 3 3" (there are 2 instances of "3")
The second one should be: "2 2 3 5 7 12 44 60" (the "7" was accidentally omitted).
Please read problem statement.
The input consists of a single line of space-separated integers. The first number is n (1 ≤ n ≤ 10) — the size of the array. The following n numbers are the elements of the array (1 ≤ ai ≤ 100).
3 and 7 are array sizes, not array elements, and should not be sorted.
I think there is a mistake in the statement. End of file is encoded as #-1,which is correct,while end of line — not as #13#10 ,but just #10 (at least on Codeforces,tested in custom test). I write a program ^.^. and the input is a blank line(Just press enter in input box),and I get a output like 10-1 --there is no #13
The problem is, custom test differs from what testing system does — custom test uses end-of-line that matches OS under which browser runs, but the testing system always uses #13#10.
7786172
If so, it's so weired that my submission for Problem D,which thinks that end of line consists of only one character,passed the system test.
if a End-of-Line consists of 2 characters,after reading an integer, my code will get a #13 and thinks a integer end,and followed other chars,and the following loop will stop if the next char is not a letter,and the remaining #10 is not a letter,so my program will print nothing.
BTW,I'm a windows user.
msvcrt on Windows will do some automatically conversion between "\r\n" (Windows line ending) and "\n" (Unix line ending) when reading and writing. (If the stream is opened as text-mode, which is default)
That is to say, even if the input file is in Windows line ending (CRLF, or "\r\n"), the program which uses msvcrt's I/O functions could only see a single "\n".
Seems like the whole Codeforces judging system is based on Windows, and the interpreter is written in C, linked to msvcrt.
Thanks for the great contest! I always enjoy these and this one was no exception.
end-of-line issues were pretty frustrating to me; I think #10 ('\n') is a more standard end-of-line character than #13#10 (which is apparently "vertical tab" and then a "newline"??). Two characters at end of line is weird...
I guess this way was more convenient for Windows users?
I did not realize there were variables in the language until after I did A,B,D,E. Oops...