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. 055 Jump Game 跳跃游戏

    给定一个非负整数数组,您最初位于数组的第一个索引处.数组中的每个元素表示您在该位置的最大跳跃长度.确定是否能够到达最后一个索引.示例:A = [2,3,1,1,4],返回 true.A = [3,2, ...

  2. (转)Linxu磁盘体系知识介绍及磁盘介绍

    Linxu磁盘体系知识介绍及磁盘介绍 系统管理 / 2017-01-14 / 0 条评论 / 浴春风 Linu磁盘设备基础知识指南磁盘速度快具备的条件: 1)主轴的转速5400/7200/10000/ ...

  3. Android 设置资源字体,屏幕截图

    字体设置 将下载的资源字体放在assets中, 引用设置 edit..setTypeface(Typeface.createFromAsset(getAssets(), "字体名.ttf&q ...

  4. 一键部署LNMP堆栈Web应用基础架构

    https://market.azure.cn/Vhd/Show?vhdId=9852&version=10884 产品详情 产品介绍LEMP/LNMP 是指一组通常一起使用来运行动态网站或者 ...

  5. CAS 配置NLB 负载均衡网络无法连接

    在虚拟机与虚拟机.虚拟机与实机之间利用Windows操作系统自带的网络负载均衡功能如选择单播集群模式,网络就无法通讯,NLB不成功. Scenario #1 在虚拟机与虚拟机之间选择多播模式NLB可正 ...

  6. Outlook Web App 客户端超时设置

    这篇文章我们讨论一下,OWA 2013在公共和私人的电脑是如何启用和配置. Exchange 2013 Outlook Web App (OWA) 登录页不再允许用户选择无论他们正在使用公共的或私人的 ...

  7. UVA 11627 Slalom(二分)

    二分,判断的时候,一个点一个点的考虑肯定是不行啦,考虑的单位是一个区间, 每次左端点尽量向左边移动,右端点尽量向右,得到下次可以达到的范围,检查一下和下一个区间有没有交集. #include<b ...

  8. 手机屏幕材质详解(TFT,TPS,OLED,AMOLED等)

    手机屏幕概括起来就是两种,一个是LCD,一个是OLED屏幕,这两个是屏幕显示技术的两大基础. 一 . LCD:Liquid Crystal Display,这是一种介于固态和液态之间的物质,称为液晶技 ...

  9. 用python写trojan的过程中遇到的各种问题

    由于之前已经conn, addr = s.accept() 所以改为  conn.recv spyder无法同时运行client 和 server 分别在spyder和anaconda prompt运 ...

  10. centos7-httpd虚拟主机

    Apache虚拟主机: 一台WEB服务器发布单个网站会非常浪费资源,所以一台WEB服务器上会发布多个网站, 在一台服务器上发布多网站,也称之为部署多个虚拟主机,WEB虚拟主机配置方法有三种: 基于单I ...