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. 开源组件 Mark

    http://www.cnblogs.com/asxinyu/category/661170.html

  2. 滚动条插件mCustomScrollbar

    1. 参考网站 http://www.wufangbo.com/mcustomscrollbar/ 2. 使用方法

  3. [整理]Magento2 开发中遇到的错误以及解决方案

    下面记录了一些我在二次开发Magento2是所遇到的错误.错误原因以及解决方案: 1. Object DOMDocument should be created type: report 日志摘要: ...

  4. [Loading Component]Loading组件的v-model设计是否不合理?

    vue在2.4.2版本中给computed里的属性加了限制,详见assigning to a computed property without setter does not fail 项目将vue ...

  5. vuejs vue-resource post方式提交参数PHP $_POST获取不到

  6. angularjs实现导航菜单切换高亮

    <ul> <li ng-repeat="(index, item) in headerList"> <a ui-sref="{{item.h ...

  7. HBase数据模型(1)

    HBase数据模型(1) HBase数据模型(2) 1.0 HBase的特性 Table HBase以表(Table)的方式组织数据,数据存储在表中. Row/Column 行(Row)和列(Colu ...

  8. RSA_new()初始化和RSA_free()释放RSA结构体后依然会有内存泄漏(转)

    在使用OpenSSL的RSA加解密的时候,发现RSA_new()初始化和RSA_free()释放RSA结构体后依然会有内存泄漏.网上Baidu.Google之,发现这个相关信息很少(至少中文搜索结果是 ...

  9. Unity3d通过脚本生成apk

    参考链接:http://www.jianshu.com/p/a9261113b4ac 照着链接的方法并没有正确生成APK,IPA没有测试过,不过大致的方法是正确的,修改如下: Environment. ...

  10. Easy UI 关联表的字段展示

    刚接触的easy UI ,发现展示关联表的字段的时候,卡住了 好一段时间,后来通过qq群询问,终于得到答案 实体Record public class Record:Base { public Gui ...