fork download
  1. #include <stdio.h>
  2.  
  3. char *words =
  4. "@n'+,#'/*{}w+/w#cdnr/+,{}r/*de}+,/*{*+,/w{%+,/w#q#n+,/#{l+,/n{n+,/+#n+,/#\
  5. ;#q#n+,/+k#;*+,/'r :'d*'3,}{w+K w'K:'+}e#';dq#'l \
  6. q#'+d'K#!/+k#;q#'r}eKK#}w'r}eKK{nl]'/#;#q#n'){)#}w'){){nl]'/+#n';d}rw' i;# \
  7. ){nl]!/n{n#'; r{#w'r nc{nl]'/#{l,+'K {rw' iK{;[{nl]'/w#q#n'wk nw' \
  8. iwk{KK{nl]!/w{%'l##w#' i; :{nl]'/*{q#'ld;r'}{nlwb!/*de}'c \
  9. ;;{nl'-{}rw]'/+,}##'*}#nc,',#nw]'/+kd'+e}+;#'rdq#w! nr'/ ') }+}{rl#'{n' ')# \
  10. }'+}##(!!/";
  11.  
  12. char *shift = "!ek;dc i@bK'(q)-[w]*%n+r3#l,{}:\nuwloca-O;m .vpbks,fxntdCeghiry";
  13.  
  14. main() {
  15. xmas(1, 0, '\0');
  16. }
  17.  
  18. xmas(int t, int _, char *a) {
  19.  
  20. if (t < -72) {
  21. return xmas(_, t, words);
  22. }
  23.  
  24. if (t < -50) {
  25. if (_ == *a) {
  26. return putchar(a[31]);
  27. } else {
  28. return xmas(-65, _, a+1);
  29. }
  30. }
  31.  
  32. if (t < 0) {
  33. return xmas((*a == '/')+t, _, a+1);
  34. }
  35.  
  36. if (t == 0) {
  37. if (*a == '/') {
  38. return 1;
  39. } else {
  40. return xmas(0, xmas(-61, *a, shift), a+1);
  41. }
  42. }
  43.  
  44. if (t == 1) {
  45. return xmas(2, 2, "%s");
  46. }
  47.  
  48. if (t == 2)
  49. xmas(-79, -13, a + xmas(-87, 1-_, a + xmas(-86, 0, a+1)));
  50.  
  51. if (t < _)
  52. xmas(t+1, _, a);
  53.  
  54. if (xmas(-94, -27+t, a) && t == 2) {
  55. if (_ < 13)
  56. return xmas(2, _+1, "%s %d %d\n");
  57. else
  58. return 9;
  59. } else {
  60. return 16;
  61. }
  62. }
Success #stdin #stdout 0s 2168KB
stdin
Standard input is empty
stdout
On the first day of Christmas my true love gave to me
a partridge in a pear tree.

On the second day of Christmas my true love gave to me
two turtle doves
and a partridge in a pear tree.

On the third day of Christmas my true love gave to me
three french hens, two turtle doves
and a partridge in a pear tree.

On the fourth day of Christmas my true love gave to me
four calling birds, three french hens, two turtle doves
and a partridge in a pear tree.

On the fifth day of Christmas my true love gave to me
five gold rings;
four calling birds, three french hens, two turtle doves
and a partridge in a pear tree.

On the sixth day of Christmas my true love gave to me
six geese a-laying, five gold rings;
four calling birds, three french hens, two turtle doves
and a partridge in a pear tree.

On the seventh day of Christmas my true love gave to me
seven swans a-swimming,
six geese a-laying, five gold rings;
four calling birds, three french hens, two turtle doves
and a partridge in a pear tree.

On the eigth day of Christmas my true love gave to me
eight maids a-milking, seven swans a-swimming,
six geese a-laying, five gold rings;
four calling birds, three french hens, two turtle doves
and a partridge in a pear tree.

On the ninth day of Christmas my true love gave to me
nine ladies dancing, eight maids a-milking, seven swans a-swimming,
six geese a-laying, five gold rings;
four calling birds, three french hens, two turtle doves
and a partridge in a pear tree.

On the tenth day of Christmas my true love gave to me
ten lords a-leaping,
nine ladies dancing, eight maids a-milking, seven swans a-swimming,
six geese a-laying, five gold rings;
four calling birds, three french hens, two turtle doves
and a partridge in a pear tree.

On the eleventh day of Christmas my true love gave to me
eleven pipers piping, ten lords a-leaping,
nine ladies dancing, eight maids a-milking, seven swans a-swimming,
six geese a-laying, five gold rings;
four calling birds, three french hens, two turtle doves
and a partridge in a pear tree.

On the twelfth day of Christmas my true love gave to me
twelve drummers drumming, eleven pipers piping, ten lords a-leaping,
nine ladies dancing, eight maids a-milking, seven swans a-swimming,
six geese a-laying, five gold rings;
four calling birds, three french hens, two turtle doves
and a partridge in a pear tree.