TOJ4203: Domino Piece
4203: Domino Piece 
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
这个题挺好玩的,我列出所有排列吧,第一行可以是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的更多相关文章
- SGU 101.Domino( 欧拉路径 )
求欧拉路径...直接dfs即可,时间复杂度O(N) -------------------------------------------------------------------------- ...
- SGU 101 Domino (输出欧拉路径)
101. Domino time limit per test: 0.25 sec. memory limit per test: 4096 KB Dominoes – game played wit ...
- ACM: SGU 101 Domino- 欧拉回路-并查集
sgu 101 - Domino Time Limit:250MS Memory Limit:4096KB 64bit IO Format:%I64d & %I64u Desc ...
- SGU101
Dominoes – game played with small, rectangular blocks of wood or other material, each identified by ...
- Codeforces Gym 100500F Problem F. Door Lock 二分
Problem F. Door LockTime Limit: 20 Sec Memory Limit: 256 MB 题目连接 http://codeforces.com/gym/100500/at ...
- sgu101 欧拉路径 难度:1
101. Domino time limit per test: 0.25 sec. memory limit per test: 4096 KB Dominoes – game played wit ...
- sgu101-欧拉回路
101. Domino time limit per test: 0.25 sec. memory limit per test: 4096 KB Dominoes – game played wi ...
- CF 405B Domino Effect(想法题)
题目链接: 传送门 Domino Effect time limit per test:1 second memory limit per test:256 megabytes Descrip ...
- BPM Domino集成解决方案
一.需求分析 Lotus Notes/Domino是IBM的协同办公平台,在国内有广泛的用户. 但由于推出年头较早.采用文档数据库等特点, 导致其流程集成能力弱.统计分析难.不支持移动办公等问题,很多 ...
随机推荐
- 读写属性/if判断那点事/数组
读写属性属性操作注意事项 js中不允许出现"-".所以font-size变成fontSize/margin-top变成marginTop. Op.style.with=" ...
- Azure 门户使用概览
Azure 门户是管理 Azure 云平台的核心工具,用户可以在其中预配和管理 Azure 资源.本教程将帮助你熟悉Azure管理门户,包括一些关键功能的介绍,并演示了如何通过 Azure 门户创建虚 ...
- python3操作excel02(对excel的基础操作,进行简单的封装)3
#!/usr/bin/env python# -*- coding:UTF-8 -*- import requestsfrom bs4 import BeautifulSoupfrom bs4 imp ...
- 51nod 1525 重组公司
题目来源: CodeForces 基准时间限制:1 秒 空间限制:131072 KB 分值: 80 难度:5级算法题 有n个人在公司里面工作.员工从1到n编号.每一个人属于一个部门.刚开始每一个人在自 ...
- python爬虫之路——初识基本页面构造原理
通过chrome浏览器的使用简单介绍网页构成 360浏览器使用右键审查元素,Chrome浏览器使用右键检查,都可查看网页代码. 网页代码有两部分:HTML文件和CSS样式.其中有<script& ...
- 通过Java代码实现图片的放大和缩小
本文介绍的例子在Android安卓手机上测试通过. 先看看效果吧.可以看到这个开发好的安卓应用有三个按钮:Zoom In缩小图片,Zoom Out放大图片和Save保存. 初始页面: 可以在左边边框自 ...
- Python-OpenCV——Morphological Transformations(形态学转换)
目标 这一节 我们将学习不同的形态学操作,如腐蚀.膨胀.开.闭...... 我们将看到不同的函数,如:cv2.erode().cv2.dilate().cv2.morphology() 理论 形态变换 ...
- 一个.java文件内只能写一个class吗
先给结论:当然不是!! 可以有多个类,但只能有一个public的类,并且public的类名必须与文件名相一致.一个文件中可以不含public类,如果只有一个非public类,此时可以跟文件名不同. 为 ...
- Harvest of Apples
问题 B: Harvest of Apples 时间限制: 1 Sec 内存限制: 128 MB提交: 18 解决: 11[提交] [状态] [讨论版] [命题人:admin] 题目描述 Ther ...
- 第三章 DOM的基本
节点分为不同的类型:元素节点.属性节点和文本节点 getElementById()方法 这个方法将返回一个与那个有着给定id属性值的元素节点相对应的对象.注意大小写.该方法只有一个参数.这个参数也就是 ...