A. Numbers Joke
time limit per test

2 seconds

memory limit per test

64 megabytes

input

standard input

output

standard output

Input

The input contains a single integer a (1 ≤ a ≤ 30).

Output

Output a single integer.

Example
Input
3
Output
27

史密夫数列

史密夫数(或作史密斯数)是指在某个进位下,它每一位数的数字的和相等於它因数分解(不用指数记数)中每一个因数的位数的和。

在十进位下,202就是一个史密夫数,因 2 + 0 + 2 = 4,202的因数分解为2 × 101,2 + 1 + 0 + 1 = 4。
所有质数也不会当作是史密夫数,因质数的因数只有它自己和1,必定不符合以上的要求。
史密夫数是由美国利哈伊大学的阿尔伯特·维兰斯基(Albert Wilansky)发现,而第一个被发现的史密夫数是4937775,因为Wilansky该位表兄弟的电话号码是4937775。
在十进位下的史密夫数如下(OEIS中的数列A006753):
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,
648, 654, 663, 666, 690, 706, 728, 729, 762, 778, 825, 852, 861, 895,
913, 915, 922, 958, 985, 1086
#include<iostream>
using namespace std;
int a[]={,,,,,,,,,,,
,,,,,,,,,,
,,,,,,,,,,,};
int main()
{
int n;
while(cin>>n)
{
cout<<a[n]<<endl;
}
return ;
}
B. Kids' Riddle
time limit per test

2 seconds

memory limit per test

64 megabytes

input

standard input

output

standard output

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

Input

The input contains a single integer n (0 ≤ n ≤ 2000000000).

Output

Output a single integer.

Examples
Input
11
Output
2
Input
14
Output
0
Input
61441
Output
2
Input
571576
Output
10
Input
2128506
Output
3

转换为16进制后数圈圈
#include <iostream>
#include <algorithm>
#include <cstring>
#include <cstdio>
#include <vector>
#include <queue>
#include <cstdlib>
#include <iomanip>
#include <cmath>
#include <ctime>
#include <map>
#include <set>
using namespace std;
#define lowbit(x) (x&(-x))
#define max(x,y) (x>y?x:y)
#define min(x,y) (x<y?x:y)
#define MAX 100000000000000000
#define MOD 1000000007
#define pi acos(-1.0)
#define ei exp(1)
#define PI 3.141592653589793238462
#define ios() ios::sync_with_stdio(false)
#define INF 0x3f3f3f3f3f
#define mem(a) (memset(a,0,sizeof(a)))
typedef long long ll;
int n,ans=;
int main()
{
scanf("%d",&n);
while(n>=)
{
if(n%==) ans+=;
if(n%==) ans+=;
if(n%==) ans+=;
if(n%==) ans+=;
if(n%==) ans+=;
if(n%==) ans+=;
if(n%==) ans+=;
if(n%==) ans+=;
n/=;
}
if(n==) ans+=;
if(n==) ans+=;
if(n==) ans+=;
if(n==) ans+=;
if(n==) ans+=;
if(n==) ans+=;
if(n==) ans+=;
if(n==) ans+=;
printf("%d\n",ans);
return ;
}
C. INTERCALC
time limit per test

2 seconds

memory limit per test

64 megabytes

input

standard input

output

standard output

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

Input

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 ai (1 ≤ ai ≤ 11).

Output

Output a single integer.

Example
Input
4
2 5 3 1
Output
4
#include <iostream>
#include <algorithm>
#include <cstring>
#include <cstdio>
#include <vector>
#include <queue>
#include <cstdlib>
#include <iomanip>
#include <cmath>
#include <ctime>
#include <map>
#include <set>
using namespace std;
#define lowbit(x) (x&(-x))
#define max(x,y) (x>y?x:y)
#define min(x,y) (x<y?x:y)
#define MAX 100000000000000000
#define MOD 1000000007
#define pi acos(-1.0)
#define ei exp(1)
#define PI 3.141592653589793238462
#define ios() ios::sync_with_stdio(false)
#define INF 0x3f3f3f3f3f
#define mem(a) (memset(a,0,sizeof(a)))
typedef long long ll;
int n,ans=;
int main()
{
int n,x,ans;
cin>>n;
cin>>x;
ans=x;
for(int i=;i<n;i++)
{
cin>>x;
ans=max(ans,x);
}
printf("%d\n",ans^x);
return ;
}
D. Touchy-Feely Palindromes
time limit per test

2 seconds

memory limit per test

64 megabytes

input

standard input

output

standard output

Input

The only line of the input contains a string of digits. The length of the string is between 1 and 10, inclusive.

Output

Output "Yes" or "No".

Examples
Input
373
Output
Yes
Input
121
Output
No
Input
436
Output
Yes

数字回文串

#include <iostream>
#include <algorithm>
#include <cstring>
#include <cstdio>
#include <vector>
#include <queue>
#include <cstdlib>
#include <iomanip>
#include <cmath>
#include <ctime>
#include <map>
#include <set>
using namespace std;
#define lowbit(x) (x&(-x))
#define max(x,y) (x>y?x:y)
#define min(x,y) (x<y?x:y)
#define MAX 100000000000000000
#define MOD 1000000007
#define pi acos(-1.0)
#define ei exp(1)
#define PI 3.141592653589793238462
#define ios() ios::sync_with_stdio(false)
#define INF 0x3f3f3f3f3f
#define mem(a) (memset(a,0,sizeof(a)))
typedef long long ll;
// 0 1 2 3 4 5 6 7 8 9
int mirror[] = {,-,-, , , , , , , };
int main()
{
char a[];
scanf("%s",&a);
int len=strlen(a);
int i=;
while(a[i]!='\0' && mirror[a[i]-'']==a[len-i-]-'') i++;
puts(i==len?"Yes":"No");
}
E. Twisted Circuit
time limit per test

2 seconds

memory limit per test

64 megabytes

input

standard input

output

standard output

Input

The input consists of four lines, each line containing a single digit 0 or 1.

Output

Output a single digit, 0 or 1.

Example
Input
0
1
1
0
Output
0

数字电路,或与非

#include <iostream>
#include <algorithm>
#include <cstring>
#include <cstdio>
#include <vector>
#include <queue>
#include <cstdlib>
#include <iomanip>
#include <cmath>
#include <ctime>
#include <map>
#include <set>
using namespace std;
#define lowbit(x) (x&(-x))
#define max(x,y) (x>y?x:y)
#define min(x,y) (x<y?x:y)
#define MAX 100000000000000000
#define MOD 1000000007
#define pi acos(-1.0)
#define ei exp(1)
#define PI 3.141592653589793238462
#define ios() ios::sync_with_stdio(false)
#define INF 0x3f3f3f3f3f
#define mem(a) (memset(a,0,sizeof(a)))
typedef long long ll;
int a,b,c,d;
int main()
{
scanf("%d%d%d%d",&a,&b,&c,&d);
printf("%d\n",((a^b)&(c|d))^((b&c)|(a^d)));
return ;
}

Codefroces 784 愚人节题目(部分)的更多相关文章

  1. luogu[愚人节题目3]现代妖怪殖民地 NTT

    U34272 [愚人节题目3]现代妖怪殖民地 fft 题目链接 https://www.luogu.org/problemnew/show/U34272 思路 虽然是个py题. ntt(或者fft)模 ...

  2. 【luogu T24743 [愚人节题目5]永世隔绝的理想乡】 题解

    题意翻译 我们来说说王的故事吧. 星之内海,瞭望之台.从乐园的角落告知汝等.汝等的故事充满了祝福.只有无罪之人可以进入——『永世隔绝的理想乡(Garden of Avalon)』! 题目背景 zcy入 ...

  3. nyoj 1870 愚人节礼物

    愚人节的礼物 Time Limit: 5000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others)Total Subm ...

  4. 愚人节CDACMFinal

    这个啊,愚人节的ACM之赛,其实还是很有意思的.之前因为星期天不能休息还怨声载道,但真的打起来了就是觉得特别有意思. 我们队,最开始乱搞电脑,cmd都没有办法调用了,霎时间十分慌张(而且我过于慌张忘了 ...

  5. hau 1870 愚人节的礼物(栈)

    愚人节的礼物 Time Limit: 5000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others)Total Subm ...

  6. luogu愚人节比赛划水记

    先放链接:愚人节比赛 说好的 不毒瘤 呢?题目都太神奇了吧! 管理员的脑洞orz T1 这个可以说是蒙数据蒙出来的,直接输出"0",AC T2 本机房dalao成功发现" ...

  7. 【FZYZOJ】愚人节礼物 题解(状压DP)

    前言:麻麻我会写状压DP了! ---------------------------- 题目描述 愚人节到了!可爱的UOI小朋友要给孩子们送礼物(汗-原题不是可爱的打败图么= =..).在平面直角坐标 ...

  8. 愚人节大狂欢 – ADN DevBlog谎话连篇友谊赛

    愚人节过去了,你被捉弄了没有? :) 借这个机会,ADN的哥们儿也发泄狂欢了一把,我们4月1号当天在ADN DevBlog上发了一堆谎话连篇的blog,没有一个说实话的,哈哈.这是我们team内部进行 ...

  9. 巧用CSS文件愚人节恶搞(转)

    明天就是4月1日愚人节了,也就是那个可适度开玩笑.整蛊的日子了.如果你想和那些要上网的朋友或同事开个极客式玩笑,那就来试试这个国外网友Wes Bos分享的 CSS 文件吧. 一.打开浏览器的 Cust ...

随机推荐

  1. C++函数指针相关 & 类成员的指针 & 成员函数的指针

    有时候会有指向类成员变量或者成员函数的指针,但是注意,这个指针并不是针对一个地址的指向,而更多的是一个偏移. 同时,支持将父类对象的成员 转为 子类对象的成员指针,如下: 反过来,是不行的.因为父类的 ...

  2. vdceye 最新中文界面

    最新的vdceye 的界面.左边菜单增加了问题.并增加了虚拟摄像机部分 watermark/2/text/aHR0cDovL2Jsb2cuY3Nkbi5uZXQvdmlkZW9fZGM=/font/5 ...

  3. storm 消息确认机制及可靠性

    worker进程死掉 在一个节点 kill work进程 比方 kill 2509  对work没有影响 由于会在其它节点又一次启动进程运行topology任务 supervisor进程死掉 supe ...

  4. MountService整理

    刚毕业时第一个接触的模块就是Vold.这个模块尽管小,但深入下去是有一定难度的. 花了点时间又一次整理了下这一块的逻辑,也当温习下这个模块. watermark/2/text/aHR0cDovL2Js ...

  5. Nios II 系统时钟timestamp的应用

    在用Nios II做外设时序驱动的时候,经常会用延时函数.有时会常使用某个FPGA芯片和时钟,比如笔者一直使用的芯片是cyclone系列 EP2C35F484C8N,PLL输入SOPC时钟是50M.因 ...

  6. OpenGL编程逐步深入(三)在窗口中显示一个三角形

    这一节教程的内容会比较少,我们仅仅是对上一节教程中的代码进行扩展,在窗口中渲染一个三角形出来. 本节我们以下图所示正方形来讲解OpenGl中的坐标系统.当沿着Z轴负方向看时,可见顶点的坐标必须在这个正 ...

  7. java引用被设置为null的疑惑

    a=null; public class C { protected A webDigester = new A(" first one "); public void test( ...

  8. css3 实现动画效果

    <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8&quo ...

  9. OPENCV(6) —— 角点检测

    图像特征的类型通常指边界.角点(兴趣点).斑点(兴趣区域).角点就是图像的一个局部特征,应用广泛.harris角点检测是一种直接基于灰度图像的角点提取算法,稳定性高,尤其对L型角点检测精度高,但由于采 ...

  10. Java的位运算符——&0xFF的运算与讲解

    快放元旦假,没心思做啥的事,就去翻以前的代码遇到这句,但是又不懂,所以只好上网找,终于懂了那么一点点. 所以那个大神看到我说的有问题,请指出!谢谢.... 一:首先区分一下 A~F的意思先 A,代表十 ...