此题就是求格点中三角形的个数。就是找出三点不共线的个数。n*m的矩形中有(n+1)*(m+1)个格点。选出三个点的总个数为:C((n+1)*(m+1),3).减掉共线的情况就是答案了。首先是水平和垂直共线的情况:C(n+1,3)*(m+1)+C(m+1,3)*(n+1);然后斜的共线的情况就是枚举....
分类:
其他好文 时间:
2015-04-06 00:52:46
阅读次数:
221
题目思路:先倒推!到最后第二步,然后:初始状态不一定满足这个状态。所以我们要先从初始状态构造出它出发的三种状态。那这三种状态跟倒推得到的状态比较即可。#include#include#include using namespace std;int t,a[5],b[5];int main(){ .....
分类:
其他好文 时间:
2015-04-05 23:07:54
阅读次数:
205
YY's Minions
Time Limit: 2 Seconds
Memory Limit: 65536 KB
Despite YY's so much homework, she would like to take some time to play with her minions first.
YY lines her minions up to an...
分类:
其他好文 时间:
2015-04-05 22:00:47
阅读次数:
262
Abs Problem
Time Limit: 2 Seconds
Memory Limit: 65536 KB Special Judge
Alice and Bob is playing a game, and this time the game is all about the absolute value!
Alice has N differ...
分类:
其他好文 时间:
2015-04-05 20:30:12
阅读次数:
187
ZOJ 3179 Calculate With Abacus(数学啊 )...
分类:
其他好文 时间:
2015-04-05 18:55:39
阅读次数:
147
ZOJ 3182 Nine Interlinks(规律啊 )...
分类:
其他好文 时间:
2015-04-05 18:55:04
阅读次数:
139
ZOJ 3180 Number Game(数学啊 )...
分类:
其他好文 时间:
2015-04-05 18:54:18
阅读次数:
200
只有在 Month 和 Day 都为素数的时候才能得到糖那就模拟一遍时间即可.//#pragma comment(linker, "/STACK:16777216") //for c++ Compiler#include #include #include #include #include #in...
分类:
其他好文 时间:
2015-04-05 15:49:49
阅读次数:
126
Sum of Factorials
Time Limit: 1000MS
Memory Limit: 30000K
Description
John von Neumann, b. Dec. 28, 1903, d. Feb. 8, 1957, was a Hungarian-American mathematician who made important contr...
分类:
其他好文 时间:
2015-04-05 14:44:43
阅读次数:
161
题目有些人用深搜写的,当然我这弱弱的,只理解纯模拟。。。纯模拟,第一次写了那么长的代码,我自己也是够坚韧不拔的,,,,必须留念啊!!!注意,G包含C,E包含L,R包含P,(照图说O应该不包含C,但是不排除掉这种情况,就wa掉了,所以要排除O包含C的情况。。)#include#includeint n...
分类:
其他好文 时间:
2015-04-05 11:52:55
阅读次数:
168