codeforces April fool contest 2020

r_64 posted @ 2020年4月02日 10:25 in 未分类 , 747 阅读

达成成就:AK一场CF(

这次玩的梗我基本都会?Jordan Curve Theorem、元素周期表,不过那首limerick我没看出acoustic。。。

Is it rated?

输出no就行了。

本题用来测试选手何时能够正常登录cf(确信)

Limericks

诗的十行首字母分别是TWO FACTORS。。。不过我比赛的时候并没有看出来。。

不过看到样例之后应该可以联想到分解因数吧。。。

...And after happily lived ever they

...and they lived happily ever after. Separately.

看到输入是个6-bit integer,标题是6个单词的句子的重排,大概能猜到每个单词对应一个bit。。。

样例输入和输出的数二进制表示中1的个数都相等。。。大概能猜到就是把输入的数转成二进制重排后输出。。。

重排的方法就是看标题是怎么重排的,也就是053241。

Elementary!

我可能是看puzzling.SE看多了。。。所以看到elementary就知道是指元素周期表。。。

问题:给出一个单词,能否把它拆成元素的缩写?例如WATSON = W + At + S + O + N就可以,HOLMES就不行,因为L、OL和LM都不是元素周期表里的元素。。。

写了个dp。。。反正数据范围小,随便过。。。

Jordan Smiley

其实不用看标题就知道问题是:输入一个pixel的坐标,问这个pixel在不在曲线内部。。。

smiley是因为曲线画的是一个笑脸。。。Jordan因为Jordan Curve Theorem。。。

由于linux上没有MSPaint.exe,我对其他画图工具都不熟,所以没法做flood fill。。。但是用射线法还是可以判断一个pixel是否在曲线内部。

首先把图像下下来用python读出每个pixel($960\times 960$的)。。。然后对于输入的坐标$(x,y)$,把它映到图上对应的点$(15x+7,15y+7)$,然后做射线法。具体地说,就是水平向右边打一条射线,看它与多少个pixel相交,如果与奇数个pixel相交则点在内部,偶数个则点在外部。(线宽为$3$是奇数,所以和奇数个pixel相交等价于和曲线交了奇数次。)

输出一个$64\times 64$的矩阵,hardcode进源代码里就是了。

char ans[333][333] ={
"1111111111111111111111111101010000001011111111111111111111111111\n",
"1111111111111111111111010001010101101000001111111111111111111111\n",
"1111111111111111111100010111011100101111011011111111111111111111\n",
"1111111111111111100001010100000111100001010001011111111111111111\n",
"1111111111111111001111110101111100001111010101001111111111111111\n",
"1111111111111101100100000100010001011010011101101011111111111111\n",
"1111111111111000110110111111010111000011001001001001111111111111\n",
"1111111111100000010010010001000100011110011011011100011111111111\n",
"1111111111000000000000111101111101110100110010010110001111111111\n",
"1111111110000000000000000000010000000110000110000000000111111111\n",
"1111111100000000000000000000000000000000000000000000000011111111\n",
"1111111000000000000000000000000000000000000000000000000001111111\n",
"1111111000000000000000000000000000000000000000000000000001111111\n",
"1111110000000000000000000000000000000000000000000000000000111111\n",
"1111100000000000000000000000000000000000000000000000000000011111\n",
"1111100000000000000000000000000000000000000000000000000000011111\n",
"1111000000000000000000000000000000000000000000000000000000001111\n",
"1110000000000000000000000000000000000000000000000000000000000111\n",
"1111100000000000000000000000000000000000000000000000000000000111\n",
"1111111000000000000111011000000000000001110101000000000000011111\n",
"1100111110000000001101110000000000000001011111110000000011111111\n",
"1100001111100000111001011100000000000000010010011010011111110011\n",
"1000000011111011100011000110000000000010110111001111111110000001\n",
"1000000000111110110110010011100000000010010000011011110000000001\n",
"1000000000000100100011111000110000000111011011110001000000000001\n",
"1000000000111110111000100011100000000101000001011101101000000001\n",
"0000000000001000101101101110110000001101101111001000111000000000\n",
"0000000000011101101001000100010000101000100001100011101000000000\n",
"0000000000010000001000011110110101111010110100001110001000000000\n",
"0000000000011111011011000100011101010010010110111011011000000000\n",
"0000000000001001000010010001110100011111000010100000010000000000\n",
"0000000000011100011011011100010110001000011010001110111000000000\n",
"0000000000000111110010001001000100111110110010011011101000000000\n",
"0000000000000010010111101011110101101010010111001001000000000000\n",
"0000000000001111000010101010100001001011010001100011100000000000\n",
"0000000000000101101110001110000111011001111011001110000000000000\n",
"0000000000000000111000111010010010010011010001011011000000000000\n",
"0000000000000000001110100000011111000000011101110000000000000000\n",
"1000000000000000011011110000010100000000000111011000000000000001\n",
"1000000000000000000000000000000111100000000000000000000000000001\n",
"1000000000000000000000000000101101000000000000000000000000000001\n",
"1000000000000000000000000010111000000000000000000000000000000001\n",
"1100000000000000000000000011101110000000000000000000000000000011\n",
"1100000001100000000000000000001000000000000000000000000000000011\n",
"1110000000101000000000000000011100000000000000000000010000000111\n",
"1110000000111011100000000000110100000000000100000101111000000111\n",
"1110000000101010110101110010100110101101001110011111010000000111\n",
"1111000000001110011111011111110011100111111010110001000000001111\n",
"1111100000001011000010000100011000111100010000010100000000011111\n",
"1111100000000001011011011101000010001001011111011100000000011111\n",
"1111110000000011110010010111101110101111000101110000000000111111\n",
"1111111000000000100111000001001010111010011100000000000001111111\n",
"1111111000000000110001101011100011101000110111000000000001111111\n",
"1111111100000000011100001110001001000010000100000000000011111111\n",
"1111111110000000001001111010111111011110100000000000000111111111\n",
"1111111111000000000000101000010010010100110000000000001111111111\n",
"1111111111100000000000001111000011110111100000000000011111111111\n",
"1111111111111000000000000000000001000000000000000001111111111111\n",
"1111111111111100000000000000000000000000000000000011111111111111\n",
"1111111111111111000000000000000000000000000000001111111111111111\n",
"1111111111111111100000000000000000000000000000011111111111111111\n",
"1111111111111111111100000000000000000000000011111111111111111111\n",
"1111111111111111111111000000000000000000001111111111111111111111\n",
"1111111111111111111111111100000000000011111111111111111111111111\n",
};

Again?

祖传奇偶题(前年也有

当我做完ABCEF题的时候比赛已经过去了一个小时。。。我一看,有6000人过了D,接近过了A的人数???猜测本题是傻逼题。。。随手写了个判断最后一位奇偶上去,过了。。。

It's showtime

真正的showtime

又是一道语言题。。。编译器CE的时候会输出what the FUCK DID I DO WRONG。。。谷歌“what the FUCK DID I DO WRONG esolang”可知语言是ArnoldC

接下来就是现学了。。。这语言最难的是输入,需要特意google一遍该怎么输入。。。其他的加减乘除if while在github wiki上都有。。。TIO上也有解释器。。。另外,说的是这语言只支持16位整数,但是读入10w级别的数好像没问题?

这题golf起来可能很有意思(挖坑

Lingua Romana

继续搜Lingua Romana esolang,发现这是个用拉丁文写Perl的方言。。。(我还以为是什么独立的语言。。。nvm

找到了一个该方言的介绍。。。发现和cf给的程序大概能对上。。于是一句一句地翻译就行了。。。

per nextum in unam tum XI conscribementis fac sic
    vestibulo perlegementum da varo.
    morde varo.
    seqis cumula varum.
cis

翻译:

execute it 11 times {
    read a variable from stdin
    chomp it (?)
    push it to a stack
}

然后

per nextum in unam tum XI conscribementis fac sic
    seqis decumulamenta da varo.
    varum privamentum fodementum da aresulto.
    varum tum III elevamentum tum V multiplicamentum da bresulto.
    aresultum tum bresultum addementum da resulto.

翻译:

execute it 11 times: {
    pop from stack a variable
    aresult = sqrt(abs(var))
    bresult = (var ** 3) * 5
    result = aresult + bresult

然后

    si CD tum resultum non praestantiam fac sic
        dictum sic f(%d) = %.2f cis tum varum tum resultum egresso describe.
        novumversum egresso scribe.
    cis

翻译:

    if 400 > result {
        stdout.printf("f(%d) = %.2f", var, res)
        stdout.println()
    }

最后

    si CD tum resultum praestantiam fac sic
        dictum sic f(%d) = MAGNA NIMIS! cis tum varum egresso describe.
        novumversum egresso scribe.        
    cis
cis

翻译:

    if 400 <= result {
        stdout.printf("f(%d) = MAGNA NIMIS!", var)
        stdout.println()
    }
}

于是把这玩意照抄一遍就能AC本题了。。。

坑:codegolf

 


登录 *


loading captcha image...
(输入验证码)
or Ctrl+Enter