r749. Dominoes
標籤 : Zaim
通過比率: 5人/ 5人 ( 100%) [非即時]
評分方式:
Tolerant

最近更新 : 2025-12-09 19:43

內容

Dominoes are tile pieces used in various games. A domino piece consists of two squares. Each square is marked with dots, but may or may not be marked with dots. The number of dots is determined by the size of the set. In a domino set of size N, the number of dots is greater than or equal to 0 and less than or equal to N. If two dominoes have the same number of dots, they are equal. For example, a domino with 2 dots and 8 dots is the same as a domino with 8 dots and 2 dots.

A domino set of size N contains all possible dominoes with N or fewer or equal points, and each domino is unique. The following is a domino set of size 2.

After receiving N as input, write a program that calculates how many dots are in a domino set of size N.

輸入說明

The first line contains the size N of the domino set (1 ≤ N ≤ 1000).

輸出說明

Print the number of dots printed on a set of dominoes of size N.

範例輸入 #1
2
範例輸出 #1
12
範例輸入 #2
3
範例輸出 #2
30
範例輸入 #3
15
範例輸出 #3
2040
測資資訊:
記憶體限制: 128 MB
不公開 測資點#0 (5%): 0.5s , <1K
不公開 測資點#1 (5%): 0.5s , <1K
不公開 測資點#2 (5%): 0.5s , <1K
不公開 測資點#3 (5%): 0.5s , <1K
不公開 測資點#4 (5%): 0.5s , <1K
不公開 測資點#5 (5%): 0.5s , <1K
不公開 測資點#6 (5%): 0.5s , <1K
不公開 測資點#7 (5%): 0.5s , <1K
不公開 測資點#8 (5%): 0.5s , <1K
不公開 測資點#9 (5%): 0.5s , <1K
不公開 測資點#10 (5%): 0.5s , <1K
不公開 測資點#11 (5%): 0.5s , <1K
不公開 測資點#12 (5%): 0.5s , <1K
不公開 測資點#13 (5%): 0.5s , <1K
不公開 測資點#14 (5%): 0.5s , <1K
不公開 測資點#15 (5%): 0.5s , <1K
不公開 測資點#16 (5%): 0.5s , <1K
不公開 測資點#17 (5%): 0.5s , <1K
不公開 測資點#18 (5%): 0.5s , <1K
不公開 測資點#19 (5%): 0.5s , <1K
提示 :
標籤:
Zaim
出處:
COCI 2009/2010 Contest #1 P2 [管理者: chenwei98050 ... (陳維(Z)) ]

本題狀況 本題討論 排行

編號 身分 題目 主題 人氣 發表日期
沒有發現任何「解題報告」