CF 1145 (愚人节比赛)

D题

题目就是让你找出题面中拼错的单词,拼错的字母组合成一句话就是正确的题面。

two plus xor of third and min elements

#include<bits/stdc++.h>
using namespace std;
int n, a[10000], minn;
int main () {
    scanf("%d", &n);
    minn = 50;
    for (int i = 1; i <= n; i ++) {
        scanf("%d", &a[i]);
        minn = min(minn, a[i]);
    }
    printf("%d", (minn ^ a[3]) + 2);
    return 0;
}

E题

通过此工具解析图片,可得到$ (min(id, 25) + id) % (2 + id % 3)) > 0$

F题

Description

给出一个字符串,若所有的字母都是由直线或都是由曲线构成的输出 YES,否则输出 NO

Solution

暴力枚举

#include<bits/stdc++.h>
using namespace std;
char s[100];
int f[100], sum;
int main() {
    cin >> s;
    f[1] = 1, f[5] = 1, f[6] = 1, f[8] = 1, f[9] = 1, f[11] = 1, f[12] = 1, f[13] = 1, f[14] = 1, f[20] = 1, f[22] = 1, f[23] = 1, f[24] = 1, f[25] = 1, f[26] = 1;
    for (int i = 0; i < strlen(s); i ++ )   
        sum += f[s[i] - 'A' + 1];
    if (sum == 0 || sum == strlen(s))
        printf("YES\n");
    else 
        printf("NO\n");
    return 0;
}

G题

交互题

就是要你跟电脑玩石头剪刀布(一脸懵逼)

#include<bits/stdc++.h>
using namespace std;
const string T="RRRRPSSPRR";
string s,t,s1;
int main(){
    string s,t;
    for (int i=0;i<10;i++){
        printf("%c\n",T[i]);
        fflush(stdout);
        getline(cin,s1);
        s+=(s1=="ai"?'0':'1');
    }
    if(s=="0000100100")t="PPPPPPPPPP";
    if(s=="0000011000")t="SSSSSSSSSS";
    if(s=="1111000011")t="RRRRRRRRRR";
    if(s=="0010000010")t="SRPSRPSRPS";
    if(s=="0000110000")t="PSRPSRPSRP";
    if(s=="0000000110")t="SPRSPRSPRS";
    for (int i=0;i<10;i++){
        printf("%c\n",t[i]);
        fflush(stdout);
        getline(cin,s1);
    }
    return 0;
}

猜你喜欢

转载自www.cnblogs.com/wjnclln/p/10729825.html