洛谷(CodeForces)历年愚人节题目,难度普及+/提高,让你怀疑自己智商

发布时间:2024年01月21日

INTERCALC

题目描述

DO YOU EXPECT ME TO FIND THIS OUT?

WHAT BASE AND/XOR LANGUAGE INCLUDES string?

DON’T BYTE OF MORE THAN YOU CAN CHEW

YOU CAN ONLY DISTORT THE LARGEST OF MATHEMATICS SO FAR

SAYING “ABRACADABRA” WITHOUT A MAGIC AND WON’T DO YOU ANY GOOD

THE LAST STACK RUPTURES. ALL DIE. OH, THE EMBARRASSMENT!

I HAVE NO ARRAY AND I MUST SCREAM

ELEMENTS MAY NOT BE STORED IN WEST HYPERSPACE

输入格式

The first line of input data contains a single integer $ n $ ( $ 1<=n<=10 $ ).

The second line of input data contains $ n $ space-separated integers $ a_{i} $ ( $ 1<=a_{i}<=11 $ ).

输出格式

Output a single integer.

样例 #1

样例输入 #1

4
2 5 3 1

样例输出 #1

4
#include<bits/stdc++.h>
using namespace std;
long long n,a[1000],x,y,s;
int main()
{
	cin>>n;
	for(int i=1;i<=n;i++)
		cin>>a[i];
	x=a[n];
	sort(a+1,a+n+1);
	y=a[n];
    s=x^y;
	cout<<s;
	return 0;
}

Kids’ Riddle

题面翻译

愚人节题目,输入一个十进制数,将其转化为十六进制之后数圈圈。

注意:

十六进制数字0、4、6、9、A、D各有一个圈。

十六进制数字8、B各有两个圈。

其他十六进制数字没有圈。

感谢@PC_DOS 提供的翻译

题目描述

Programmers’ kids solve this riddle in 5-10 minutes. How fast can you do it?

输入格式

The input contains a single integer $ n $ ( $ 0<=n<=2000000000 $ ).

输出格式

Output a single integer.

样例 #1

样例输入 #1

11

样例输出 #1

2

样例 #2

样例输入 #2

14

样例输出 #2

0

样例 #3

样例输入 #3

61441

样例输出 #3

2

样例 #4

样例输入 #4

571576

样例输出 #4

10

样例 #5

样例输入 #5

2128506

样例输出 #5

3
#include<bits/stdc++.h>
using namespace std;
int n,c,x;
int main()
{
	cin>>n;
    if(!n)
    {
        cout<<"1\n";return 0;
    }
	while(n)
	{
		x=n%16;
		n/=16;
		if(x==0||x==4||x==6||x==9||x==10||x==13)c++;
		else if(x==8||x==11)c+=2;
	}
	cout<<c<<endl;
	return 0;
 } 

Numbers Joke

题面翻译

愚人节题目,自己想吧。

题目描述

输入格式

The input contains a single integer $ a $ ( $ 1<=a<=30 $ ).

输出格式

Output a single integer.

样例 #1

样例输入 #1

3

样例输出 #1

27
#include<bits/stdc++.h>
using namespace std;
int arrAns[30]={4,22,27,58,85,94,121,166,202,265,274,319,346,355,378,382,391,438,454,483,517,526,535,562,576,588,627,634,636,645},nPos;
int main()
{
	cin>>nPos;
	cout<<arrAns[nPos-1];
	return 0;
}

Ace It!

题面翻译

求各位数字之和,其中A是1,1是10,其他数就是它本身。

题目描述

输入格式

The only line of the input is a string of 7 characters. The first character is letter A, followed by 6 digits. The input is guaranteed to be valid (for certain definition of “valid”).

输出格式

Output a single integer.

样例 #1

样例输入 #1

A221033

样例输出 #1

21

样例 #2

样例输入 #2

A223635

样例输出 #2

22

样例 #3

样例输入 #3

A232726

样例输出 #3

23
#include<bits/stdc++.h>
using namespace std;
long long n;
string s; 
int main()
{
	cin>>s;
	for(int i=0;i<s.size();i++)
	{
		if(s[i]=='A') n++;
		else if(s[i]=='1') n+=10;
		else n+=s[i]-'0'; 
	}
	cout<<n;
    return 0;
}

Da Vinci Powers

题目描述

输入格式

The input contains a single integer $ a $ ( $ 0<=a<=35 $ ).

输出格式

Output a single integer.

样例 #1

样例输入 #1

3

样例输出 #1

8

样例 #2

样例输入 #2

10

样例输出 #2

1024
#include<bits/stdc++.h>
using namespace std;
int iIndex;
long long arrAns[36]={1,2,4,8,16,32,64,128,256,512,1024,2048,4096,8092,16184,32368,64736,129472,258944,517888,1035776,2071552,4143104,8286208,16572416,33144832,66289664,132579328,265158656,530317312,1060634624,2121269248,4242538496,8485076992,16970153984,33940307968};
int main()
{
	cin>>iIndex;
	cout<<arrAns[iIndex];
	return 0;
}

A Map of the Cat

题面翻译

一只猫是由几个部分组成的

这里有2种猫——normalgrumpy

一只normal的猫所特有的特征如下图1

一只grumpy的猫所特有的特征如下图2

现在请分辨输入的特征属于哪种猫

(愚人节题目)

题目描述

If you have ever interacted with a cat, you have probably noticed that they are quite particular about how to pet them. Here is an approximate map of a normal cat.

However, some cats won’t tolerate this nonsense from the humans. Here is a map of a grumpy cat.

You have met a cat. Can you figure out whether it’s normal or grumpy?

输入格式

输出格式

提示

Please make sure to use the stream flushing operation after each query in order not to leave part of your output in some buffer.

#include<bits/stdc++.h>
using namespace std;
string a;
long long i;
int main()
{
    for(i=0;i<6;i++)
    {
        cout<<i<<endl;
        cin>>a; 
        if(a[0] =='w'||a[0] =='a'||a[2]==' ')
        {cout<<"grumpy";return 0;}
    }
    cout<<"normal";
    return 0;
}
文章来源:https://blog.csdn.net/yaosichengalpha/article/details/135728860
本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。