瘟中兵场练 a 题解

· · 题解

这是 HydrocarbonInWZOJ 的首届愚人赛 瘟中兵场练 a 的题解。

如果你是从主页直接点进来,或是还没开始打这场比赛的话,建议你 打完再看 。

出题人 HydrocarbonInWZOJ 是超级大彩笔,所以如果 题烂/数据出锅 等情况发生,最好不要骂我(也可以骂)。

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

A.向机器的异化

签到题。注意一下题目要求字典序,以及若干个像素的 SCP 肩膀即可。

符合要求的图块为 2,3,6,7,9,10,11,12,13,14,15,16 。

print('10 11 12 13 14 15 16 2 3 6 7 9')

B. 诗经

注意到,题面的黑龙江被 P 了一块 micro:bit 。

看到 micro:bit 令人想起一名黄姓人士。结合题面的黑龙江,想起 tongzhenxuan 有诗云:

长江黄河还有黄仁和,男人女人还有郑乔日。

print('nrnrhyzqr')

PS: 本题的标题 “诗经” 是验题人 SuperAlex4 起的。理由是黑龙江和 micro:bit 都使用了比兴的手法。

C. 一口叉

观察 “ 一 口 X(叉) ”,再观察你的浏览器右上角,注意到有几分相似。

“一”是最小化,“口”是最大化,“X(叉)”是关闭。将鼠标移到浏览器“叉”的上方,按钮显示出红色。

print('red')

D. 呜呜

将 xs_siqi 题为 呜呜 的题解抄下来即可。

#include<bits/stdc++.h>
using namespace std;
const int maxn=1e5+5;
const int mod=1e9+7;
int ans,n,tot,cnt,sum[maxn][55],a[maxn],ct[maxn][55],tong[maxn];
char s[maxn];
struct node{
    int p[55],k;
    bool friend operator < (node x,node y){
        for(int i=1;i<=x.k;i++){
            if(x.p[i]<y.p[i])return 1;
            if(x.p[i]>y.p[i])return 0;
        }
        return 0;
    }
};
map<char,int> G;
map<node,int> M;
int main(){
    scanf("%d",&n);
    scanf("%s",s+1);
    for(int i=1;i<=n;i++)
        if(!G[s[i]])a[i]=G[s[i]]=++tot;
        else a[i]=G[s[i]];
    for(int i=1;i<=n;i++)
        for(int j=1;j<=tot;j++)sum[i][j]=sum[i-1][j]+(a[i]==j);
    for(int i=1;i<=n;i++)
        for(int j=1;j<=tot;j++)
            ct[i][j]=sum[i][j]-sum[i][1];
    node p;
    p.k=0;
    for(int j=1;j<=tot;j++)p.p[++p.k]=0;
    M[p]=++cnt,tong[M[p]]++;
    for(int i=1;i<=n;i++){
        p.k=0;
        for(int j=1;j<=tot;j++)p.p[++p.k]=ct[i][j];
        if(!M[p])M[p]=++cnt;
        ans+=(tong[M[p]]++),ans%=mod;
    }
    printf("%d\n",ans);
    return 0;
}

E. ???? Problem

观察题。

不难注意到中间有一段字加了粗。但是为什么会加粗呢?

我们知道,在 Markdown 中双星号( ** )表示加粗。通过复制 Markdown 可以看到:

有一天, Hydrocarbon 遇到了一个问题:你能求出 \$a\$**\$b\$ 对 \$998244353\$ 取模的值吗? Hydrocarbon 不会求解这个问题,于是 Hydrocarbon 把它交给了聪明的你。输入两个整数 \$a, b\$ ,请你输出 \$a\$**\$b\$ 模 \$998244353\$ 的值。

在 python 中,表达式 a ** b 表示 a^b 。交一发快速幂模板即可通过。

另,如果你是一个熟练的 python 使用者,你应当知道 python 自带快速幂的函数。

a, b = map(int, input().split())
print(pow(a, b, 998244353))

F. brief introduction

在 5 号机房的后门门口前有一块 “温州中学竞赛教练简介 brief introduction”。

又因为题目说输入英文,因此将三个教练简介里的英文单词提取出来,然后输出对应教练的首字母即可。

s = input()
if s in ("WCET", "Free", "Pascal", "NOI"):
    print('S')
elif s in ("ACM", "ICPC", "World", "Finals"):
    print('Z')
elif s == "IEEE":
    print('L')

G. The Author of the Function

注意:本题对一些人来说是不可做题。

温州中学高二段段长吴必宪有言(我可能记得不太清):

(旷课)满十五天的,五十一中学籍,回五十一中去读。二外学籍的,回二外去读。本部学籍的,直接开除,我们学校不要你了,你自己能去哪就去哪。

故答案为 wbx 。

print('wbx')

后话

敬请期待 瘟中兵场练 a^2 。