VF

描述

Vasya is the beginning mathematician. He decided to make an important contribution to the science and to become famous all over the world. But how can he do that if the most interesting facts such as Pythagor’s theorem are already proved? Correct! He is to think out something his own, original. So he thought out the Theory of Vasya’s Functions. Vasya’s Functions (VF) are rather simple: the value of the Nth VF in the point S is an amount of integers from 1 to N that have the sum of digits S. You seem to be great programmers, so Vasya gave you a task to find the milliard VF value (i.e. the VF with N = 109) because Vasya himself won’t cope with the task. Can you solve the problem?
 
输入
There are multiple test cases. Integer S (1 ≤ S ≤ 81).
输出
The milliard VF value in the point S.
样例输入
1
样例输出
10
#include <iostream>
#include <iomanip>
#include <algorithm>
#include <vector>
#include <list>
#include <memory.h>
#include <string>
#include <math.h>
using namespace std;
int arr[][];
int main()
{
int n;
for(int i=;i<=;i++)
arr[][i] = ; for(int i=;i<=;i++)
for(int j=;j<=*i;j++)
for(int k=;k<= && k<=j;k++)
arr[i][j] += arr[i-][j-k]; while(cin>>n)
{
if(n==)
{
cout<<<<endl;
continue;
} int sum = ;
for(int i=;i<=;i++)
sum += arr[i][n];
cout<<sum<<endl;
}
return ;
}

VF的更多相关文章

  1. salesforce 零基础学习(二十七)VF页面等待(loading)效果制作

    进行查询的情况下,显示友好的等待效果可以让用户更好的了解目前的状态以及减少用户消极的等待,例如下图所示. VF提供了<apex:actionStatus>标签,,此标签用于显示一个AJAX ...

  2. salesforce 零基础学习(二十六)自定义图表chart简单介绍(使用apex和VF实现)

    chart在报表中经常使用到,他可以使报表结果更加直观的展现给用户.salesforce支持VF和apex代码来更好的展示chart. chart分类:常用的图表样式有饼状图,柱状图,折线图,条形图, ...

  3. nyoj VF函数

    大意就是: 在1到在10的9次方中,找到各个位数和为固定值s的数的个数, 首先我们确定最高位的个数,为1到9: 以后的各位为0,到9: 运用递归的思想,n位数有n-1位数生成 f(n)(s) +=f( ...

  4. 教程-(SQL DBE、ADO连接)+(Firebird火鸟+DbExpress)+(VF DBF数据库)+(DB Paradox)

    DBE 连接SQL Server显然用ADO或DBEXPRESS更有优势,起码连接起来比较方便. BDE的话可以用如下方法:(以下以Delphi7为例,其它版本的DELPHI请自己摸索一下,不过基本相 ...

  5. VF(动态规划)

    VF 时间限制:1000 ms  |  内存限制:65535 KB 难度:2 描述 Vasya is the beginning mathematician. He decided to make a ...

  6. rm -vf `ls |egrep -v "info_20130826-180233.31764|QueryParser.INFO"`

    > rm -vf `ls |egrep -v "info_20130826-180233.31764|QueryParser.INFO"`

  7. salesforce 零基础学习(六十五)VF页面应善于使用变量和函数(一)常用变量的使用

    我们在使用formula或者validation rules等的时候通常会接触到很多function,这些函数很便捷的解决了我们很多问题.其实很多函数也可以应用在VF页面中,VF页面有时候应该善于使用 ...

  8. salesforce 零基础学习(六十六)VF页面应善于使用变量和函数(二)常用函数的使用

    上一篇介绍VF中常用的变量,此篇主要内容为VF页面可以直接使用的函数,主要包括Date相关函数,Text相关函数,Information相关函数以及logic相关函数,其他相关函数,比如math相关函 ...

  9. salesforce零基础学习(八十六)Ajax Toolkit (VF页面中使用及javascript action使用)

    Ajax Toolkit 参考文档:https://resources.docs.salesforce.com/212/latest/en-us/sfdc/pdf/apex_ajax.pdf 在项目中 ...

  10. 高性能网络 SR-IOV机制--VF与PF的通信

    PF 驱动是一个专门管理SR-IOV设备全局功能驱动,而且还要配置相关共享资源.PF 驱动 随着Hypervisor 的不同而不同,一般需要具有比普通虚拟机更高的权限才能对其进行操作.PF驱动包含了所 ...

随机推荐

  1. Leader Election 选举算法

    今天讲一讲分布式系统中必不可少的选举算法. leader 就是一堆服务器中的协调者,某一个时刻只能有一个leader且所有服务器都承认这个leader. leader election就是在一组进程中 ...

  2. MVC-1.1 BundleConfig-ScriptBundle

    App_Start中的BudleCnfig.cs中 bundles.Add(new ScriptBundle("~/bundles/jquery").Include( " ...

  3. 设计模式之外观模式(Facade Pattern)

    一.什么是外观模式? 简单的说,外观模式是用来简化接口的. 通常,我们觉得一个子系统不好用,可能是因为它提供的外部接口太接近低层组件,让我们用起来感到很麻烦. 因为我们不需要知道内部细节,我们只想要一 ...

  4. 【加密算法】SHA

    一.简介 安全散列算法(英语:Secure Hash Algorithm,缩写为SHA)是一个密码散列函数家族,是FIPS所认证的安全散列算法.能计算出一个数字消息所对应到的,长度固定的字符串(又称消 ...

  5. 使用vue.js常见错误之一

    打包项目时,在vscode中输入如下命令 webpack .\src\main.js .\dist\bundle.js 出现如下错误: WARNING in configurationThe 'mod ...

  6. Python 使用 os 模块遍历目录/获取当前文件的路径

    1.列出指定目录下所包含的目录 item = os.listdir("/Users/jinchengxie/go") 返回的是一个列表, 里面包含了指定目录下所包含的所有的目录 2 ...

  7. Python 使用 lambda() 结合sort() 或 sorted() 对列表嵌套字典格式的数据进行排序

    1.使用sort()方法进行排序 my_list = [{"age":65, "money":5}, {"age":35, "mo ...

  8. jzoj5843

    给定 n 个正整数序列 ,每个序列长度为m. 选择至少 1 个序列,在每个被选择的序列中选择一个元素,求出所有被选择的元素的 gcd. 求所有方案的结果之和,答案对 1e9+7 取模.两种方案不同,当 ...

  9. Slope one—个性化推荐中最简洁的协同过滤算法

    Slope One 是一系列应用于 协同过滤的算法的统称.由 Daniel Lemire和Anna Maclachlan于2005年发表的论文中提出. [1]有争议的是,该算法堪称基于项目评价的non ...

  10. 更换SSL证书

    1.申请证书,需要提供完整域名(例如:xxx.aaa.com),会和证书完全匹配. 2.将证书上传到web服务器,例如我的nginx,在server中指定证书路径. 3.重启web服务器.(这个证书和 ...