
UVA
KLFTESPACE
这个作者很懒,什么都没留下…
展开
-
Financial Management POJ1004, ZOJ 1048, UVA2362
点击打开链接 POJ1004Larry graduated this year and finally has a job. He's making a lot of money, but somehow never seems to have enough. Larry has decided that he needs to grab hold of his financial portfol...原创 2018-04-24 10:39:20 · 236 阅读 · 0 评论 -
Parentheses Balance UVA - 673
//刚开始觉得这道题挺简单的....结果一直总是处理不完结果是No 的数据..(没输出) 。。。。后来发现stack的empty也得加上,不能直接判断栈顶元素与此时数组元素相等,将错误的附在第二个代码上//AC#include<iostream>#include<stack>#include<string>using namespace std...原创 2018-12-05 09:22:06 · 141 阅读 · 0 评论 -
Argus UVA - 1203
//结构体构造函数...要写的话两个都得写上,不然Node a;会出问题.....//重载运算符优先队列里>是从小到大排列//也可以写成这样....会减少一点语句执行次数 bool operator < (const Node& C) const{ return t > C.t || (t == C.t && num &...原创 2018-12-07 23:19:10 · 206 阅读 · 0 评论 -
Is It A Tree? UVA - 615
#include <iostream>#include <cstdio>using namespace std;const int MAXN = 100000;int v[MAXN+1];bool visited[MAXN+1];int length = MAXN;bool nocircleflag; // 判断是否成环int edgec...原创 2018-12-08 21:56:41 · 225 阅读 · 0 评论 -
Concurrency Simulator UVA - 210
#include <iostream>#include <cstdio>#include <deque>#include <queue>#include <cstring>#include <cstring>#include <algorithm>using namespace std;原创 2018-12-03 20:45:44 · 155 阅读 · 0 评论 -
Rails UVA - 514
#include <iostream>#include <stack>#include <cstdio>using namespace std;const int N = 1000;int target[N];stack<int> s;int n;int Judge(){ int head = 0, num ...原创 2018-12-03 21:14:49 · 130 阅读 · 0 评论 -
Yet another Number Sequence UVA10689
/*矩阵快速幂*/#include<iostream>#include<cstdio>#include<cstring>#include<cmath>#include<algorithm>using namespace std;//const int mod = 10000;const int maxn = 3...原创 2019-02-23 17:37:57 · 176 阅读 · 0 评论 -
How Many Answers Are Wrong
//在查询的时候 ,想dist在前面,递归在后面,WA,发现dist应该是从根部到叶子相加赋值,而不是叶子+父节点倒着到根。#include<iostream>#include<cstdio>#include<algorithm>using namespace std;const int N = 200000+5;int pre[N], d...原创 2019-02-18 21:46:59 · 124 阅读 · 0 评论 -
Division (DFS)UVA725
我用DFS解了一下这个题,直接暴力也可以,不过我想练练DFS然后,,本来应该挺简单的,结果tmp/=10这处位置写错了,一直WA,,然后,,,调了好久,才找出来。还有就是PE,,格式也有要求........//思路:每位由0-9进行遍历,判断是否使用过,如未用,选择下一位的数。数位够5以后,计算tmp#include <iostream>#include <c...原创 2019-02-24 17:39:51 · 210 阅读 · 0 评论 -
Modular Fibonacci
刚开始TLE以为是 矩阵相乘超时,改了发现还有错,然后....今天在看的时候发现有一种n == 0的情况,改了以后不TLE,改成WA了,然后....就将int变为longlong。AC/*矩阵快速幂*/#include<iostream>#include<cstdio>#include<cstring>#include<cmath>...原创 2019-02-25 09:11:39 · 152 阅读 · 0 评论 -
Bridge UVA-10037(WA)
类似Crossing River POJ-1700 不过还需要输出策略.....然后 可能有多种策略 WA了》。。。还不明白哪错了//WA(二)#include<iostream>#include<algorithm>using namespace std;int main(){ int T, n; cin >> T; ...原创 2019-03-24 22:30:56 · 189 阅读 · 0 评论 -
ACM Contest and Blackout UVA - 10600
//在init的时候 我传了N进去....WA 传了n AC了..............#include <cstdio>#include <iostream>#include <algorithm>#include <cstring>#include <string>#include <stdlib....原创 2019-08-07 12:35:08 · 165 阅读 · 0 评论 -
Is There A Second Way Left? UVA - 10462 (WA)
//WA了。。。。看不出来哪错了,先留个底....以后再看能不能找出来#include <cstdio>#include <iostream>#include <algorithm>#include <cstring>#include <string>#include <stdlib.h>#include ...原创 2019-08-07 13:06:05 · 152 阅读 · 0 评论 -
UVA - 11183 Teen Girl Squad(最小树形图)朱刘算法
//https://blog.youkuaiyun.com/qq_38367681/article/details/81302389 对比 #include <cstdio>#include <iostream>#include <algorithm>#include <cstring>#include <string>#includ...原创 2019-08-07 21:44:34 · 244 阅读 · 0 评论 -
Network UVA - 315
//两种方法求割点个数....//Findcut里是否为根节点刚开始直接忽略了....导致找了好久的bug....看了别人的博文才知道还要判断是否为根结点.......好歹解决了...还有就是vis标记和Dfn的问题...得在刚开始就标记或赋值...不然WA#include<iostream>#include <vector>#include &...原创 2019-08-10 19:11:24 · 118 阅读 · 0 评论 -
Immediate Decodability UVA - 644
//有两个问题,第一个:Trie root 和Trie *root,要选*root.... root只能有第一个输出,然后就结束了...目前还不知道为啥,第二个就是DelTrie完以后要给root动态分配内存...要不然也会和第一个问题一样.......#include <iostream>#include <string.h>#include <...原创 2018-12-02 19:46:02 · 184 阅读 · 0 评论 -
Ugly Numbers UVA136 POJ1338
Ugly numbers are numbers whose only prime factors are 2, 3 or 5. The sequence 1, 2, 3, 4, 5, 6, 8, 9, 10, 12, 15, ... shows the first 11 ugly numbers. By convention, 1 is included. Write a program to ...原创 2018-09-29 22:48:39 · 219 阅读 · 0 评论 -
Doubles POJ 1552, ZOJ 1760, UVA 2787.
点击打开链接As part of an arithmetic competency program, your students will be given randomly generated lists of from 2 to 15 unique positive integers and asked to determine how many items in each list are ...原创 2018-04-24 11:01:52 · 509 阅读 · 0 评论 -
Sum of Consecutive Prime Numbers POJ 2739, UVA 3399
Some positive integers can be represented by a sum of one or more consecutive prime numbers. How many such representations does a given positive integer have? For example, the integer 53 has two repre...原创 2018-05-09 21:20:46 · 269 阅读 · 0 评论 -
I Think I Need a Houseboat POJ - 1005, ZOJ 1049, UVA 2363
Fred Mapper is considering purchasing some land in Louisiana to build his house on. In the process of investigating the land, he learned that the state of Louisiana is actually shrinking by 50 square ...原创 2018-05-09 22:12:23 · 308 阅读 · 0 评论 -
Self Numbers POJ - 1316 ZOJ 1180 UVA640
In 1949 the Indian mathematician D.R. Kaprekar discovered a class of numbers called self-numbers. For any positive integer n, define d(n) to be n plus the sum of the digits of n. (The d stands for dig...原创 2018-10-01 10:37:50 · 235 阅读 · 0 评论 -
Bee UVA - 11000
In Africa there is a very special species of bee. Every year, the female bees of such species give birth to one male bee, while the male bees give birth to one male bee and one female bee, and then th...原创 2018-10-01 10:42:10 · 210 阅读 · 0 评论 -
Gold Coins POJ - 2000 ZOJ2345 UVA 3045
The king pays his loyal knight in gold coins. On the first day of his service, the knight receives one gold coin. On each of the next two days (the second and third days of service), the knight receiv...原创 2018-10-01 10:47:31 · 280 阅读 · 0 评论 -
The 3n + 1 problem POJ - 1207 UVA100
Problems in Computer Science are often classified as belonging to a certain class of problems (e.g., NP, Unsolvable, Recursive). In this problem you will be analyzing a property of an algorithm whose ...原创 2018-10-08 21:04:16 · 223 阅读 · 0 评论 -
The 3n + 1 problem POJ - 1207 UVA3470
Pascal University, one of the oldest in the country, needs to renovate its Library Building, because after all these centuries the building started to show the effects of supporting the weight of the ...原创 2018-10-08 21:04:01 · 190 阅读 · 0 评论 -
The Sultan's Successors UVA - 167
//很久以前做的了,当时WA,一直没找到错误...然后今天看了下。。。发现就是每次开始新一轮年的时候没哟初始化.......The Sultan of Nubia has no children, so she has decided that the country will be split into up to k separate parts on her death and each...原创 2018-10-11 09:49:22 · 203 阅读 · 0 评论 -
Hangover POJ - 1003 UVA 2294
How far can you make a stack of cards overhang a table? If you have one card, you can create a maximum overhang of half a card length. (We're assuming that the cards must be perpendicular to the table...原创 2018-09-28 20:27:51 · 208 阅读 · 0 评论 -
Specialized Four-Digit Numbers POJ 2196 ZOJ 2405 UVA 3199
Find and list all four-digit numbers in decimal notation that have the property that the sum of its four digits equals the sum of its digits when represented in hexadecimal (base 16) notation and also...原创 2018-09-28 20:26:12 · 221 阅读 · 0 评论 -
Quicksum POJ 3094 ZOJ 2812 UVA 3594
A checksum is an algorithm that scans a packet of data and returns a single number. The idea is that if the packet is changed, the checksum will also change, so checksums are often used for detecting ...原创 2018-09-28 20:25:59 · 283 阅读 · 0 评论 -
8 Queens Chess Problem UVA - 750 (很久之前WA,,然后 现在改了一点之后 PE,,又改了一会A了)
PEIn chess it is possible to place eight queens on the board so that no one queen can be taken by any other. Write a program that will determine all such possible arrangements for eight queens given t...原创 2018-10-12 22:08:32 · 391 阅读 · 0 评论 -
A Contesting Decision POJ 1581 ZOJ 1764 UVA 2832
Judging a programming contest is hard work, with demanding contestants, tedious decisions,and monotonous work. Not to mention the nutritional problems of spending 12 hours with only donuts, pizza, and...原创 2018-09-29 22:49:15 · 365 阅读 · 0 评论 -
Critical Links UVA - 796
//。。刚开始用>=判断割边...一直多一个1-2,看了网上博文发现只是>就可以了。。还有就是割边存储,....不知道我用vector<int>哪错了...样例能过...但是。。WA,,,,然后就用vector<pair<int, int> >了..........但是还是不知道刚开始为啥WA了...#include<iostream&g...原创 2019-08-10 21:59:07 · 163 阅读 · 0 评论