Ural Problems
AlgorithmForge
Hello, welcome to my world:)
展开
-
URAL 1022. Genealogical tree
Problem url: http://acm.timus.ru/problem.aspx?space=1&num=1022This is a typical problem that uses topological sorting. At first I misunderstood it as a normal internal sorting issue and got wrong th原创 2007-11-04 20:54:00 · 724 阅读 · 0 评论 -
URAL 1083. Factorials!!!
A simple math question, just scrab a simple answer:#include cstdio>#include iostream>using namespace std;int N = 0;int K = 0;long long result = 0;void main(){ scanf("%d", &N); getchar();原创 2007-11-04 22:05:00 · 790 阅读 · 0 评论 -
URAL 1079. Maximum
problem url: http://acm.timus.ru/problem.aspx?space=1&num=1079this should be a mathematics question. So far I got two answers. MY own is using static array to cache all the sequence elements while原创 2007-11-04 22:01:00 · 708 阅读 · 0 评论 -
URAL 1068. Sum
problem url: http://acm.timus.ru/problem.aspx?space=1&num=1068this is a simple math calculation question:#some one only use one-line code to compute the result#include cstdio>#include iostrea原创 2007-11-04 21:53:00 · 613 阅读 · 0 评论 -
URAL 1028. Stars
problem url: http://acm.timus.ru/problem.aspx?space=1&num=1028Got two methods here. One uses hash table which will give you O(Nsqrt(N)) , another uses segment tree(binary search..) which gives you原创 2007-11-04 21:39:00 · 885 阅读 · 0 评论 -
URAL 1026. Questions and answers
problem url: http://acm.timus.ru/problem.aspx?space=1&num=1026At first, I assumed this is a sorting question and spent much time on sorting the input record list(Ive tried both BST and BBST(AVL))原创 2007-11-04 21:18:00 · 689 阅读 · 0 评论 -
URAL 1025. Democracy in danger
problem url: http://acm.timus.ru/problem.aspx?space=1&num=1025this should be a sorting question, I used tried using binary sort tree to sort the given vote group serials and print the least half(+1)原创 2007-11-04 21:06:00 · 680 阅读 · 0 评论 -
URAL 1001. Reverse root
problem url: http://acm.timus.ru/problem.aspx?space=1&num=1001 Use static Array to hold all the square root values and print them all: the AC result is not so good: 0.42s and 12xxKB, maybe I sho原创 2007-11-04 20:44:00 · 975 阅读 · 1 评论 -
URAL 1044. Lucky tickets. Easy!
problem url: http://acm.timus.ru/problem.aspx?space=1&num=1044This issue require some math trick, we shoud use "Permutations" here: #include cstdio>#include iostream>#define MAX_SUM 36using n原创 2007-11-04 21:46:00 · 774 阅读 · 0 评论 -
URAL 1015. Test the Difference!
Problem Url: http://acm.timus.ru/problem.aspx?space=1&num=1015This is a math related problem. First well need to determine the total possible scheme of dices, therere 30 schemes. To calculate this原创 2007-11-20 17:51:00 · 777 阅读 · 0 评论