http://acm.zjut.edu.cn/ShowProblem.aspx?ShowID=1402 求这题代码 怎么解?Gifts' Exchange Time Limit:1000MS Memory Limit:32768KDescription:There are N persons gathering together each with a unique gift. They are going to have an exchange of thei
来源:学生作业帮助网 编辑:六六作业网 时间:2024/12/29 02:42:59
http://acm.zjut.edu.cn/ShowProblem.aspx?ShowID=1402 求这题代码 怎么解?Gifts' Exchange Time Limit:1000MS Memory Limit:32768KDescription:There are N persons gathering together each with a unique gift. They are going to have an exchange of thei
http://acm.zjut.edu.cn/ShowProblem.aspx?ShowID=1402 求这题代码 怎么解?
Gifts' Exchange
Time Limit:1000MS Memory Limit:32768K
Description:
There are N persons gathering together each with a unique gift. They are going to have an exchange of their gifts, satisfying the condition that everyone gets a new gift when the gathering is over. You are to calculate the number of possible results of exchanging.
Input:
The first line of input contains a number T (1
http://acm.zjut.edu.cn/ShowProblem.aspx?ShowID=1402 求这题代码 怎么解?Gifts' Exchange Time Limit:1000MS Memory Limit:32768KDescription:There are N persons gathering together each with a unique gift. They are going to have an exchange of thei
#include
int n,t,f=1;
long long a[1000005];
int main()
{
for(int i=2;i