HDU 4814 Golden Radio Base 模拟】的更多相关文章

题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=4814 题目大意: 把一个正整数表示为φ进制, φ = (1+√5)/2 . 且已知: 1. φ + 1 = φ 2 ,所以有11(φ) = 100(φ),且要求11要转变为100 2. 2 * φ 2  = φ3 + 1 . 解题思路: 观察发现,2 = 10.01.所以对于一个数N,能够从N/2 推导得到,是一个模拟的过程.我比赛的时候居然用了高速幂... 代码: #include<cstdio>…
链接:http://acm.hdu.edu.cn/showproblem.php?pid=4814 题意:黄金比例切割点是,如今要求把一个10进制的的数转化成一个phi进制的数,而且不能出现'11'的情况. 思路:因为题目中给出了两个式子,题目就变成了一道简单的模拟题了.因为整个phi进制的数最多仅仅有200,而数据中最多仅仅有100位,所以从aa[50]=tot 開始模拟就可以. 代码: #include<iostream> #include<cstdio> #include&l…
详解见:http://blog.csdn.net/tri_integral/article/details/18666797 #include<cstdio> #include<cstring> #define maxn 105 #include<algorithm> using namespace std; int s[maxn]; int main() { int n; int tmp; while(scanf("%d",&n)!=EOF…
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=4814 进制转换. 现场根据题目给的两个公式,不断更新!!! 胡搞就可以了. 现场3A,我艹,一次循环开大TLE,一次开小WA,太逗了,呵呵 现场源码: #include <stdio.h> #include <string.h> #include <iostream> #include <algorithm> #include <queue> #in…
Description Golden ratio base (GRB) is a non-integer positional numeral system that uses the golden ratio (the irrational number (1+√5)/2 ≍ 1.61803399 symbolized by the Greek letter φ) as its base. It is sometimes referred to as base-φ, golden mean b…
HDU 4041 Eliminate Witches! (模拟题 ACM ICPC 2011 亚洲北京赛区网络赛题目) Eliminate Witches! Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others) Total Submission(s): 863    Accepted Submission(s): 342 Problem Description Kaname Mado…
Thickest Burger Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/65536 K (Java/Others)Total Submission(s): 63    Accepted Submission(s): 60 Problem Description ACM ICPC is launching a thick burger. The thickness (or the height) of a piec…
Ugly Problem Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/65536 K (Java/Others)Total Submission(s): 0    Accepted Submission(s): 0Special Judge Problem Description Everyone hates ugly problems.You are given a positive integer. You mu…
Football Games Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/65536 K (Java/Others)Total Submission(s): 802    Accepted Submission(s): 309 Problem Description A mysterious country will hold a football world championships---Abnormal Cup…
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=5504 思路:模拟 代码: #include<stdio.h>//------杭电5504 #include<algorithm> #include<math.h> #include<iostream> using namespace std; int comp(const void*a, const void*b) { return *(int*)a - *(i…