UVA 10689 - Yet another Number Sequence
题目链接
题意:斐波那契给前两项,求出第n项,并保留m位
思路:挺裸的矩阵快速幂,就是取模的值是10^m
代码:
#include 
#include 
const int mod[5] = {0, 10, 100, 1000, 10000};
int t, a, b, n, m;
s...
                            
                            
                                分类:
其他好文   时间:
2014-07-22 00:31:37   
                                阅读次数:
279
                             
                         
                    
                        
                            
                            
                                题目链接:http://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&page=show_problem&problem=32481391605812096The SetStack ComputerAcceptedC++0...
                            
                            
                                分类:
其他好文   时间:
2014-07-22 00:28:38   
                                阅读次数:
220
                             
                         
                    
                        
                            
                            
                                Description
I I
U P C
2 0 
06
Problem G: Going in Cycle!!
Input: standard input 
Output: standard output
  
You are given a weighted directed gra...
                            
                            
                                分类:
其他好文   时间:
2014-07-22 00:28:36   
                                阅读次数:
217
                             
                         
                    
                        
                            
                            
                                UVA 684 - Integral Determinant
题目链接
题意:给定一个行列式,求出值
思路:利用线性代数中的列相减,然后不断降阶即可,就是要用分数去写
代码:
#include 
#include 
#include 
using namespace std;
const int N = 35;
long long gcd(long long a...
                            
                            
                                分类:
其他好文   时间:
2014-07-22 00:26:37   
                                阅读次数:
207
                             
                         
                    
                        
                            
                            
                                题目链接:http://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&page=show_problem&problem=48113916935540Team QueueAcceptedC++0.3392014-07-21...
                            
                            
                                分类:
其他好文   时间:
2014-07-22 00:22:34   
                                阅读次数:
217
                             
                         
                    
                        
                            
                            
                                #include
#include
#include
#include
#include
using namespace std;
int h[20][20];
int v[20][20];
int size_[20];
int n,m;
int flag;
void judge(int x,int y)//这是关键部分的代码,用来判读那是否能构成square;
{
    int a1=n-x...
                            
                            
                                分类:
其他好文   时间:
2014-07-21 13:36:09   
                                阅读次数:
221
                             
                         
                    
                        
                            
                            
                                Description
Problem G 
Toll! Revisited 
Input: Standard Input 
Output: Standard Output
Time Limit: 1 Second
 
Sindbad the Sailor sold 66 silver spoons to the Sultan of Samarkand. The selling...
                            
                            
                                分类:
其他好文   时间:
2014-07-21 13:35:07   
                                阅读次数:
263
                             
                         
                    
                        
                            
                            
                                这道题目貌似就是在不停地用STL中的内容,对STL熟练运用的大神估计坐起来会比较easy。。
不过对于我这种看着代码还是需要上网查函数运用的菜鸟来说,若让我自己做这道题,肯定不会使用STL。。
就当对STL的学习了。
#include
#include
#include
#include
#include
#include
#include
#include
#include//set_un...
                            
                            
                                分类:
其他好文   时间:
2014-07-21 11:44:55   
                                阅读次数:
320
                             
                         
                    
                        
                            
                            
                                #include
#include
#include
#include
using namespace std;
double a[100000];
double vol[100000];
int m,n;
double v1,v2;
bool cmp(double aa,double bb)
{
    if(aa>bb) return true;
}
int main()
{
    int...
                            
                            
                                分类:
其他好文   时间:
2014-07-21 11:43:45   
                                阅读次数:
226
                             
                         
                    
                        
                            
                            
                                题目如下:
Problem D
Fill
 
There are three jugs with a volume of a, b and c liters. (a,b, and c are positive integers not greater than 200). The first and the secondjug are initially empty, wh...
                            
                            
                                分类:
其他好文   时间:
2014-07-21 11:32:15   
                                阅读次数:
253