自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(68)
  • 资源 (2)
  • 收藏
  • 关注

原创 sicily 2013

<br />贪心,当钱足够付清前面所有的帐时才还债。<br />#include <iostream>using namespace std;int cost[100010];int main() { //freopen("1.txt", "r", stdin); int n; cin >> n; int last = -1; int cur = 0; int ans = 0; int curCost = 0; int _curCost = 0; int i

2011-01-31 23:38:00 519

原创 sicily 1310

<br />刚开始看错题,以为0是结束,导致了3次WA。。后来把cin>>放回到while()里面就AC了。。。<br />// source code of submission 598858, Zhongshan University Online Judge System#include <iostream>#include <string>#include <cstring>using namespace std;struct node { node* left;

2011-01-31 21:14:00 989

原创 sicily 1252

<br />总共WA3次,第一次以为<br /><word>erone who <word>s、<word>tionthe process of <word>ing<br />这两种会把新的单词剪掉后缀还要加s或者ing。改之。。<br />第二次把在后面加s或者ing或者again的顺序搞反。改之。。<br />第三次,重新看题目,注意到一句很关键的话: You need to expand at most one prefix and one suffix,当时吐血了。。后来加了个计数器,AC。。。相当

2011-01-31 19:23:00 465

原创 sicily 1426

第一次写trie,WA了一次,Runtime Error两次(在释放内存的时候,开始直接data = new node[10]。。删除就出问题了。。)至于WA,注意一下这两组数据就得了:291191和291911刚开始就少了一个末端的判断。#include #include #include using namespace std;struct node { node* next[10]; bool hasEnd; node() { for(int i = 0; i nex

2011-01-31 17:54:00 1476 2

转载 学习笔记6——meta属性

<br />meta是用来在HTML文档中模拟HTTP协议的响应头报文。meta 标签用于网页的<head>与</head>中,meta 标签的用处很多。meta 的属性有两种:name和http-equiv。name属性主要用于描述网页,对应于content(网页内容),以便于搜索引擎机器人查找、分类(目前几乎所有的搜索引擎都使用网上机器人自动查找meta值来给网页分类)。这其中最重要的是description(站点在搜索引擎上的描述)和keywords(分类关键词),所以应该给每页加一个meta值。比较

2011-01-31 15:40:00 498

原创 学习笔记5——表单

<br /> <br /><form name="" action="" method=""><br /><input type="" name="" value""><br /></form><br />method:get跟post,get用于发送小量的信息,post用于发送大量信息和一些加密的信息。语法<input type="value">属性值值描述button定义可点击按钮(多数情况下,用于通过 JavaScript 启动脚本)。checkbox定义复选框。file定义输入字段和 "浏览"按钮,

2011-01-31 15:13:00 515

原创 学习笔记4——表格

cellspacing:表格内边框跟外边框的间距cellpadding:表格当中元素跟表格边框的间距 通常是指一行 通常是指一列表格所有元素都写在当中,tr只是表示有一行存在,table的bordercolor设置外边框颜色,td的设置内边框,若td无设置则跟外边框一样。设置某一单元格的属性只能在td内设置,不能在tr设置。标签套用依然适合。行1列1行1列2行2列1行2列2

2011-01-31 11:58:00 781

原创 学习笔记3——加入图片

<br /><img src="图片路径" alt="简单说明" width="" height="" border="边框宽度" hspace="水平方向空白" vspace="垂直方向空白" align="对齐方式"><br />alt:当鼠标移到图片上显示的文字<br />hspace:图片与周围的元素在水平方向上的间距<br />vspace:图片与周围的元素在垂直方向上的间距<br />align:跟周围文字的对齐方式.<br /><img src="1.jpg" alt="图片alt" hspa

2011-01-31 11:35:00 436

原创 学习笔记2——建立列表

<br />建立列表:<br />ul无序列表,ol有序<br /><ul type=""><br />.<br />.<br /><li></li><br />.<br />.<br /></ul><br />type包括:<br />circle:空心圆点<br />disc:实心圆点(默认)<br />square:方框<br />例:<br /><ul><br /><li>A</li><br /><li>B</li><br /><li>C</li><br /></ul>ABC<br /> <br /

2011-01-31 11:19:00 366

原创 学习笔记1

加粗斜体加下划线表示段落,自动换行表示换行表示新的一行格式跟你在文本文件写的一样,换行、空格一样。通过添加属性、标签格式化文字23  上标,2323  下标,23标签套用:离修饰文字最近的标签的优先级最高,可屏蔽外层的具有相同作用的标签。链接元素打开方式:1._blank       my document         浏览器会另开一个新窗口显示document.html文档   2._p

2011-01-31 11:04:00 435

原创 sicily 1129

<br />#include <iostream>#include <string>using namespace std;int main() { string s; while(cin >> s) { cout << s << "-"; int ans = 0; int count = 10; for(int i = 0; i < 11; i++) { if(s[i] >= '0' && s[i] <= '9') ans += count-

2011-01-29 12:25:00 434

原创 sicily 1636

<br />#include <iostream>using namespace std;int main() { int T, m, n; cin >> T; while(T--) { cin >> m >> n; int used = 0; for(int i = 0; i < n; i++) { int a, b; cin >> a >> b; used += a * b; } if(m - used >= 0) cout <<

2011-01-29 10:17:00 425

转载 #pragma的用途

在所有的预处理指令中,#Pragma 指令可能是最复杂的了,它的作用是设定编译器的状态或者是指示编译器完成一些特定的动作。#pragma 指令对每个编译器给出了一个方法,在保持与C和C++语言完全兼容的情况下,给出主机或操作系统专有的特征。依据定义,编译指示是机器或操作系统专有的, 且对于每个编译器都是不同的。 其格式一般为: #Pragma Para其中Para 为参数,下面来看一些常用的参数。所以使用这个选项排除一些头文件。有时单元之间有依赖关系,比如单元A依赖单元B,所以单元B要先于单元A编译。你可以

2011-01-28 11:36:00 713

原创 sicily 1010

<br />从头开始搜TLE,从尾开始搜,AC。。。<br />上网看了一下,都说DP。。不懂。。看来真的要看DP才行,也许我写的就是变相DP,是我不懂DP而已。。<br />#include <iostream>#include <string>#include <cstring>using namespace std;string A, B, C;bool _find(int n, int m, int cur) { if(cur == -1) return true; if

2011-01-25 01:38:00 773

原创 sicily 1342

<br />dp<br />#include <iostream>#include <cmath>#include <cstring>using namespace std;int N, m;int data[30000];int main() { while(cin >> N >> m) { int ans = 0; int cost, pro; memset(data, 0, sizeof(data));

2011-01-25 00:38:00 715

原创 sicily 1759

<br />看不到题目的图。。靠题意蒙,WA了两次。。不解释- -<br />#include <iostream>#include <algorithm>using namespace std;int circle[3][2] = {{30, 30}, {100, 30}, {170, 30}};int r[3] = {20, 10, 5};int main() { int T; cin >> T; while(T--) { int n; cin >> n;

2011-01-24 23:43:00 442

原创 sicily 1438

<br />#include <iostream>#include <algorithm>using namespace std;int data[20000];bool cmp(int x, int y) { return x > y;}int main() { int T; cin >> T; while(T--) { int n; cin >> n; for(int i = 0; i < n; i++) cin >> data[i]; s

2011-01-24 23:16:00 504

原创 sicily 1137

呵呵。。我当时看了就想用分治来做(类似归并排序),但是归并的时候想不到怎么处理,感觉如果真要处理就跟我下面的代码一样,下面的代码是看了ac的人数直接写的。。#include #include using namespace std;int k;int data[30000];int n;int main() { while(cin >> n >> k) { for(int i = 0; i > data[i]; int _max = 0; for(int i =

2011-01-24 22:41:00 738

原创 sicily 1798

<br />刚开始自己模拟了一种解法,当n大于1的时候,总是Alice赢(走日字),提交,WA,再细想发现不对,后来想应该要全部走完吧?冒险试试,结果AC了。。其实我也不懂。<br />其实我想过用bfs跟dfs,都行不通,也想过dp,但是觉得子问题不同(呵呵,可能我对dp还不太了解吧)。<br />代码如下:<br />#include <iostream>using namespace std;int main() { int n; while(cin >> n && n != 0) {

2011-01-24 22:12:00 1035

原创 sicily 1240

<br />开始做了很久做不出。。测试数据也只对了一半,无奈只能百度,http://163yescpk.blog.163.com/blog/static/141890288201011614935180/<br />看完后恍然大悟。。就是9进制转成10进制,而且大于4的位都要减1才能配成九进制。<br />#include <iostream>#include <string>using namespace std;string s;int main() { //freopen("C:/

2011-01-24 00:01:00 620

原创 sicily 1306

<br />题目表述有问题。。And please make sure that there should NOT be any blank line between outputs of two adjacent data sets.搞到我以为换行也没。。WA一次。。<br />#include <iostream>#include <algorithm>using namespace std;int data[100000];int main() { //freopen("C:/Us

2011-01-23 22:27:00 962

原创 sicily 1039

#include #include #include #include using namespace std;struct { int weight; int rate;}wr[4];int main() { //freopen("C:/Users/Alfred/Desktop/1.txt", "r", stdin); int k = 1; while(cin >> wr[0].weight) { cout > wr[0].rate; cin >

2011-01-23 22:17:00 498

原创 sicily 1159

<br />sicily的水题都很多好多大数操作。。。<br />#include <iostream>#include <cstring>#include <cmath>using namespace std;int ans[101];char tmps[101];int n;int main() { int n; while(cin >> n) { cin >> tmps; memset(ans, 0, sizeof(ans)); int len =

2011-01-23 21:49:00 610

原创 sicily 1035

<br />#include <iostream>#include <string>#include <set>using namespace std;string data[101];int n;int main() { int T; cin >> T; while(T--) { cin >> n; set<string> s; set<string>::iterator iter; int count = 0; for(int i

2011-01-23 21:35:00 900

原创 sicily 1433

<br />额。。这题我想复杂了。。当我在写二分查找的时候。。我发现我笨死了。。<br />#include <iostream>#include <algorithm>using namespace std;int data[21];int n;int main() { int T; cin >> T; while(T--) { cin >> n; for(int i = 0; i < n; i++) cin >> data[i]; sort(data,

2011-01-23 21:22:00 581

原创 sicily 1232

<br />刚开始看不懂题目,晕浪,用google翻译了才懂。。<br />#include <iostream>using namespace std;int main() { int T; cin >> T; while(T--) { int ans = 1; int n, tmp; cin >> n; ans -= n; for(int i = 0; i < n; i++) { cin >> tmp; ans += tmp; }

2011-01-23 20:18:00 497

原创 sicily 1325

<br />逐个逐个算就会TLE。。<br />#include <iostream>#include <cstring>using namespace std;int a[100001];int main() { int ans; memset(a, 0, sizeof(a)); for(int i = 1; ; i++) { ans = i; int tmp = i; while(tmp != 0) { ans += tmp % 10; tm

2011-01-23 19:54:00 625

原创 sicily 1926

<br />class NumCal { int *p; // 数组首地址 int size; // 数组sizepublic: int sum(); // 计算数组元素和 NumCal(); // 构造函数 NumCal(int *new_p, int new_size); // 构造函数};int NumCal::sum() { int ans = 0; for(int i = 0; i < size; i++) ans +=

2011-01-23 19:40:00 438

原创 sicily 1341

<br />#include <iostream>#include <set>using namespace std;int main() { int n; while(cin >> n) { set<int> ans; int tmp; for(int i = 0; i < n; i++) { cin >> tmp; ans.insert(tmp); } cout << ans.size() << endl; bool isFirst

2011-01-23 19:37:00 398

原创 sicily 1324

<br />#include <iostream>#include <string>using namespace std;int main() { int T; cin >> T; string s; while(T--) { cin >> s; int ans = 0; int k = 1; for(int i = 0; i < s.size(); i++) { if(s[i] == 'O') ans += k++; else k =

2011-01-23 19:28:00 376

原创 sicily 1294

//公式:x*y mod c=x*(y mod c) mod c#include using namespace std;int main() { int a, b, c; cin >> a >> b >> c; int ans = a % c; for(int i = 1; i

2011-01-23 19:22:00 401

原创 sicily 1293

。。本来以为会TLE,看了一下statu。。发现TLE的人不多,那就暴力了#include #include using namespace std;int main() { int i, j; cin >> i >> j; int _max = 0, tmp, count; for(; i

2011-01-23 19:12:00 466

原创 sicily 1200

<br />#include <iostream>using namespace std;int main() { int n; while(cin >> n && n != 0) { int ans = 0, tmp; while(n--) { cin >> tmp; ans ^= tmp; } cout << ans << endl; } return 0;} 

2011-01-23 18:59:00 489 1

原创 sicily 1006

<br />虽然过了,但是是试了几种方法才过的,我对题目的median有点不解,median不是中值吗?<br />#include <iostream>#include <cstring>#include <string>#include <cmath>using namespace std;string s[120];string tmp = "ABCDE";bool isVis[5];string ini = "ABCDE";string data[101];i

2011-01-23 18:20:00 779 1

原创 sicily 1020

<br />同样大数求余<br />#include <iostream>#include <cstring>#include <string>using namespace std;int data[101];string s;int _mod(int b) { int d = 0; for(int i = 0; i < s.size(); i++) { d = d * 10 + s[i] - '0'; d = d % b; } return d;}

2011-01-23 17:25:00 725

原创 sicily 1146

<br />对动态规划还不是很了解。。做了很久。。<br />#include <iostream>#include <cstring>using namespace std;struct { int t; int v;}data[101];int ans[1001];int T, M;int main() { //freopen("C:/Users/Alfred/Desktop/1.txt", "r", stdin); cin >> T >> M; mems

2011-01-23 16:58:00 652

原创 sicily 1028

<br />大数求余。。。<br />//规律第pth元素 p = (2 * i + 1) * 2^(n - 1);//n即为该元素.#include <iostream>#include <cstring>using namespace std;struct num { int dig[110]; int len; num operator = (num* tmp) { memcpy(dig, tmp->dig, sizeof(dig)); len = tmp-

2011-01-23 14:56:00 825

原创 sicily 1036

<br />#include <iostream>#include <cstring>using namespace std;char keyword[11];char mes[10][101];char message[101];int len;int order[11];bool isEqual(char *x, char *y) { while((*x) != '/0' && (*y) != '/0') { if(*(x++) != *(y++)) retur

2011-01-23 09:16:00 681

原创 sicily 1029

<br />大数相加<br />#include <iostream>#include <cstring>using namespace std;class Data {public: Data() { memset(a, 0, sizeof(a)); size = 0; } Data(int num) { setNum(num); } int a[100]; int size;

2011-01-23 08:38:00 808

原创 sicily 1157

<br />水。。形式上发发。。。<br />#include <iostream>using namespace std;int main() { int n; while(cin >> n && n != 0) { int _max, tmp; cin >> _max; while(--n) { cin >> tmp; if(tmp > _max) _max = tmp; } cout << _max << endl; } retur

2011-01-22 19:00:00 506

mail.jar, activation.jar, xerces.jar, xmlsec-1.2.1.jar

mail.jar, activation.jar, xerces.jar, xmlsec-1.2.1.jar 做Axis开发必备

2011-11-29

数据结构殷人昆课后答案

数据结构殷人昆课后答案 数据结构殷人昆课后答案

2010-10-27

空空如也

TA创建的收藏夹 TA关注的收藏夹

TA关注的人

提示
确定要删除当前文章?
取消 删除