4203: Domino Piece 

Time Limit(Common/Java):1000MS/3000MS     Memory Limit:65536KByte
Total Submit: 55            Accepted:41

Description

Dominoes are gaming pieces used in numerous tile games. Each doimno piece contains two marks. Each mark consists of a number of spots (possibly zero).
The number of spots depends on the set size. Each mark in a size N domino set can contain between 0 and N spots, inclusive. Two tiles are considered identical if their marks have the same number of spots, irregardles of reading order. For example tile with 2 and 8 spot marks is identical to the tile having 8 and 2 spot marks. A proper domino set contains no duplicate tiles. A complete set of size N contains all posible tiles with N or less spots and no duplicate tiles. For example, the complete set of size 2 contains 6 tiles:

Write a program that will determine the total number of spots on all tiles of a complete size N set.

Input

The first and only line of input contains a single integer, N (1 ≤ N ≤ 1000), the size of the complete set.

Output

The first and only line of output should contain a single integer, total number of spots in a complete size N set.

Sample Input

3

Sample Output

12

Source

TOJ

这个题挺好玩的,我列出所有排列吧,第一行可以是0-n,对应下一行可以是0-n,这个第一行0-n的都要出现n+1次,上下相同的要除去,所以直接n*(n+1)(n+2)/2

#include<stdio.h>
int main()
{
int n;
scanf("%d",&n);
printf("%d",n*(n+)/*(n+));
}

TOJ4203: Domino Piece的更多相关文章

  1. SGU 101.Domino( 欧拉路径 )

    求欧拉路径...直接dfs即可,时间复杂度O(N) -------------------------------------------------------------------------- ...

  2. SGU 101 Domino (输出欧拉路径)

    101. Domino time limit per test: 0.25 sec. memory limit per test: 4096 KB Dominoes – game played wit ...

  3. ACM: SGU 101 Domino- 欧拉回路-并查集

    sgu 101 - Domino Time Limit:250MS     Memory Limit:4096KB     64bit IO Format:%I64d & %I64u Desc ...

  4. SGU101

    Dominoes – game played with small, rectangular blocks of wood or other material, each identified by ...

  5. Codeforces Gym 100500F Problem F. Door Lock 二分

    Problem F. Door LockTime Limit: 20 Sec Memory Limit: 256 MB 题目连接 http://codeforces.com/gym/100500/at ...

  6. sgu101 欧拉路径 难度:1

    101. Domino time limit per test: 0.25 sec. memory limit per test: 4096 KB Dominoes – game played wit ...

  7. sgu101-欧拉回路

    101. Domino time limit per test: 0.25 sec.  memory limit per test: 4096 KB Dominoes – game played wi ...

  8. CF 405B Domino Effect(想法题)

    题目链接: 传送门 Domino Effect time limit per test:1 second     memory limit per test:256 megabytes Descrip ...

  9. BPM Domino集成解决方案

    一.需求分析 Lotus Notes/Domino是IBM的协同办公平台,在国内有广泛的用户. 但由于推出年头较早.采用文档数据库等特点, 导致其流程集成能力弱.统计分析难.不支持移动办公等问题,很多 ...

随机推荐

  1. 初识AutoCompleteTextView

    AutoCompleteTextView自动补全框继承自TextView和EditView,通过一个下拉框的形式可以补全信息. 可以通过setThreshold()方法指定用户输入多少个字符后开始显示 ...

  2. Android Google Map API使用的八个步骤

    本系列教程将分为两部分,第一部分是指导用户使用Mapview控件进行编程,其中包括了如何获得Google Map API,如何使用该API进行简单的开发,如何获得用户当前所在的位置.第二部分则包括如何 ...

  3. 单链表常见面试题(C语言实现)

    总结常见的单链表操作函数,复习使用,仅供参考,代码调试通过. #include<stdio.h> typedef struct node{ int data; struct node *n ...

  4. Netweaver和CloudFoundry的服务器日志

    Netweaver 事务码SMICM,Goto->HTTP Plug-In->Server Logs: CloudFoundry 假设我部署本地应用到CloudFoundry之后,应用的状 ...

  5. Android(java)学习笔记113:Activity的生命周期

    1.首先来一张生命周期的总图: onCreate():创建Acitivity界面       onStart():让上面创建的界面可见              onResume():让上面创建的界面 ...

  6. [视觉] 基于YoloV3的实时摄像头记牌器

    基于YoloV3的实时摄像头记牌器 github:https://github.com/aoru45/cards_recognition_recorder_pytorch 最终效果 数据准备 数据获取 ...

  7. python_103_属性方法例子

    class Flight(object): def __init__(self,name): self.flight_name = name def checking_status(self): pr ...

  8. IDEA安装及破解

    一.下载(IDEA 2019.1.2) 1.下载地址:https://www.jetbrains.com/idea/download/#section=windows 2.选择版本,并选择最终版(.e ...

  9. NOIP2018 - 暑期博客整理

    暑假写的一些博客复习一遍.顺便再写一遍或者以现在的角度补充一点东西. 盛暑七月 初涉基环外向树dp&&bzoj1040: [ZJOI2008]骑士 比较经典的基环外向树dp.可以借鉴的 ...

  10. 【数位dp】bzoj3131: [Sdoi2013]淘金

    思路比较自然,但我要是考场上写估计会写挂:好像被什么不得了的细节苟住了?…… Description 小Z在玩一个叫做<淘金者>的游戏.游戏的世界是一个二维坐标.X轴.Y轴坐标范围均为1. ...