自定义博客皮肤VIP专享

*博客头图:

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

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

博客底图:

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

栏目图:

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

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(37)
  • 收藏
  • 关注

原创 1203. The Cubic End

#include #include #include using namespace std;string ending;vector ans;void print() { bool firstnotzero = false; for(int i = ans.size() - 1; i >= 0; i--) { if(ans[i]) { firstnotzero =

2014-11-23 13:25:53 624

原创 1231. The Embarrassed Cryptography

#include #include #include #define N 1000001using namespace std;string num;int length;bool isPrime[N];vector prime;vector longNum;void init() { memset(isPrime, true, sizeof(isPrime)); i

2014-11-20 17:33:38 542

原创 1140. 国王的遗产

#include #include #include #define MAX 30001using namespace std;vector edge[MAX];bool del[MAX];short sum[MAX];short minNo[MAX];short parent[MAX];vector get;int golds, sons, leftGolds;

2014-11-20 00:32:13 1907

原创 1071. Floors

#include #include #include using namespace std;struct tile{ int x1, y1, x2, y2;};int maxArea;vector tiles;set xs;set ys;void init() { maxArea = 0; tiles.clear(); xs.clear(); ys.clea

2014-11-19 13:15:14 485

原创 1004. I Conduit!

#include #include #include double const MAX = 99999;using namespace std;struct seg{ double k; double b; double leftx; double downy; double rightx; double upy;}l[10001]

2014-11-11 23:04:42 561

原创 1041. Pushing Boxes

#include #include using namespace std;int h, w, p;int boxes[401][401];int cases = 0;void down() { int moves; cin >> moves; int count = 0; int max = 0; for(int j = 0; j < w; j++) {

2014-11-11 14:59:49 822

原创 1003. Hit or Miss

#include #include #include //#include using namespace std;int players;queue pl[11];int matchingNum[10];int ct;void play() { while(pl[players].size() != 52 && ct != 52 * 13) { /*system("

2014-11-11 12:07:21 570

原创 1211. 商人的宣传

#include #include using namespace std;int main() { int schedule[101][101] = {0}; int tmp[101][101] = {0}; int once[101][101] = {0}; int cities, connections, days, queries, start,

2014-11-10 21:11:20 445

原创 1059. Exocenter of a Trian

#include #include using namespace std;int main() { int cases; cin >> cases; while(cases--) { double ax, ay, bx, by, cx, cy; cin >> ax >> ay >> bx >> by >> cx >> cy;

2014-11-10 20:05:53 644

原创 1193. Up the Stairs

#include #include using namespace std;int main() { int cases; cin >> cases; for(int count = 0; count < cases; count++) { int persons, floors, boxLeft; cin >> persons >> floors >> boxLeft;

2014-11-10 18:33:13 426

原创 1029. Rabbit

#include using namespace std;string stringAdd(string a, string b) { while(a.length() < b.length()) { a = "0" + a; } while(b.length() < a.length()) { b = "0" + b; } string tmp = ""; int c

2014-11-10 16:30:05 614

原创 1034. Forest

#include #include #include using namespace std;bool isForest;bool pointTo[101];bool visited[101];vector child[101];int wid[101];int n, m, maxDepth, maxWidth;void initialize() { memset(po

2014-11-10 15:03:46 390

原创 1028. Hanoi Tower Sequence

#include using namespace std;void toInteger(string n, int num[], int len) { for(int i = 0; i < len; i++) { num[i] = static_cast(n[i] - '0'); }}void dividedBy2(int num[], int len, int& count

2014-11-10 12:13:53 488

原创 1018. A Card Trick

#include #include using namespace std;struct deck{ int value; char suit;};deck card[5];void transfer(string inp, deck& c) { int tmp = 0; switch(inp[0]) { case 'A':

2014-10-27 17:41:00 686

原创 1017. Rate of Return

#include #include #include #include using namespace std;double saveAt[13];int due;double total;double cal(double rate) { double ttl = 0; for(int i = 1; i <= 12; i++) { if(sa

2014-10-27 17:39:40 940

原创 1012. Stacking Cylinders

#include #include #include #include using namespace std;struct point{ double x; double y;};bool compare(const point& a, const point& b) { return a.x < b.x;}void print(point ar

2014-10-27 17:38:55 454

原创 1172. Queens, Knights and Pawns

#include #include using namespace std;int height, width;int board[1001][1001];//0=safe, 1=queen, 2=king, 3=pawn, 4=queen_can_reach, 5=king_can_reachstruct chess{ int locx; int locy;};

2014-10-27 17:38:03 506

原创 1206. Stacking Cylinders

#include #include #include #include using namespace std;struct point{ double x; double y;};bool compare(const point& a, const point& b) { return a.x < b.x;}void print(point arr[], int

2014-10-27 17:37:17 445

原创 1381. a*b

高精度乘法,跟加法差不多。

2014-10-25 17:32:12 557

原创 1093. Air Express

终于来水题了。#include using namespace std;int main() { int set_number = 0; int weightstd[4], rate[4], m[4]; while(cin >> weightstd[0]) { set_number++; cin >> rate[0] >> weightstd

2014-10-23 21:34:15 478

原创 1153. 马的周游问题

#include #include #include #include using namespace std;bool been[8][8];int dir[8][2];int route[64];int ct;bool found;struct pointInfo{ int x; int y; int validUnvisitedNextNum; pointI

2014-10-23 20:59:33 520

原创 1515. 魔版C

跟1151差不多,改了下A、B、C的细节就好了

2014-10-23 19:20:51 508

原创 1151. 魔板

用set判重会被打么……

2014-10-23 19:12:15 492

原创 1152. 简单的马周游问题

找到后break要放到深搜后面呢……被阴了几次#include #include using namespace std;bool been[5][6];int dir[8][2];int route[30];int count;bool found;void initial() { dir[0][0] = -2, dir[0][1] = -1; dir[1][0]

2014-10-23 11:15:51 436

原创 1063. Who's the Boss

一开始是超时的,因为两个

2014-10-16 22:28:06 496

原创 1050. Numbers & Letters

#include using namespace std;int goal;int closest;bool found;void merge(int tmp[], int n) { if(found) { return; } if(tmp[0] <= goal && (closest < tmp[0] || closest == 1001)

2014-10-15 22:40:27 485

原创 1156. Binary tree

先序,递归。

2014-10-08 13:37:52 538

原创 1443. Printer Queue

作业……数组模拟#include using namespace std;int queue[101], n;bool printed[101];bool priIsFirst(int head) { for(int i = 0; i < n; i++) { if(printed[i]) { continue; } if(queue[i] > queu

2014-10-08 11:47:13 454

转载 1009. Mersenne Composite N

经过测试,符合条件的宿舍就只有这些

2014-10-08 10:21:21 558

原创 1007. To and Fro

作业保持感觉。AC:#include #include using namespace std;int main() { int size; while(cin >> size && size != 0) { string tmpWord; cin >> tmpWord; char word[200][size]; memset(word, '0', s

2014-10-08 08:55:07 452

转载 1176. Two Ends

1176. Two Ends限制条件时间限制: 1 秒, 内存限制: 64 兆题目描述In the two-player game "Two Ends", an even number of cards is laid out in a row. On each card, face up, is written a positive integer. Players

2014-09-24 09:48:59 453

原创 1046. Plane Spotting

1046. Plane Spotting限制条件时间限制: 1 秒, 内存限制: 32 兆题目描述Craig is fond of planes. Making photographs of planes forms a major part of his daily life. Since he tries to stimulate his social life

2014-09-24 09:20:44 571

原创 1051. Biker's Trip Odomete

“算法分析与设计”作业第6题。不知道为什么 AC:#include #include using namespace std;#define pie 3.1415927int main() { double diameter, revol, time; int trip = 0; while(cin >> diameter >> revol >> time && r

2014-09-23 22:43:26 467

原创 1035. DNA matching

“算法分析与设计”作业

2014-09-23 22:05:38 487

原创 1027. MJ, Nowhere to Hide

“算法分析与设计”作业第三题,以前做过。AC:

2014-09-23 21:41:53 442

原创 1021. Couples

限制条件时间限制: 1 秒, 内存限制: 32 兆题目描述N couples are standing in a circle, numbered consecutively clockwise from 1 to 2N. Husband and wife do not always stand together. We remove the couples who

2014-09-23 18:05:58 411

原创 1020. Big Integer

一直没写过技术博客,此博客到大三才开实在是晚。此题为“算法分析与设计”的作业第一题,是sicily题库里的编号为1020的题目。早上老师课上刚说分治法,看题目要求是大数求模,估计用int之类的存不下了,所以用string存后再处理。以下是我AC的答案:#include #include using namespace std;int main() { int

2014-09-23 17:58:56 588

空空如也

空空如也

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

TA关注的人

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