level 11
usrbin
楼主
这次SRM题型比较老而且想对容易,就不花大功夫写解题报告了。不过从赛后900pt的AC率来看,tc对网络流模板卡的是相当严的![[汗]](/static/emoticons/u6c57.png)
250pt:
Problem Statement
Fox Jiro likes dice. He wants to make his own dice. Each die he wants to make is a cube. Each of the 6 faces has an integer between 1 and N, inclusive. No two faces have same number. Also the following condition must be satisfied: for all faces, the sum of the numbers on opposite faces must be equal and the sum must be greater than or equal to K.
He realized that there are many ways to make such dice. He wants to know how many ways there are. Please help Jiro to make a program that is given two integers N and K and returns the number of different dice satisfying the condition mentioned above.
Two dice are considered the same if you can rotate one to form the other.
Definition
Class: FoxMakingDice
Method: theCount
Parameters: int, int
Returns: long
Method signature: long theCount(int N, int K)
(be sure your method is public)
==========================================
这题很简单,枚举筛子相对的两个面上的点数i,j,1<=i<j<=N,统计i+j=K,K+1..2N-1的(i,j)对数cnt[K],cnr[K+1]...cnt[2N-1],答案就是 ∑(i>=K,cnt[i]>=3)C(cnt[i],3)*2
算法复杂度O(N^2)
Notes
-
The answer will always fit in a signed 64-bit integer.
Constraints
-
N will be between 1 and 1,000, inclusive.
-
K will be between 1 and 2,000, inclusive.
2010年12月19日 16点12分
1
250pt:
Problem Statement
Fox Jiro likes dice. He wants to make his own dice. Each die he wants to make is a cube. Each of the 6 faces has an integer between 1 and N, inclusive. No two faces have same number. Also the following condition must be satisfied: for all faces, the sum of the numbers on opposite faces must be equal and the sum must be greater than or equal to K.
He realized that there are many ways to make such dice. He wants to know how many ways there are. Please help Jiro to make a program that is given two integers N and K and returns the number of different dice satisfying the condition mentioned above.
Two dice are considered the same if you can rotate one to form the other.
Definition
Class: FoxMakingDice
Method: theCount
Parameters: int, int
Returns: long
Method signature: long theCount(int N, int K)
(be sure your method is public)
==========================================
这题很简单,枚举筛子相对的两个面上的点数i,j,1<=i<j<=N,统计i+j=K,K+1..2N-1的(i,j)对数cnt[K],cnr[K+1]...cnt[2N-1],答案就是 ∑(i>=K,cnt[i]>=3)C(cnt[i],3)*2
算法复杂度O(N^2)
Notes
-
The answer will always fit in a signed 64-bit integer.
Constraints
-
N will be between 1 and 1,000, inclusive.
-
K will be between 1 and 2,000, inclusive.