- 博客(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 650
原创 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 586
原创 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 2013
原创 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 518
原创 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 590
原创 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 875
原创 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 599
原创 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 479
原创 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 693
原创 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 452
原创 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 659
原创 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 412
原创 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 514
原创 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 731
原创 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 991
原创 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 486
原创 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 534
原创 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 498
原创 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 522
原创 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 541
原创 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 463
原创 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 507
原创 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 481
原创 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 477
转载 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 482
原创 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 595
原创 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 488
原创 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 436
原创 1020. Big Integer
一直没写过技术博客,此博客到大三才开实在是晚。此题为“算法分析与设计”的作业第一题,是sicily题库里的编号为1020的题目。早上老师课上刚说分治法,看题目要求是大数求模,估计用int之类的存不下了,所以用string存后再处理。以下是我AC的答案:#include #include using namespace std;int main() { int
2014-09-23 17:58:56 606
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人