Self Numbers
Self Numbers
Time Limit : 20000/10000ms (Java/Other) Memory Limit : 65536/32768K (Java/Other)
Total Submission(s) : 34 Accepted Submission(s) : 16
#include <stdio.h>
#include <string.h>
int sum[]={};
int All_sum(int n)
{
if (n<)
return n;
else
return (n%)+All_sum(n/);
} void num(int i,int n)
{
int j,k=i-*n,tmp;
if(k<)
k=;
while()
{
tmp=k;
if(k>i)
return ;
tmp+=All_sum(k);
if(tmp==i)
{sum[tmp]+=;return ;}
k++;
}
return ;
} int main()
{
int i,n,Len,k,a,j;
for(i=;i<=;i++)
{
if(i<)n=;else if(i<)n=; else if(i<)n=; else if(i<)n=; else if(i<)n=; else if(i<)n=;
if(sum[i]==)
{
num(i,n);
}
if(sum[i]==)
printf("%d\n",i);
}
return ;
}
Self Numbers的更多相关文章
- Java 位运算2-LeetCode 201 Bitwise AND of Numbers Range
在Java位运算总结-leetcode题目博文中总结了Java提供的按位运算操作符,今天又碰到LeetCode中一道按位操作的题目 Given a range [m, n] where 0 <= ...
- POJ 2739. Sum of Consecutive Prime Numbers
Sum of Consecutive Prime Numbers Time Limit: 1000MS Memory Limit: 65536K Total Submissions: 20050 ...
- [LeetCode] Add Two Numbers II 两个数字相加之二
You are given two linked lists representing two non-negative numbers. The most significant digit com ...
- [LeetCode] Maximum XOR of Two Numbers in an Array 数组中异或值最大的两个数字
Given a non-empty array of numbers, a0, a1, a2, … , an-1, where 0 ≤ ai < 231. Find the maximum re ...
- [LeetCode] Count Numbers with Unique Digits 计算各位不相同的数字个数
Given a non-negative integer n, count all numbers with unique digits, x, where 0 ≤ x < 10n. Examp ...
- [LeetCode] Bitwise AND of Numbers Range 数字范围位相与
Given a range [m, n] where 0 <= m <= n <= 2147483647, return the bitwise AND of all numbers ...
- [LeetCode] Valid Phone Numbers 验证电话号码
Given a text file file.txt that contains list of phone numbers (one per line), write a one liner bas ...
- [LeetCode] Consecutive Numbers 连续的数字
Write a SQL query to find all numbers that appear at least three times consecutively. +----+-----+ | ...
- [LeetCode] Compare Version Numbers 版本比较
Compare two version numbers version1 and version1.If version1 > version2 return 1, if version1 &l ...
- [LeetCode] Sum Root to Leaf Numbers 求根到叶节点数字之和
Given a binary tree containing digits from 0-9 only, each root-to-leaf path could represent a number ...
随机推荐
- Spring MVC如何进行JSON数据的传输与接受
本篇文章写给刚接触SpingMVC的同道中人,虽然笔者本身水平也不高,但聊胜于无吧,希望可以给某些人带来帮助 笔者同时再次说明,运行本例时,需注意一些配置文件和网页脚本的路径,因为笔者的文件路径与读者 ...
- 小团队git开发模式
实验室要使用Git进行代码管理,但是git非常复杂,各种开发模式也是层出不穷.作为新手的偶们很是发囧啊!!网上搜了一下,发现很多并不适合我们小团队运作(它本身就是为Linux内核管理而开发的分布式代码 ...
- WebApi Help Pages
如何新建Help Pages在此不多复述,网上很多: https://www.asp.net/web-api/overview/getting-started-with-aspnet-web-api/ ...
- AMD规范
common.js主要语法就是 var math=require('math'); math.add(2,3); require()用于加载模块就行了. 二行math.add(2, 3),在第一行re ...
- 奇葩json结构解析--key是数字的json处理
json结构如下: { "ret": "ok", "data": { "57230": { "cat_id&q ...
- centsOS下安装vsftp的配置
1. 添加用户组 # groupadd www 2. 修改配置 # vi /etc/vsftpd/vsftpd.conf 查找: #chroot_list_enable=YES #chroot_lis ...
- iOS开发tableview二级联动的细节实现中注意的细节总结
首先说网络慢带来的数据显示问题 可以通过判断请求参数是否一致来刷新tableview. SJBCategaryModel * categaryModel = self.categarys[Catega ...
- GIAC全球互联网架构大会——互联网技术架构未来
GIAC全球互联网架构大会是高可用架构技术社区推出的面向架构师.技术负责人及高端技术从业人员的技术架构大会.中国拥有全球最大的互联网用户及移动互联网用户,如何使用合适的架构来搭建互联网系统,是每一个互 ...
- html5权威指南:嵌入另一张HTML文档、通过插件嵌入内容、嵌入数字表现形式
嵌入另一张HTML文档.通过插件嵌入内容.嵌入数字表现形式:http://www.cnblogs.com/yc-755909659/p/5928125.html
- POJ 2305 Basic remains(进制转换)
题目链接:http://poj.org/problem?id=2305 ime Limit: 1000MS Memory Limit: 65536K Total Submissions: 5326 ...