1001.没推到题解那么细,枚举一下也可以.用通分可以避免小数精度问题. #include<iostream> #include<stdio.h> using namespace std; int main(){ int T; int n,m; int a,b,c; int i,j; bool flag; scanf("%d",&T); while(T--){ scanf("%d%d",&n,&m); //对等式通分…
jrMz and angle Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/65536 K (Java/Others) 问题描述 jrMz有两种角,第一种角都是正nn边形的内角,第二种角都是正mm边形的内角.jrMz想选出其中一些,某种角可以选多个或一个都不选,使得选出的所有角的度数之和恰好为360度.jrMz想知道这是否可能实现. 输入描述 有多组测试数据,第一行一个整数\left(1\leq T\leq10…
Baby Ming and Weight lifting Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/65536 K (Java/Others)Total Submission(s): 681 Accepted Submission(s): 280 Problem Description Baby Ming is fond of weight lifting. He has a barbell pole(the…
tree Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/65536 K (Java/Others)Total Submission(s): 863 Accepted Submission(s): 409 Problem Description There is a tree(the tree is a connected graph which contains n points and n−1 edges),t…
HDOJ5054 Alice and Bob Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others) Total Submission(s): 302 Accepted Submission(s): 229 Problem Description Bob and Alice got separated in the Square, they agreed that if they…
Rikka with Phi Accepts: 5 Submissions: 66 Time Limit: 16000/8000 MS (Java/Others) Memory Limit: 131072/131072 K (Java/Others) Problem Description Rikka and Yuta are interested in Phi function (which is known as Euler's totient function). Yuta giv…
Rikka with Graph Accepts: 123 Submissions: 525 Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/65536 K (Java/Others) 问题描述 众所周知,萌萌哒六花不擅长数学,所以勇太给了她一些数学问题做练习,其中有一道是这样的: 给出一张 nn 个点 n+1n+1 条边的无向图,你可以选择一些边(至少一条)删除. 现在勇太想知道有多少种方案使得删除之后图依然联通.…