sicily
文章平均质量分 73
lenslipe
这个作者很懒,什么都没留下…
展开
-
repost
// Problem#: 1155// Submission#: 2547936// The source code is licensed under Creative Commons Attribution-NonCommercial-ShareAlike 3.0 Unported License// URI: http://creativecommons.org/licenses/by原创 2013-12-13 22:56:16 · 438 阅读 · 0 评论 -
sicily 分类
原文出处:http://linguifan2010.blog.163.com/blog/static/1315127442010102131322482/*************************程序设计题**************************************************数据结构*************************si转载 2013-12-19 21:26:56 · 822 阅读 · 0 评论 -
Sicily 1090 highway + Prim + priority_queue
#include #include #include #include using namespace std;class edge{public: int s,t; edge(int s,int t){ this->s=s; this->t=t; }};const int N=501;bool visi[N];int num,s1,t1;int G[N原创 2013-12-21 15:53:23 · 604 阅读 · 0 评论 -
1014 Specialized Four-Dig
#include using namespace std;int transfer(int a,int num){ int sum=0; int b; while(a) { b=a%num; a=a/num; sum+=b; } return sum;}int main(){ int decc,shier,liu; for (int i=1000;i<=原创 2013-12-23 17:02:55 · 410 阅读 · 0 评论 -
1017 Rate of Return
注意格式。#include#include#includeusing namespace std;struct word{ int month; double depo; }wo[14];int N,month;double inve;double cal(double a){ double sum=0; for(int i=0;i<N;i++) { s原创 2014-01-07 23:59:26 · 511 阅读 · 0 评论 -
1028 Hanoi Tower Sequence 高精度除 和取模 pair<string,int>
#include#includeusing namespace std;pair dividen(string str,int chushu){ string::iterator iter; string fina; int yushu=0; int temp; for(iter=str.begin();iter!=str.end();iter++) { temp=yu原创 2014-01-08 22:00:10 · 518 阅读 · 0 评论 -
1172 Queens & Knights & Pawns
//this low-intermediate level takes three hours to ac including 2.5 hours to inefficiently //find out the reasons,which really broke new record of my worst. #include #include#include #include us原创 2013-12-27 19:39:01 · 468 阅读 · 0 评论 -
1034 forest
大水题,WA到吐了,结果发现犯了一弱智错误,擦1.定义dept[]数组,主要用bfs ,将子节点的dept值累加父节点的dept值,遍历一颗或者若干树。从根节点(bepointed[]值为false的点)出发遍历全棵树。2.存储方式:邻接表存边 vector+queue , #include #include#include#include#includeusing nam原创 2013-12-27 23:03:20 · 493 阅读 · 0 评论 -
1500 Prime Gap + 判定素数isPrime的三种方法
#include #include using namespace std;const int N=1000;int prime1[N];int num,j,k;bool isPrime(int a){ for(int i=2;i<=(int)floor(sqrt((double)a));i++) { if(a%i==0) return false; } re原创 2013-12-23 16:21:06 · 672 阅读 · 0 评论 -
1211 商人的宣传 矩阵法
#include using namespace std;int n,m,l,a,b,sum,k;int arr[110][110];int mul[110][110];int fak[110][110];int main(){ cin>>n>>m>>l; for(int i=0;i<m;i++) { cin>>a>>b; a原创 2014-01-02 21:05:53 · 476 阅读 · 0 评论 -
mid-term 1005 snow road
#include #include using namespace std;struct road{ int a,b,distanc;};int T,n,m1,m2;int root[100];int rankk[100];road grah[1001];bool cmp(const road &a,const road &b){ return a.distanc<b.原创 2013-12-19 18:53:41 · 454 阅读 · 0 评论 -
Sicily 1090 highway + Kruskal +并查集实现
Sicily 1090 highway 1. 并查集。适用于集合论中,用来判断给出的两点A、B是否在同一个集合中,若不在一个集合中,则将他们合并。具体方法是维护2个一维数组:Step1:初始化一维数组root[]使每个index存放自身,(即自己的root为自己,N个元素组成N个集合)Index1234原创 2013-12-19 17:52:35 · 586 阅读 · 0 评论 -
1093 Air Express
// Problem#: 1093// Submission#: 2612482// The source code is licensed under Creative Commons Attribution-NonCommercial-ShareAlike 3.0 Unported License// URI: http://creativecommons.org/licenses/by原创 2013-12-28 16:48:00 · 735 阅读 · 0 评论 -
1003 Hit or Miss
又是个坑了我2小时WA到吐的大水题,狗血题目就看了我半天!正是无力吐槽那坑爹的英文题目的描述了。1.开始以为是几个玩家同步报数匹配,其实是轮流报数匹配,即:A->B->C->D->A->B->C->D->A->B....... 2. A做一次报数,如果没有match,放回A自己的底部。如果match了,放到B的底部。A做完一次报数后,轮到B报数(注意只有B有牌时才开始报数),如果没有mat原创 2013-12-28 22:49:00 · 805 阅读 · 0 评论 -
1082 MANAGER vector+iterator
sicily对格式的要求真是奇葩!// Problem#: 1082// Submission#: 2619361// The source code is licensed under Creative Commons Attribution-NonCommercial-ShareAlike 3.0 Unported License// URI: http://creativecomm原创 2013-12-30 21:00:48 · 501 阅读 · 0 评论 -
1119 Factstone Benchmark
1. 本质求 n!2. 左右取log2 ,求 log2(n!)3. log2(n!)#include#include#includeusing namespace std;int year,aa;double num,sum;int main(){ while(cin>>year&&year) { num=pow(2.0,(year-原创 2014-01-01 17:26:15 · 421 阅读 · 0 评论 -
1018 A Card Trick
别人跨年 我OJ ~~~~2014年sicily AC第一人写的很丑,将就看吧#include#include#include#includeusing namespace std;struct card{ int num; char ch; string sym;};int T,a,b,temp,dis;string str,strtemp;boo原创 2014-01-01 00:36:05 · 556 阅读 · 0 评论 -
1381 a*b 高精度
#include #include #include using namespace std;string add(string add1,string add2){ int a=add1.length(); int b=add2.length(); int temp; if(a>b) { for (int i=0;i<a-b;i++) { add2='0'+原创 2013-12-17 22:45:10 · 502 阅读 · 0 评论 -
sicily mid-term practice
#include #include #include #include #includeusing namespace std;int N,M;struct word{ string wor; int freq;};bool cmp(word a,word b){ return a.freq>b.freq;}int main(){原创 2013-12-18 21:24:54 · 382 阅读 · 0 评论 -
final exam
#include#include#includeusing namespace std;struct edge{ int x,y,step; edge(int aa,int bb,int ss){ x=aa; y=bb; step=ss; } edge(){}};int xpian[]={1,0,-1,0};int ypian[]={0,1,0,-1};i原创 2014-01-17 10:54:15 · 586 阅读 · 0 评论