uva 11538 组合数学
2014-06-12 01:19
417 查看
直接推公式
AC代码如下:
AC代码如下:
#include <iostream> #include <cstring> #include <cstdio> #include <algorithm> using namespace std; unsigned long long ans, n, m; int main(){ while( cin >> n >> m && !( n == 0 && m == 0 ) ){ if( n > m ){ swap( n, m ); } ans = m * n * ( m + n - 2 ) + 2 * n * ( n - 1 ) * ( 3 * m - n - 1 ) / 3; cout << ans << endl; } return 0; }
相关文章推荐
- UVa 11538 - Chess Queen (组合数学)
- uva 11538 组合
- (组合数学3.1.1.2)UVA 10098 Generating Fast(使用字典序思想产生所有序列)
- (UVA - 10943)How do you add? (组合数学,隔板)
- UVALive 6469 Deranged Exams 组合数学+容斥原理
- The queue uvalive 5002 light 1382 uva 12257 (dfs加组合数学)
- uva 11609 - Teams(组合数学+快速幂)
- Uva 11538 Chess Queen (数学规律题)
- UVa 11538 Chess Queen (排列组合计数)
- UVa 10157 Expressions (组合数学&高精度)
- UVA 11174-组合数学+组合数取模+dfs
- UVa 11609 - Teams (组合数学)
- UVA11609 - Teams(组合数学+快速幂)
- UVALive 6909 Kevin's Problem 数学排列组合
- UVa 11538 Chess Queen (组合&分类)
- UVALive 7040 Color (容斥原理 + 组合数学递推公式 + 求逆元 + 基础数论)
- UVA.10325 The Lottery (组合数学 容斥原理 二进制枚举)
- UVA 7360 run step(组合数学)
- 【组合数学】Pole Arrangement, ACM/ICPC Daejeon 2012, UVa1638