the hardest part of this problem is testing. since mauke says both of my solutions are buggy im guessing something i used is part of GCC extensions but not C99, which means ive found 0 instead of 1 solution. if i had a "standard" compiler to throw ideas at id probably take another look at this one, but until then im not quite up to the task of re-reading the standards.
Huhu, I found the "obvious" other solution first; the /**/ thing was an afterthought. I'm pretty sure that whitespaceless C is turing-complete, even without preprocessor tricks like comments.
"Whitespace" is a sequence of 1 or more white characters. White characters recognized by the judge include: ' ' (space), '\t', (tab), '\n' (newline), '\r' (carriage return), '\f' (form feed) and '\v' (vertical tab). No other ASCII char is white, but there may be other white characters such as char 160 (non-breaking space); I haven't tested those.
A general comment: '\0' (NUL) isn't whitespace. It can't be used to separate tokens either. (I don't care if this works in gcc.)
Pardon the revival of this thread, but do we use
"char * const"
or
"const char *"
? The description is rather ambiguous about this, and I think I am being rejected because I may have the wrong one (it makes a huge difference to the token-parsing and stuff, and the amount of hackish things you need to make it work)
typedef/**/struct{unsigned/**/aku;char/**/*const/**/soku}zan;
typedef/**/struct{unsigned(aku);char*const(soku)}zan;
Can someone point out whats wrong with these declarations....I am going mad with this problem.... spoj.pl/status/HAJIME,saurabh8c/3
@saurabhcc:
Your second declaration used the same trick as the first one, namely /**/.
You are almost there.
@mauke I’ve found this solution, but it is not accepted
__INT32_C(typedef)__INT32_C(struct{__INT32_C(__UINT32_TYPE__)__INT32_C(aku;char*const)__INT32_C(soku;}zan;))
typedef/**/struct{__UINT32_TYPE__/**/aku;char*const/**/soku;}zan;
but it is correct
Suggested Topics
Topic | Category | Replies | Views | Activity |
---|---|---|---|---|
What am i Missing | ProblemSet Archive | 1 | 182 | Feb 22 |
What are allowed characters in task t9 | ProblemSet Archive | 4 | 243 | Feb 24 |
Getting WA on the problem PIE continuously, what am I missing? spoj.com | ProblemSet Archive | 2 | 203 | Mar 8 |
COT - Count on a tree - TLE | ProblemSet Archive | 1 | 153 | Mar 18 |
Beangame | ProblemSet Archive | 2 | 148 | Apr 9 |