
水题
水题
kelianlee
这个作者很懒,什么都没留下…
展开
-
Xu Xiake in Henan Province Gym - 102028A
简单题今天模拟了焦作场我们a了6道49名,,,距离金牌20名,,感觉好难啊,哎。但是看了wls的视频感觉不管怎么样都要努力走下去啊,#include <iostream>#include <map>using namespace std;map<int,string> mp;int main(){ int n; mp[0...原创 2019-03-15 19:00:34 · 327 阅读 · 0 评论 -
Box UVA - 1587
规律#include <iostream>#include <cstdio>#include <algorithm>using namespace std;struct node{ int a,b;};node num[10];bool cmp(node &x,node &y){ if(x.a==y...原创 2018-11-15 13:38:25 · 134 阅读 · 0 评论 -
Circular Sequence UVA - 1584
6#include <iostream>#include <string>#include <algorithm>using namespace std;int main(){ int n; cin>>n; string s,ss[111]; while(n--) { s.c...原创 2018-11-08 16:54:29 · 100 阅读 · 0 评论 -
Digit Generator UVA - 1583
5#include <iostream>#include <cstdio>using namespace std;int main(){ int m; cin>>m; while(m--) { int n; cin>>n; int fg=0; ...原创 2018-11-08 16:12:59 · 90 阅读 · 0 评论 -
Master-Mind Hints UVA - 340
#include <iostream>#include <cstdio>#include <map>using namespace std;map<int ,int > mp;int main(){ int n; int num[1111]; int num2[1111]; int sum=1;...原创 2018-11-08 15:13:46 · 134 阅读 · 0 评论 -
Repeating Decimals UVA - 202
300题,,700加油紫薯13在慢慢改变自己的代码风格,自己总是会考虑很多但是队友说的对我不需要考虑那么多应该学会什么是需要特判什么是可以归类在一起的#include <iostream>#include <map>#include<string.h>#include<cstdio>using namespace std;...原创 2018-11-13 11:54:52 · 145 阅读 · 0 评论 -
Palindromes UVA - 401
紫薯-3读懂题意就可以#include <iostream>#include <map>#include <cstdio>#include <cstring>using namespace std;map<char,char> mp;char str[11111];int main(){ mp['A...原创 2018-11-07 21:59:26 · 706 阅读 · 0 评论 -
WERTYU UVA - 10082
紫薯-2#include <iostream>#include <map>#include <cstdio>using namespace std;char str[]="`1234567890-=QWERTYUIOP[]\\ASDFGHJKL;\'ZXCVBNM,./";map <char,char> mp;char s[...原创 2018-11-07 17:11:34 · 147 阅读 · 0 评论 -
TEX Quotes UVA - 272
紫薯训练-1字符串转换#include<iostream>#include <cstdio>using namespace std;int main(){ char c; int cont=0; while(scanf("%c",&c)!=EOF) { if(c=='"') {...原创 2018-11-07 16:33:14 · 154 阅读 · 0 评论 -
ZOJ Problem Set - 4067 Books
#include <iostream>#include <algorithm>#include <cstdio>using namespace std;long long num[111111];int main(){ int T; cin>>T; while(T--) { int...原创 2018-11-07 16:23:46 · 385 阅读 · 0 评论 -
Periodic Strings UVA - 455
简单模拟记得初始化#include <iostream>#include <string>using namespace std;int main(){ string str; int n; cin>>n; //getchar(); while(n--) { int fgg=0...原创 2018-11-09 18:24:54 · 153 阅读 · 0 评论 -
Molar mass UVA - 1586
9简单模拟#include <iostream>#include <map>#include <cstdio>#include <cstdlib>#include <cstring>using namespace std;map<char,double> mp;char str[1111];i...原创 2018-11-09 11:05:33 · 217 阅读 · 0 评论 -
Digit Counting UVA - 1225
8主义mapclear细节#include <iostream>#include <map>#include <cstdio>using namespace std;map<int,int> mp;int main(){ int n; cin>>n; while(n--) {...原创 2018-11-09 11:04:57 · 73 阅读 · 0 评论 -
Score UVA - 1585
7注意初始化#include <iostream>#include <cstdio>#include <cstdlib>#include <cstring>using namespace std;char str[1111];int main(){ int n; cin>>n; getc...原创 2018-11-09 09:25:41 · 123 阅读 · 0 评论 -
Monthly Expense POJ - 3273 最大值最小化 类似二分
#include <iostream>#include <cstdio>using namespace std;const int maxn=111111;int a[maxn];int n,m;bool judge(int mid){ int st=0; int cont=0; for(int i=0;i<n;i++) ...原创 2018-09-13 19:37:43 · 161 阅读 · 0 评论 -
Line belt HDU - 3400嵌套三分
嵌套三分#include <iostream>#include <cmath>#include <cstdio>#include <algorithm>using namespace std;const double eps=1e-9;struct Point{ double x,y; Point(){} ...原创 2018-09-13 19:10:42 · 141 阅读 · 0 评论 -
Crossword Answers UVA - 232
紫薯11看清楚题目意思简单模拟注意初始化以及格式#include <iostream>#include <stdlib.h>#include <string.h>#include <cstdio>using namespace std;int main(){ int n,m; char str[20][20];...原创 2018-11-12 14:40:49 · 94 阅读 · 0 评论 -
DNA Consensus String UVA - 1368
12找出每一列最多一个原创 2018-11-12 15:05:28 · 123 阅读 · 0 评论 -
Ancient Cipher UVA - 1339
学习别人!!!#include <iostream>#include <vector>#include <algorithm>using namespace std;int main(){ string str1,str2; while(cin>>str1>>str2) { ...原创 2018-11-19 00:21:37 · 110 阅读 · 0 评论 -
相等长度01串与01序列
前缀和#include <cstdio>#include <algorithm>#include <iostream>using namespace std;#define MAXNUM 111111#define rep(i,s,t) for(int i=s;i<t;i++)#define pii pair<int,int>...原创 2019-07-26 13:39:54 · 296 阅读 · 0 评论 -
Can you raed it croretcly? HDU - 6543
#include <iostream>#include <set>#include <map>#include <cstring>using namespace std;set<char> st1,st2;map<char,int> mp1,mp2;int main(){ char str1[22...原创 2019-05-26 15:57:46 · 268 阅读 · 0 评论 -
Hello XTCPC HDU - 6536
队列处理#include <iostream>#include <queue>#include <cstring>#include <cstdio>using namespace std;queue<int> j,s,C,p,c;const int MAXN=2e5+10;char str[MAXN];int...原创 2019-05-26 15:41:52 · 598 阅读 · 0 评论 -
Vova and Trophies CodeForces - 1082B 思维
感觉自己的方法很麻烦但是也是自己思考的结果所以分享一下题目大意就是交换一个S和G使得连续的G的个数最大思路:将S与G分别存在数组a,b中,把连续G的下一个连续S的坐标相同,然后遍历所有的G判断下一个S是一个还是多个,如果是一个S那么可以从前面或者后面拿一个S与之交换如果是多个就是说可以前后两个G互相交换然后在对特殊的位置特判#include <iostream>#i...原创 2018-12-07 11:12:24 · 156 阅读 · 0 评论 -
Ducci Sequence UVA - 1594
简单stl运用,只要对mp做标记如果出现过那么肯定是循环,记得初始化#include <iostream>#include <map>#include <vector>#include <cmath>using namespace std;map<vector<int>,int> mp;vector<...原创 2018-12-03 19:38:02 · 127 阅读 · 0 评论 -
The Blocks Problem UVA - 101
简单模拟一个字符”noto“写错找了半小时 哎#include <iostream>#include <vector>#include <string>#include <cstdio>using namespace std;vector<int> vt[30];int main(){ int n; ...原创 2018-11-27 01:10:20 · 178 阅读 · 0 评论 -
Flooded! UVA - 815 二分
怎么说呢,果然题目做多了思路也就多了,看到这一题,马上想到2分水的体积,写了一下wa了错在少考虑了负数的情况所以改了一下二分搜素的上下界就a掉了#include <iostream>#include <cmath>#include <algorithm>using namespace std;const double eps=1e-8;i...原创 2018-11-26 19:36:36 · 153 阅读 · 0 评论 -
Ananagrams UVA - 156
map解决,把每个单词排序然后把原来的单词跟排序后的单词做映射,在对排序后的单词与数量做映射#include <iostream>#include <map>#include <algorithm>#include <vector>using namespace std;map<string,string> mp;...原创 2018-11-29 14:32:31 · 140 阅读 · 0 评论 -
Extraordinarily Tired Students UVA - 12108
简单模拟特别困的学生,此刻我也挺困的昨晚写到1点多没过早上起来看了一下代码发现一个地方写错了,果然太晚的话自己的脑子思考的很差啊,我是这样的做的弄一个结构体,里面存睡觉时间,清醒时间,状态(0是清醒,1是睡觉)时间(t1表示还能清醒几分钟,t2表示还能睡几分钟)只要对时间做减然后特判时间为0的时候就可以#include <iostream>using namespace ...原创 2018-11-26 12:56:28 · 144 阅读 · 0 评论 -
Morse Mismatches UVA - 508
字符串匹配#include <iostream>#include <map>#include <string>using namespace std;map<char,string>mp1;map<string,string>mp2;int main(){ char s; string str;...原创 2018-11-25 20:44:28 · 177 阅读 · 0 评论 -
螺旋矩阵
暴力模拟填数字#include <iostream>#include <cstring>#include <cstdlib>#include <cstdio>using namespace std;int main(){ int n; int map[30][30]; int num[30][30]; ...原创 2018-11-19 20:33:36 · 146 阅读 · 0 评论 -
Othello UVA - 220
过了udebug的所有数据以及各种数据但是就是wa不知道为什么 哎只能先放着了 以后再来写写看把#include <iostream>#include <cstring>#include <cstdlib>#include <cstdio>#include <algorithm>using namespace std...原创 2018-11-23 20:52:54 · 226 阅读 · 0 评论 -
The Dole Queue UVA - 133
简单模拟主要这个输出有点蛋疼自己代码太丑#include <iostream>#include <cstdlib>#include <cstring>#include <cstdio>using namespace std;int main(){ int n,k,m; int num[111]; in...原创 2018-11-19 14:36:26 · 88 阅读 · 0 评论 -
Xiangqi UVA - 1589
终于a掉了很痛苦自己代码写得也很臭300多行大模拟我的思路:用两个二维数组分别为a,b,a用来表示地图上的落子,b表示能够被杀死的点,把所以的能杀死的点找出来后,对将军进行上下左右四个方向进行判断是不是都是被标记的点,如果存在没有被标记的点那么就没有将死标记方法:红帅从该点x坐标开始递减对所有没有标记的点做杀死标记直到碰到一个点是有落子的点,如果是将军就停止说明将军与帅碰面将军赢,...原创 2018-11-21 19:25:07 · 195 阅读 · 0 评论 -
Kickdown UVA - 1588
又愚蠢了自己代码写的臭那我就给个数据把212222222221#include <iostream>#include <cstdio>#include <cstring>#include <algorithm>using namespace std;int main(){ char str1[11...原创 2018-11-16 15:43:02 · 140 阅读 · 0 评论 -
Error Curves HDU - 3714 三分
#include <iostream>#include <cmath>#include <cstdio>#include <algorithm>using namespace std;int a[11111],b[11111],c[11111];const double eps=1e-9;int sgn(double x){...原创 2018-09-10 20:59:21 · 127 阅读 · 0 评论 -
Party All the Time HDU - 4355 三分
#include <iostream>#include <cmath>#include <cstdio>#include <algorithm>using namespace std;const double eps=1e-5;int sgn(double x){ if(fabs(x)<eps) re...原创 2018-09-10 20:33:54 · 174 阅读 · 0 评论 -
hdu 2084
自己用dfs写了一下wa了不知道为什么#include <iostream>#include <cstdio>#include <string.h>using namespace std;int max1;int m;int curnum;int map[105][105]={0};int cont1[105][105]={0};void d...原创 2018-06-18 23:38:02 · 141 阅读 · 0 评论 -
poj 2485 prim最小生成树
裸最小生成树,结果还是出现了几个问题!!!首先 v数组在初始化的时候要设成最大值,其次要对每一个访问过的点visited更新,#include <iostream>#include <limits>#include <limits.h>#include <stdio.h>using namespace std;const int MAXN...原创 2018-06-21 23:17:13 · 151 阅读 · 0 评论 -
二分查找
二分查找注意的地方在于避免死循环,所以我们用left=mid+1,和right=mid-1来避免死循环,而且复杂度为longn原创 2018-06-06 19:24:55 · 124 阅读 · 0 评论 -
hdu 1999 不可摸数
别人的代码写的很好先记录一下#pragma warning(disable:4996) #include <iostream>#include <cstring>#include <string>#include <map>#include <queue>#include <algorithm>using nam...转载 2018-06-13 17:46:31 · 117 阅读 · 0 评论