HDU_6298 Maximum Multiple 【找规律】】的更多相关文章

一.题目 Given an integer $n$, Chiaki would like to find three positive integers $x$, $y$ and $z$ such that: $n=x+y+z$, $x\mid n$, $y \mid n$, $z \mid n$ and $xyz$ is maximum.  InputThere are multiple test cases. The first line of input contains an integ…
hdu6298 Maximum Multiple 题目传送门 题意: 给你一个整数n,从中找出可以被n整除的三个数x,y,z: 要求x+y+z=n,且x*y*z最大. 思路: 开始一看T到1e6,n也到1e6,就想到打表,可是打表就只输出最大值 没有把取的那三个数也数出来,纠结了许久. 正解就是设a=n/x,b=n/y,c=n/z; 则1/a+1/b+1/c=1; 则abc可取3,3,3:2,3,6:2,4,4 代码: #include<bits/stdc++.h> using namespa…
Given an integer nn, Chiaki would like to find three positive integers xx, yy and zzsuch that: n=x+y+zn=x+y+z, x∣nx∣n, y∣ny∣n, z∣nz∣n and xyzxyz is maximum. Input There are multiple test cases. The first line of input contains an integer TT (1≤T≤1061…
<题目链接> 题目大意: 给定数字n,让你将其分成合数相加的形式,问你最多能够将其分成几个合数相加. 解题分析: 因为要将其分成合数相加的个数最多,所以自然是尽可能地将其分成尽可能小的合数相加的形式.通过找规律,我们能够发现,所有的偶数都能够分成4和6这两个合数的组合,而所有的奇数,在减去9这个最小的奇合数后,就会变成偶数,然后就是和普通偶数一样的处理方式. 普通偶数的处理方式就是,看他能够分成几个4,如果该偶数不为4的倍数,那么就是将其中的一个4换成6.总的最大合数个数为:$n/4$ 而奇数…
题目 https://nanti.jisuanke.com/t/17118 题意 有n个点0,1,2...n-1,对于一个点对(i,j)满足i<j,那么连一条边,边权为i xor j,求0到n-1的最大流,结果取模,n<=1e18 分析 可以写个最大流对数据找规律,但没找出来…… 然后只能取分析了,首先最大流等价于最小割 明确一定,0->n-1这个要先割掉 然后我们贪心,希望有一些点割掉与0相连的边,一些点割掉与n-1相连的边 我们去观察每个点与0相连和与n-1相连的两条边权值,容易发现…
Minimum palindrome Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 260    Accepted Submission(s): 127 Problem Description Setting password is very important, especially when you have so many "in…
2014多校 第八题 1008 2014 Multi-University Training Contest 8 4952 Number Transformation Number Transformation Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/65536 K (Java/Others)Total Submission(s): 85 Accepted Submission(s): 31 Problem Descr…
Javabeans are delicious. Javaman likes to eat javabeans very much. Javaman has n boxes of javabeans. There are exactly i javabeans in the i-th box (i = 1, 2, 3,...n). Everyday Javaman chooses an integer x. He also chooses several boxes where the numb…
Nim or not Nim? Time Limit:1000MS     Memory Limit:32768KB     64bit IO Format:%I64d & %I64u Submit Status Practice HDU 3032 Description Nim is a two-player mathematic game of strategy in which players take turns removing objects from distinct heaps.…
Problem about GCD Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 470    Accepted Submission(s): 77 Problem Description Given integer m. Find multiplication of all 1<=a<=m such gcd(a, m)=1 (cop…