随笔分类 -  UVa题解

上一页 1 2 3 下一页

UVa-1593 - Alignment of Code
摘要:这几天一直在刷《算法竞赛入门经典》,由于是STL章节,所以这篇和下面的几篇都用STL来写。 1 #include 2 #include 3 #include 4 #include 5 #include 6 #include 7 #include 8 using namespace std; 9 co... 阅读全文

posted @ 2015-07-17 01:28 windrises 阅读(301) 评论(0) 推荐(0)

UVa-156 - Ananagrams
摘要:还是抄袭。 前面的那个妹纸一直在画工图,都连续画好几小时了,非常认真。 衣服和我的很像,看背景挺喜欢的。#include#include#include#include#includeusing namespace std;vector words;map cnt;string repr(strin... 阅读全文

posted @ 2015-04-01 21:30 windrises 阅读(114) 评论(0) 推荐(0)

UVa-10815 - Andy's First Dictionary
摘要:算是抄袭代码#include#include#include#includeusing namespace std;set dict;int main(){ string s,buf; while(cin>>s) { int l=s.size(); fo... 阅读全文

posted @ 2015-04-01 21:27 windrises 阅读(133) 评论(0) 推荐(0)

UVa-129 - Krypton Factor
摘要:第一次亲自发现原来包含头文件也需要时间=。=#include#includeint a[85],n,l,cnt;bool judge(int cur){ for(int i=1,j;i=cur-i+1;j--) if(a[j]!=a[j-i]) break; ... 阅读全文

posted @ 2015-04-01 01:56 windrises 阅读(142) 评论(0) 推荐(0)

UVa-524 - Prime Ring Problem
摘要:好久没有刷UVa了,没想到居然一次AC,代码几乎与rujia没有什么太大的区别 1 #include 2 #include 3 #include 4 using namespace std; 5 int a[20],n,cnt; 6 bool isprime(int m) 7 { 8 for... 阅读全文

posted @ 2015-03-30 23:30 windrises 阅读(157) 评论(0) 推荐(0)

UVa-253 - Cube painting
摘要:水题一道。#includeusing namespace std;int main(){ char a[15]={}; while(cin>>a+1) { int i,j; for(i=7;i<=9;i++) { fo... 阅读全文

posted @ 2015-03-05 04:34 windrises 阅读(139) 评论(1) 推荐(0)

UVa-220 Othello
摘要:以前做的题,写的极丑,肯定可以优化,但是做过的题不想再看了,直接粘代码。#include#include#include#includeusing namespace std;bool judge(int x,int y,char b,char d);void m(int x,int y,char ... 阅读全文

posted @ 2015-03-05 01:47 windrises 阅读(201) 评论(0) 推荐(0)

UVa-201 Squares
摘要:以前做的题,写的丑,肯定可以优化,但是做过的题不想再看了,直接粘代码。#include#include#include#includeusing namespace std;bool fuc(int x,int y,int i);int h[20][20]={},v[20][20]={};int m... 阅读全文

posted @ 2015-03-05 01:46 windrises 阅读(178) 评论(0) 推荐(0)

UVA-1589 Xiangqi
摘要:以前做的题,写的丑,肯定可以优化,但是做过的题不想再看了,直接粘代码。#include#include#include#includeusing namespace std;int f[11][10]={},ri[41]={},rj[41]={};int num,bi,bj;char c[41]={... 阅读全文

posted @ 2015-03-05 01:44 windrises 阅读(184) 评论(0) 推荐(0)

UVa-213 Message Decoding
摘要:难题!又是借鉴了rujia的代码。看了好几遍,凭记忆和理解手打的居然一次AC。#include#include#includeusing namespace std;char code[8][1<<8];bool readcode(){ memset(code,0,sizeof(code));... 阅读全文

posted @ 2015-03-05 00:08 windrises 阅读(204) 评论(0) 推荐(0)

UVa-133 The Dole Queue
摘要:基本上完全借鉴了rujia的代码。#include#include#includeusing namespace std;int n,k,m,a[25];int go(int p,int cnt,int q){ while(cnt--) { do { ... 阅读全文

posted @ 2015-03-05 00:05 windrises 阅读(123) 评论(0) 推荐(0)

UVa-489 - Hangman Judge
摘要:#include#includeusing namespace std;int main(){ int n; while(cin>>n&&n!=-1) { string a,b; cin>>a>>b; int la=a.size(),lb=... 阅读全文

posted @ 2015-03-03 15:21 windrises 阅读(98) 评论(0) 推荐(0)

UVa-1339 - Ancient Cipher
摘要:#include#include#includeusing namespace std;int main(){ string a,b; while(cin>>a>>b) { int l=a.size(),cnt1[26]={},cnt2[26]={},i; ... 阅读全文

posted @ 2015-03-03 15:20 windrises 阅读(95) 评论(0) 推荐(0)

UVa-11809 - Floating-Point Numbers
摘要:参考了http://blog.csdn.net/xyqcl/article/details/40011009#include#include#includeusing namespace std;int main(){ double aa[15][35]={}; int bb[15][3... 阅读全文

posted @ 2015-02-26 23:07 windrises 阅读(192) 评论(0) 推荐(0)

UVa-1588 Kickdown
摘要:思路比较简单,注意要双向。 我一直误以为两次cin>>a;时第二次会自动把数组清零,结果WA了我好多次,最后才发现原来不是这样的。 比如这样的: char a[15]={}; cin>>a; for(int i=0;i>a; for(int i=0;i#include#inc... 阅读全文

posted @ 2015-02-25 02:21 windrises 阅读(149) 评论(0) 推荐(0)

UVa-1587 - Box
摘要:写的有点丑,主要是想把一个类似于边长1,2,3的长方体的6*2的数组转换成这样: 1 2 1 2 ... 阅读全文

posted @ 2015-02-23 18:08 windrises 阅读(168) 评论(0) 推荐(0)

UVa-10340 - All in All
摘要:#include#includeusing namespace std;int main(){ string a,b; while(cin>>a>>b) { int la=a.size(),lb=b.size(),i,j; bool flag=1; ... 阅读全文

posted @ 2015-02-23 18:03 windrises 阅读(134) 评论(0) 推荐(0)

UVa-202 - Repeating Decimals
摘要:#include#include#includeusing namespace std;int main(){ int n,m; while(cin>>n>>m) { int a=n/m,b=n%m; int ans[5000]={a},cnt=0; ... 阅读全文

posted @ 2015-02-23 18:03 windrises 阅读(115) 评论(0) 推荐(0)

UVa-1368 - DNA Consensus String
摘要:#include#include#includeusing namespace std;int main(){ //freopen("in.txt","r",stdin); //freopen("out.txt","w",stdout); int n; cin>>n; ... 阅读全文

posted @ 2015-02-23 18:02 windrises 阅读(135) 评论(0) 推荐(0)

UVa-232 Crossword Answers
摘要:#include#include#include#includeusing namespace std;int main(){ //freopen("in.txt","r",stdin); //freopen("out.txt","w",stdout); int a,b,pcnt=... 阅读全文

posted @ 2015-02-15 12:31 windrises 阅读(125) 评论(0) 推荐(0)

上一页 1 2 3 下一页

导航