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. 今天犯了一个StringBuilder构造函数引起的二逼问题。

    在.Net里,StringBuilder的构造函数有很多,最常用的是无参的构造函数,默认分配16个字符的空间.其次就是填写StringBuilder空间的带一个Int32的构造函数,这个在优化代码的时 ...

  2. MongoDB VUE的下载及安装

    下载: mongo vue官网地址:http://www.mongovue.com/ 安装: 很简单,注意的是:在提示buy 和 OK  的时候点击OK即可: 连接: 默认连接(无用户名密码): 在启 ...

  3. c# 字符串去掉两端空格,并且将字符串中多个空格替换成一个空格

    字符串去掉两端空格,并且将字符串中多个空格替换成一个空格: 主要还是考察使用字符串的方法: trim(); 去掉字符串两端空格 split(); 切割 string.join(); 连接 class ...

  4. kernel 调试 打印IP地址

    #define NIPQUAD(addr) \ ((unsigned char *)&addr)[0], \ ((unsigned char *)&addr)[1], \ ((unsi ...

  5. 2017 NAIPC A:Pieces of Parentheses

    my team solve the problem in the contest with similar ideathis is a more deep analysis The main idea ...

  6. 记录初学Spring boot中使用GraphQL编写API的几种方式

    Spring boot+graphql 一.使用graphql-java-tools方式 <dependency> <groupId>com.graphql-java-kick ...

  7. 洛谷P3369 【模板】普通平衡树(Splay)

    题面 传送门 题解 鉴于最近的码力实在是弱到了一个境界--回来重新打一下Splay的板子--竟然整整调了一个上午-- //minamoto #include<bits/stdc++.h> ...

  8. canvas 绘制圆形进度条

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

  9. Java并发(一)-了解线程安全

    线程不安全性 先来举例说明线程不安全是什么情况下发生的:例如一个变量可以被多个线程进行访问,那么在大量线程并发访问这个变量的情况下,线程执行的顺序会给最后的结果带来不可预估的错误. 先定义一个单例类S ...

  10. Hadoop2.2.0安装笔记

    最近想学习hadoop,于是网上找了些教程学习,几经周折,总算安装成功了! 先讲下环境,就2台机器...都是vmware虚拟机,操作系统centos, jdk版本 1.8.0 hadoop版本 2.2 ...