摘要:
给出N条边,问这些边能组成多少个不同的三角形,每条边的长度是不同的。首先我们先将边长按照升序排序,然后枚举两条短的边,看最长边有多少种可能,累加。#include<cstdio>#include<cstring>#include<cstdlib>#include<iostream>#include<algorithm>using namespace std;const int MAXN = 2012;int T, N;int a[MAXN];int b_s( int len){ int left = 0, right = N - 1; 阅读全文
posted @ 2012-04-23 10:49
找回失去的
阅读(355)
评论(0)
推荐(0)
浙公网安备 33010602011771号