重新开始学编程之简单数学
ZZ --瑞 hopeACMer
WA就完事了
展开
-
C - 【浅紫】特殊生成树 (Gym - 102072C )(矩阵快速幂)
将NN个点排列成一个圆形,中间放置一个点固定为根节点,问特殊生成树的种类数。特殊生成树:除根节点以外,其他节点只能与自己左右节点相连,或与根节点相连。p.s.若节点的左右节点为同一个节点,向左或向右连接视为不同的生成树。由于种类数可能过大,对1,000,000,0071,000,000,007取模。当N=3N=3时,所有生成树表示如下:Input多组数据,请输入要文件结...原创 2019-07-02 18:53:52 · 110 阅读 · 0 评论 -
K - Six Sides Gym - 101291K (概率题)
Download题目请点链接#include <iostream>#include <string.h>#include <stdio.h>using namespace std;int main(){ int i,j,k,g; double t=0.00000; int n[10],m[10]; for(i...原创 2019-07-23 14:25:52 · 278 阅读 · 0 评论 -
I - Mismatched Socks Gym - 101291I (数学题)
Download此题:如果数组中最大的袜子数比其它所有袜子数要大,那么输出其它所有袜子数的和;其它情况,那么输出全部袜子数的和的一半#include <iostream>#include <bits/stdc++.h>using namespace std;int main(){ int a,i; long long int n[1010...原创 2019-07-23 15:23:11 · 224 阅读 · 0 评论 -
B - Minimal Area Gym - 101755B (三角形叉积面积公式)
You are given a strictly convex polygon. Find the minimal possible area of non-degenerate triangle whose vertices are the vertices of the polygon.InputThe first line contains a single integern(3...原创 2019-08-06 15:15:31 · 232 阅读 · 0 评论 -
A - How many integers can you find HDU - 1796(容斥原理)
Now you get a number N, and a M-integers set, you should find out how many integers which are small than N, that they can divided exactly by any integers in the set. For example, N=12, and M-integer...原创 2019-08-21 10:23:05 · 166 阅读 · 0 评论