- 博客(110)
- 资源 (14)
- 收藏
- 关注
原创 【PAT甲级】1025. PAT Ranking (25)
#include <stdio.h>#include <iostream>#include <deque>#include <algorithm>#include <string.h>using namespace std;typedef struct Testee { string num; int loca; int score; int rank;
2016-10-18 10:50:25 216
原创 【PAT甲级】1024. Palindromic Number (25)
#include <stdio.h>#include <stdio.h>#include <string.h>char in[200];int num[200] = {0};int k;void add(int *a, int &n);bool isPa(int *a, int n);int main(int argc, char *argv[]) { scanf("%s %d
2016-10-17 23:12:15 237
原创 【PAT甲级】1023. Have Fun with Numbers (20)
#include <stdio.h>#include <string.h>int main(int argc, char *argv[]) { int i, k; char in[23]; int num[23] = {0}; int map[10] = {0}; int map2[10] = {0}; scanf("%s", in); k
2016-10-17 22:39:09 203
原创 【PAT甲级】1022. Digital Library (30)
#include <iostream>#include <iomanip>#include <sstream>#include <stdio.h>#include <stdlib.h>#include <string.h>#include <string>#include <map>#include <set>using namespace std;int n;int m;m
2016-10-17 21:34:34 326
原创 【PAT甲级】1021. Deepest Root (25)
注:要考虑时间空间效率问题:使用邻接表,并减少使用dfs的次数(原来为n次dfs,后面改为2次)。#include <stdio.h>#include <string.h>#include <deque>#include <algorithm>using namespace std;int n;deque<int> map[10001];int set[10001];void dfs
2016-10-16 15:51:06 247
原创 【PAT甲级】1020. Tree Traversals (25)
注:在levelTraverse递归中,需要用malloc分配Node空间,并将left和right赋值为NULL。#include <stdio.h>#include <deque>#include <stdlib.h>using namespace std;typedef struct Node { int key; Node* left; Node* right
2016-10-15 12:59:19 154
原创 【PAT甲级】1018. Public Bike Management (30)
注:这里用到了Dijkstra和DFS注2:需要找出所有路径,然后才能选择最小的minNeed,minTake注3:need(需要的bikes数量)要进行累加注4:相同长度的最短路径,选择need最少的;如果这时need也相同,则选择take最少的;#include <stdio.h>#include <string.h>#include <deque>#include <stdlib
2016-10-14 16:14:01 285
原创 【PAT甲级】1019. General Palindromic Number (20)
注:特殊情况 n == 0.#include <stdio.h>int main(int argc, char *argv[]) { int n, b; scanf("%d %d", &n, &b); if (n == 0) { printf("Yes\n0\n"); return 0; } int i; int a[1
2016-10-14 13:33:31 242
原创 【PAT甲级】1017. Queueing at Bank (25)
注:只要顾客在工作时间到达,那么即使轮到他的时候银行已经下班,仍然要给他办理。#include <stdio.h>#include <algorithm>#include <vector>#define OPEN_TIME 8 * 3600#define CLOSE_TIME 17 * 3600using namespace std;typedef struct Cus { int
2016-10-13 15:54:54 359
原创 【POJ】1005. I Think I Need a Houseboat
#include <stdio.h>#include <cmath>#define pi 3.1415926536using namespace std;int main(int argc, char *argv[]) { int n; float x, y; scanf("%d", &n); float preR2, R2; int i; int
2016-10-12 22:42:52 215
原创 【POJ】1004. Financial Management
#include <stdio.h>#include <math.h>int main(int argc, char *argv[]) { int i; float money; float sum = 0.00; float ave; for (i = 0; i < 12; i++) { scanf("%f", &money);
2016-10-12 21:51:35 237
原创 【POJ】1003. Hangover
#include <stdio.h>int main(int argc, char *argv[]) { float in; float i, j, k; float sum; scanf("%f", &in); while (in != 0.00) { sum = 0.00; i = 0.00; while (
2016-10-12 21:38:11 251
原创 【POJ】1002. 487-3279
注:在输出数字的时候,不要忘了开头0补齐。#include <stdio.h>#include <string.h>#include <map>using namespace std;int main(int argc, char *argv[]) { map<int, int> mm; int num[26] = {2, 2, 2, 3, 3, 3, 4, 4, 4, 5, 5
2016-10-12 21:10:57 204
原创 【POJ】1001. Exponentiation
注:求幂的过程中,每乘一次,都要进行进位,防止溢出。#include <stdio.h>#include <string.h>char in[6];int r[6];int n;int o[200];int digits;int main(int argc, char *argv[]) { int i, j, k, t; int nonzeros; bool fl
2016-10-12 19:15:12 235
原创 【PAT甲级】1016. Phone Bills (25)
注:如果一个用户所有通话记录均不匹配,则不打印他的任何信息#include <stdio.h>#include <string>#include <string.h>#include <vector>#include <algorithm>#include <iostream>using namespace std;typedef struct Rec { string name;
2016-10-08 12:36:08 351
原创 【PAT甲级】1015. Reversible Primes (20)
注:1是非素数#include <stdio.h>#include <cmath>int getNumWithRadix(int n, int d);int getDecimal(int n, int d); int getReverse(int n);bool isPrime(int n);int main(int argc, char *argv[]) { int n, d;
2016-10-02 21:59:39 198
原创 【PAT甲级】1014. Waiting in Line (30)
#include <stdio.h>#include <iostream>#include <string.h>#include <queue>#include <stdlib.h>using namespace std;typedef struct cus { int proTime; int serTime; int finTime;} Cus;int n,
2016-10-02 18:38:19 219
原创 【PAT甲级】1007. Maximum Subsequence Sum (25)
#include <stdio.h>int main(int argc, char *argv[]) { int k; scanf("%d", &k); int a[k]; int maxsum[k]; int from[k]; int i; for (i = 0; i < k; i++) { scanf("%d", &a[i]
2016-09-30 15:01:58 195
原创 【PAT甲级】1013. Battle Over Cities (25)
#include <stdio.h>#include <string.h>int v[1001][1001] = {0};int w[1001] = {0};int n, m, k;void markMatrix(int a, int from, int count) { int j, k; for (k = 1; k <= n; k++) { if (k ==
2016-09-30 01:43:58 254
原创 【PAT甲级】1012. The Best Rank (25)
#include <stdio.h>void findBestCourse(int s[][5], int n, int i, int &o1, char &o2); char map[5] = {' ', 'A', 'C', 'M', 'E'};int main(int argc, char *argv[]) { int n, m; int i, j, k; scanf(
2016-09-29 22:47:56 223
原创 【PAT甲级】1009. Product of Polynomials (25)
#include <stdio.h>#include <string.h>int main(int argc, char *argv[]) { int k, n, i, j; double d; double a1[1001] = {0.0}; double a[2001] = {0.0}; scanf("%d", &k); for (i = 0; i < k; i++)
2016-09-29 18:52:38 239 1
原创 【PAT甲级】1010. Radix (25)
注:在进行十进制转换时,每一步都应当判断溢出。#include <stdio.h>#include <string.h>#include <cmath>long long getDecimal(char a[], int radix); int getDigit(char c);int findRadix(char N[], long long low, long long high);i
2016-09-29 18:48:20 305
原创 【PAT甲级】1011. World Cup Betting (20)
#include <stdio.h>int findMax(float a[]);int main(int argc, char* argv[]) { float a[3][3]; int i, j; for (i = 0; i < 3; i++) { for (j = 0; j < 3; j++) { scanf("%f", &a[i][j]); }
2016-09-29 17:20:55 244
原创 【PAT甲级】1008. Elevator (20)
#include <iostream>#include <stdio.h>#include <string.h>using namespace std;int main(int argc, char *argv[]) { int n, i; cin >> n; int a[n]; for (i = 0; i < n; i++) { cin >> a
2016-09-27 17:34:12 224
原创 【PAT甲级】1006. Sign In and Sign Out (25)
#include <iostream>#include <stdio.h>#include <string.h>#include <string>using namespace std;typedef struct per { char ID[16]; int inTime; int outTime;} per;int main(int argc, char *ar
2016-09-26 18:54:01 275
原创 【PAT甲级】1005. Spell It Right (20)
#include <iostream>#include <stdio.h>#include <string.h>#include <math.h>using namespace std;int main(int argc, char *argv[]) { char input[101]; int i, x; int sum = 0; cin >> input;
2016-09-26 16:00:27 243
原创 【PAT甲级】1004. Counting Leaves (30)
#include <iostream>#include <stdio.h>#include <string.h>using namespace std;typedef struct Node{ int leftchild; int rightsibling;}Node, *tree;void traverse(Node *tree, int id, int h, int &ma
2016-09-26 15:23:43 189
原创 【PAT甲级】1003. Emergency (25)
#include <iostream>#include <stdio.h>#include <string.h>using namespace std;int main(int argc, char *argv[]) { int MAX = 99999999; int n, m, c1, c2; cin >> n >> m >> c1 >> c2; int v[n
2016-09-25 17:48:55 235
原创 【PAT甲级】1002. A+B for Polynomials (25)
#include <iostream>#include <string.h>#include <stdio.h>using namespace std;int main(int argc, char *argv[]) { int n = 0; int cnt = 0; int i = 0; int j = 0; int nx; float anx
2016-09-23 13:48:12 299
原创 【PAT甲级】1001. A+B Format (20)
欢迎使用Markdown编辑器写博客本Markdown编辑器使用StackEdit修改而来,用它写博客,将会带来全新的体验哦:Markdown和扩展Markdown简洁的语法代码块高亮图片链接和图片上传LaTex数学公式UML序列图和流程图离线写博客导入导出Markdown文件丰富的快捷键快捷键加粗 Ctrl + B 斜体 Ctrl + I 引用 Ctrl
2016-09-23 11:34:47 255
【pdf kindle打包】Naked Statistics Stripping the Dread From the Data
2018-12-05
ESL英文版+中文版+答案 The Elements of Statistical Learning 统计学习基础
2018-05-28
Scikit-learn Cookbook.pdf 英文版 + 中文版
2018-05-14
Pattern Recognition And Machine Learning英文+中文+完整答案 模式识别与机器学习
2018-05-07
Pattern Recognition and Machine Learning 模式识别与机器学习 中文版
2018-05-07
Introduction to Scorecard for FICO Model Builder 英文
2018-04-16
The Little SAS Book for Enterprise Guide 4.2 英文版
2018-04-11
动态规划:从新手到专家 Hawstein
2016-10-26
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人