下载此文档

巧妙的方法.doc


文档分类:生活休闲 | 页数:约17页 举报非法文档有奖
1/17
下载提示
  • 1.该资料是网友上传的,本站提供全文预览,预览什么样,下载就什么样。
  • 2.下载该文档所得收入归上传者、原创者。
  • 3.下载的文档,不会出现我们的网址水印。
1/17 下载此文档
文档列表 文档介绍
1281 凸多边形对角线对角线问题;
统计问题
Description
给出一个带n个顶点的凸多边形,我们保证它不存在3条对角线相交于同一个点。请统计每两条对角线的交点数的和。n=6时,图中的15个圆点即为所求交点
Input
输入只含一个整数n(3≤n≤100)。
Output
输出交点数。
Sample Input
6
Sample Output
15
Hint
一个多边形是凸多边形当且仅当每个内角都小于180°。

代码:
#include <>
int main()
{
int n;
while(scanf("%d",&n)!=EOF)
{
int allb;
allb=n*(n-1)*(n-2)*(n-3)/24;
printf("%d\n",allb);
}
return 0;

}
1341 巧用异或
Who will be punished
Description
This time,suddenly,teacher Li wants to find out who have missed interesting DP lesson to have students who are found out will get strictly ,teacher Li wants all the students master the DP algorithm.
However,Li doesn't want to waste the class time to call over the names of he let the students to write down their names in one his satisfaction,this time, only one student has not come.
He can get the name who has not come to class,but,it is troublesome,and,teacher always have many things to think about,so,teacher Li wants you, who is in the ACM team, to pick out the name.
Input
There are several test first line of each case have one positive integer is the number of the students,and N will not greater than 500,000.
Then,following N lines,each line contains one name of students who have attended N-1 lines are presented after N N-1 lines indicates the names of students who have come to class this time,one name in one line.
The length of student's name is not greater than 30.
Process to the end of file.
Output
For each test case, first print a line saying "Scenario #k", where k is the number of the test output the name of the student who have not come to case per a blank line after each test case, even after the last one.
Sample Input
3
A
B
C
B
C
Sample Output
Scenario #1
A
代码A:
#include <iostream>
#include <cstdio>
#includ

巧妙的方法 来自淘豆网m.daumloan.com转载请标明出处.

相关文档 更多>>
非法内容举报中心
文档信息
  • 页数17
  • 收藏数0 收藏
  • 顶次数0
  • 上传人陈潇睡不醒
  • 文件大小161 KB
  • 时间2020-12-26