
基础算法
文章平均质量分 85
akxxsb
写写博客装装逼,存代码
展开
-
UVA 409 Excuse
虽然不难,但感觉挺不错,值得一做的字符串题原创 2014-02-18 03:31:21 · 974 阅读 · 0 评论 -
LA 3029(悬线法)
City GameTime Limit: 3000msMemory Limit: 131072KBThis problem will be judged on UVALive. Original ID: 302964-bit integer IO format: %lld Java class name: MainPrev Submit Statu原创 2015-11-26 11:24:11 · 687 阅读 · 0 评论 -
快排存档
好久没敲快排了,今天搞了半天居然不会,先存档再说,rtvoid quicksort(int *A, int low, int high){ int m=A[low]; int r=high,l=low; while(l<r) { while(A[l]<m)l++; while(A[r]>m)r--; if(l<=r){ int t=A[l];原创 2014-04-24 21:50:53 · 1526 阅读 · 1 评论 -
第k大的数(快速排序的划分过程)
瑶瑶的第K大Time Limit: 10000/5000MS (Java/Others)Memory Limit: 512000/256000KB (Java/Others)SubmitStatisticNext ProblemProblem Description一天,萌萌的妹子--瑶瑶(tsyao)很无聊,就来找你玩。可是你们都不知道玩什么。。。尴尬了一阵子原创 2014-09-12 17:48:18 · 1673 阅读 · 2 评论 -
UVA 540(队列)
Description Team Queue Queues and Priority Queues are data structures which are known to most computer scientists. The Team Queue, however, is not so well known, though原创 2014-05-29 17:45:18 · 1283 阅读 · 0 评论 -
LIGHTOJ 1005
A - LIGHTOJ 1005Time Limit:1000MS Memory Limit:32768KB 64bit IO Format:%lld & %lluSubmit StatusDescriptionA rook is a piece used in the game of chess which is played on a board原创 2014-03-26 19:19:40 · 1174 阅读 · 0 评论 -
LIGHTOJ 1027
应该是概率的题,还有最大公约数约分的问题。E - LIGHTOJ 1027Time Limit:2000MS Memory Limit:32768KB 64bit IO Format:%lld & %lluSubmit StatusDescriptionYou are in a maze; seeing n doors in fr原创 2014-03-26 20:10:39 · 1223 阅读 · 0 评论 -
UVA 10474 - Where is the Marble?
#include #include #include #define max 10001int a[max],b[max];void search(int num,int N){ int low=1,high=N,mid; int ok=0; mid=(low+high)/2; while(low<high) { if(a[mid原创 2014-03-26 00:49:13 · 1466 阅读 · 0 评论 -
UVA 10420 - List of Conquests
本题注意要查找一下输入的人的国家是否已经出现Problem BList of ConquestsInput: standard inputOutput: standard outputTime Limit: 2 secondsIn Act I, Leporello is telling Donna Elvira about his master's long list原创 2014-03-24 00:33:55 · 1591 阅读 · 0 评论 -
UVA 10115 Automatic Editing
字符串处理题,需要注意的是要一直替换到没有所给的字符串为止,所以可以在change函数里返回1(代表查找成功)和0(代表没有要替换的字符了)Problem E: Automatic EditingSource file:autoedit.{c, cpp, java, pas}Input file:autoedit.inOutput fil原创 2014-03-23 23:56:22 · 1346 阅读 · 0 评论 -
湘潭大学第八届程序设计竞赛B题
本题要注意测试数据相当的多啊,所以要先构造出所有解并排序,然后用二分查找即可Bob's ProblemAccepted : 29 Submit : 193Time Limit : 1000 MS Memory Limit : 65536 KB 题目描述Bob今天碰到一个问题,他想原创 2014-03-15 19:44:23 · 1393 阅读 · 0 评论 -
第八届湘潭大学程序设计比赛A题
A Love LetterAccepted : 33 Submit : 66Time Limit : 1000 MS Memory Limit : 65536 KB 题目描述 CodeMonkey终于下定决心用情书的方式向心爱的女神表白,当他历经几天几夜写完之后才知道女神有很多不喜欢的词,所以他不得不有把原创 2014-03-15 20:07:22 · 1695 阅读 · 0 评论 -
哈理工校赛1C题
C.长长长长龙Time Limit: 3000 MSMemory Limit: 32768 KTotal Submit: 202 (73 users)Total Accepted: 50 (46 users)Special Judge: NoDescription时间:今天是原创 2014-03-09 23:33:24 · 1318 阅读 · 0 评论 -
UVA 748(求幂)
需要注意对小数点的处理#include#include#include#include#define MAX 600#define LL strlenvoid jia(const char *str1,char *str)//add str1 to str{ int len1=LL(str1); int c=0;len1--; for(int i=MAX原创 2014-03-04 17:32:35 · 1166 阅读 · 0 评论 -
uva 465
要说的都在注释里#include#include#define MAX 10010#define LL strlenchar INT_MAX[15]="2147483648";int judge(char *str){ int len=LL(str),ok=LL(INT_MAX); if(len<ok)return 0; if(len==ok&&strcmp(INT_原创 2014-03-02 19:35:15 · 1176 阅读 · 0 评论 -
UVA 10106高精度乘法
#include#define Max 300#includechar str1[Max],str2[Max];int s[2*Max],c[2*Max];void jia(int *a,int n){ int c=0,ans=0; for(int i=0;i<=n;i++) { s[ans]+=a[i]+c; c=s[ans]/10原创 2014-03-01 10:46:22 · 901 阅读 · 0 评论 -
LA 3695 Distant Galaxy(扫描线)
Distant GalaxyTime Limit: 3000msMemory Limit: 131072KBThis problem will be judged on UVALive. Original ID: 369564-bit integer IO format: %lld Java class name: MainPrev Submit原创 2015-11-26 11:58:03 · 944 阅读 · 0 评论