UVA-11538
来源:互联网 发布:办公平台软件 编辑:程序博客网 时间:2024/05/19 23:13
//#include <bits/stdc++.h>#include <vector>#include <iostream>#include <queue>#include <cmath>#include <map>#include <cstring>#include <algorithm>#include <cstdio>using namespace std;#define Riep(n) for(int i=1;i<=n;i++)#define Riop(n) for(int i=0;i<n;i++)#define Rjep(n) for(int j=1;j<=n;j++)#define Rjop(n) for(int j=0;j<n;j++)#define mst(ss,b) memset(ss,b,sizeof(ss));typedef unsigned long long LL;template<class T> void read(T&num) { char CH; bool F=false; for(CH=getchar();CH<'0'||CH>'9';F= CH=='-',CH=getchar()); for(num=0;CH>='0'&&CH<='9';num=num*10+CH-'0',CH=getchar()); F && (num=-num);}int stk[70], tp;template<class T> inline void print(T p) { if(!p) { puts("0"); return; } while(p) stk[++ tp] = p%10, p/=10; while(tp) putchar(stk[tp--] + '0'); putchar('\n');}const LL mod=1e9+7;const double PI=acos(-1.0);const LL inf=1e18;const int N=1e5+10;const int maxn=1005;LL n,m;int main(){ while(1) { read(n);read(m); if(n==0&&m==0)break; if(n>m)swap(n,m); LL ans=n*m*(n+m-2); ans+=2*(n-1)*n*(3*m-n-1)/3; cout<<ans<<"\n"; } return 0;}
0 0
- uva-11538
- UVA-11538
- UVa 11538 - Chess Queen
- Chess Queen UVA 11538
- UVA 11538 Chess Queen
- Uva-11538-Chess Queen
- UVa 11538 Chess Queen
- UVa 11538 - Chess Queen
- uva 11538 Chess Queen
- UVA 11538 Chess Queen
- UVA 11538 - Chess Queen
- uva 11538 Chess Queen
- UVA - 11538 Chess Queen
- uva 11538 组合数学
- UVA 11538 Chess Queen
- UVA - 11538 Chess Queen
- UVA 11538 Chess Queen
- uva 11538 Chess Queen
- jar包学习
- 常用vim快捷键 (未包括折叠
- cocos2dx-深度解析plist文件(一)(游戏对象的数据如何从plist创建获取)
- 创建Executor
- Hbase 单机版
- UVA-11538
- iOS 简单动画效果实现的三种方式
- XCode磁盘空间清理
- STL动态数组类
- 虚拟机中的对象
- MySql 5.7.13 覆盖安装问题
- Java application—SS1
- InputStream类和OutputStream类
- 动态绑定事件插件—livequery