Let's consider some math problems.

JSZKC has a set A=A={1,2,...,N}. He defines a subset of A as 'Meo set' if there doesn't exist two integers in this subset with difference one. For example, When A={1,2,3},{1},{2},{3},{1,3} are 'Meo set'.

For each 'Meo set', we can calculate the product of all the integers in it. And then we square this product. At last, we can sum up all the square result of the 'Meo set'.

So please output the final result.

Input Format

The input file contains several test cases, each of them as described below.

  • The first line of the input contains one integers N(1≤N≤100), giving the size of the set.

There are no more than 100test cases.

Output Format

One line per case, an integer indicates the answer.

样例输入

3

样例输出

23

题目来源

The 2018 ACM-ICPC China JiangSu Provincial Programming Contest

 //要用java大数,规律为(n+1)!-1
import java.io.*;
import java.util.*;
import java.math.BigInteger;
public class a{
public static void main(String args[]){
Scanner cin=new Scanner (System.in);
int n;
BigInteger a=BigInteger.valueOf();
while(cin.hasNext()){
n=cin.nextInt();
BigInteger ans=BigInteger.valueOf();
for(int i=;i<=n+;i++)
{
ans=ans.multiply(BigInteger.valueOf(i));
//System.out.println(ans);
}
ans=ans.subtract(a);
System.out.println(ans);
}
}
}

The 2018 ACM-ICPC China JiangSu Provincial Programming Contest J. Set的更多相关文章

  1. The 2018 ACM-ICPC China JiangSu Provincial Programming Contest快速幂取模及求逆元

    题目来源 The 2018 ACM-ICPC China JiangSu Provincial Programming Contest 35.4% 1000ms 65536K Persona5 Per ...

  2. The 2018 ACM-ICPC China JiangSu Provincial Programming Contest I. T-shirt

    JSZKC is going to spend his vacation! His vacation has N days. Each day, he can choose a T-shirt to ...

  3. The 2018 ACM-ICPC China JiangSu Provincial Programming Contest(第六场)

    A Plague Inc Plague Inc. is a famous game, which player develop virus to ruin the world. JSZKC wants ...

  4. C.0689-The 2019 ICPC China Shaanxi Provincial Programming Contest

    We call a string as a 0689-string if this string only consists of digits '0', '6', '8' and '9'. Give ...

  5. B.Grid with Arrows-The 2019 ICPC China Shaanxi Provincial Programming Contest

    BaoBao has just found a grid with $n$ rows and $m$ columns in his left pocket, where the cell in the ...

  6. ACM ICPC, Damascus University Collegiate Programming Contest(2018) Solution

    A:Martadella Stikes Again 水. #include <bits/stdc++.h> using namespace std; #define ll long lon ...

  7. 计蒜客 39272.Tree-树链剖分(点权)+带修改区间异或和 (The 2019 ACM-ICPC China Shannxi Provincial Programming Contest E.) 2019ICPC西安邀请赛现场赛重现赛

    Tree Ming and Hong are playing a simple game called nim game. They have nn piles of stones numbered  ...

  8. 计蒜客 39280.Travel-二分+最短路dijkstra-二分过程中保存结果,因为二分完最后的不一定是结果 (The 2019 ACM-ICPC China Shannxi Provincial Programming Contest M.) 2019ICPC西安邀请赛现场赛重现赛

    Travel There are nn planets in the MOT galaxy, and each planet has a unique number from 1 \sim n1∼n. ...

  9. 计蒜客 39279.Swap-打表找规律 (The 2019 ACM-ICPC China Shannxi Provincial Programming Contest L.) 2019ICPC西安邀请赛现场赛重现赛

    Swap There is a sequence of numbers of length nn, and each number in the sequence is different. Ther ...

随机推荐

  1. 死磕 java并发包之LongAdder源码分析

    问题 (1)java8中为什么要新增LongAdder? (2)LongAdder的实现方式? (3)LongAdder与AtomicLong的对比? 简介 LongAdder是java8中新增的原子 ...

  2. jQuery toggle 使用

    jQuery 中 toggle 作用 切换元素的显示与隐藏状态 如果被选元素可见,则隐藏这些元素,如果被选元素隐藏,则显示这些元素. <body> <div class=" ...

  3. eclipse、idea安装lombok插件

    今天新项目中,用到了lombok知识,很方便. 但是使用之前,需要在eclipse.idea中安装插件才可以使用,配置如下.  一:在开发工具中安装插件: Eclipse: 下载地址:https:// ...

  4. 使用as开发jni入门(附验证):配置ndk开发环境,配置as相关jni配置

    编写jni,生成so文件: 1.通过as内置的Android SDK下载需要使用的ndk,在系统环境变量设置相关参数 2.新建一个普通as项目,新建一个类,用来静态加载so库和书写本地native方法 ...

  5. [选择排序] 时间复杂度O(n^2)

    思路:从未排序的序列中,找到最小的元素,放到序列的起始位置, 再从剩下没排序的里面,找到最小的,放到已经排序的末尾. 原地操作几乎是选择排序的唯一优点,当空间复杂度要求较高时,可以考虑选择排序:实际适 ...

  6. 快速搭建基于Azure Paas的高可用WordPress网站

    产品详情 产品介绍 WordPress是一种使用非常广泛的CMS系统.本应用是根据Azure Resource Manager模板创建的.通过该ARM模板可以快速建立web应用和MySQL数据库,部署 ...

  7. CentOS6.4安装JDK,卸载自带的OpenJDK

    1.查看OpenJDK的安装包 $ rpm -qa |grep java java-1.6.0-openjdk-1.6.0.0-1.62.1.11.11.90.el6_4.x86_64 java-1. ...

  8. COGS 1619. [HEOI2012]采花

    ★★☆   输入文件:1flower.in   输出文件:1flower.out   简单对比时间限制:5 s   内存限制:128 MB [题目描述] 萧薰儿是古国的公主,平时的一大爱好是采花. 今 ...

  9. 51nod 1631 小鲨鱼在51nod小学

    基准时间限制:1 秒 空间限制:131072 KB 分值: 20 难度:3级算法题 鲨鱼巨巨2.0(以下简称小鲨鱼)以优异的成绩考入了51nod小学.并依靠算法方面的特长,在班里担任了许多职务.   ...

  10. 51nod 1640 天气晴朗的魔法

    题目来源: 原创 基准时间限制:1 秒 空间限制:131072 KB 分值: 20 难度:3级算法题 这样阴沉的天气持续下去,我们不免担心起他的健康.   51nod魔法学校近日开展了主题为“天气晴朗 ...