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.
4
2 5 3 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;
}
愚人节题目,输入一个十进制数,将其转化为十六进制之后数圈圈。
注意:
十六进制数字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.
11
2
14
0
61441
2
571576
10
2128506
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;
}
愚人节题目,自己想吧。
The input contains a single integer $ a $ ( $ 1<=a<=30 $ ).
Output a single integer.
3
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;
}
求各位数字之和,其中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.
A221033
21
A223635
22
A232726
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;
}
The input contains a single integer $ a $ ( $ 0<=a<=35 $ ).
Output a single integer.
3
8
10
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;
}
一只猫是由几个部分组成的
这里有2种猫——normal
和grumpy
一只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;
}