- 博客(19)
- 收藏
- 关注
原创 PAT甲级(1011-1015)
1011https://pintia.cn/problem-sets/994805342720868352/problems/994805504927186944
2020-03-30 16:31:24 93
原创 PAT甲级 (1006-1010)
1006https://pintia.cn/problem-sets/994805342720868352/problems/994805516654460928#include <cstdio>#include <algorithm>#include <iostream>#include <cstring>#include <q...
2020-03-30 16:03:38 95
原创 机试指南第十二章 动态规划
P224 12.1#include <iostream>using namespace std;int main(){ int candle; cin>>candle; int dp[30]; //memset(dp,0,sizeof(dp)); dp[1] = 1; dp[0] = 0; dp[2] = ...
2020-03-11 19:25:19 96 1
原创 机试指南第十章 数据结构二
P164 习题10.1#include <iostream>#include <cstdio>#include <string>using namespace std;string str;struct TreeNode{ int data; TreeNode* leftchild; TreeNode* rightch...
2020-03-07 23:19:01 91
原创 机试指南第九章 搜索
P145 习题9.1#include <iostream>#include <queue>#include <vector>#include <string>#include <map>using namespace std;bool strhas2012(string str){ if (str.find("...
2020-03-07 16:13:20 81
原创 机试指南第八章 递归与分治
P135习题 8.1#include <iostream>using namespace std;int factorial(int n){ if (n == 1){return n;} else {return n*factorial(n-1);}}int zuheshu(int m,int n){ return factorial(m)/(...
2020-03-06 21:39:00 106
原创 机试指南第七章 贪心策略
P124习题7.1超时#include <iostream>#include <string>#include <vector>#include <algorithm>using namespace std;struct severmode{ string ip; int index; bool flag;...
2020-03-06 15:43:09 127
原创 机试指南第六章 数学问题
P89 习题6.1#include <iostream>#include <stack>using namespace std;int main(){ freopen("D://case.txt","r",stdin); int numcase; cin>>numcase; stack <int> sta...
2020-03-01 21:29:57 227
原创 机试指南第四章 字符串
P53 习题4.1#include <iostream>#include <string>#include <cmath>using namespace std;int main(){ string stringcase; while(cin>>stringcase){ int countemp = 0...
2020-02-28 22:38:03 86
原创 机试指南第三章 排序
P35 习题 3.1#include <iostream>#include <algorithm>using namespace std;const int Max = 1000;int arr[Max];int main(){ // freopen("D:\\case.txt", "r", stdin); int casenum; ...
2020-02-24 22:59:34 77
原创 机试指南第二章 暴力求解
P10 习题2.1#include <iostream>#include <iomanip>//http://t.cn/using namespace std;bool judge(int x){ while (x!=0){ if (x%10 == 7 ){return true;} x = x/10; } ...
2020-02-21 23:30:09 166
原创 PAT乙级(五)(1011-1015)
1011#include <iostream>#include <vector>using namespace std;int main(){ int sum; cin>>sum; vector <bool> result; long long a,b,c; bool flag; while(sum--){ c...
2020-02-15 15:47:44 103
原创 PAT乙级(四)(1008-1010)
1008下面这段代码显示部分错误。#include <stdio.h>#include <map>#include <iostream>#include <stack>#include <queue>#include <math.h>#include <vector>using namespac...
2020-02-13 21:19:08 93
原创 PAT乙级(三)(1006-1007)
1006让我们用字母 B 来表示“百”、字母 S 表示“十”,用 12…n 来表示不为零的个位数字 n(<10),换个格式来输出任一个不超过 3 位的正整数。例如 234 应该被输出为 BBSSS1234,因为它有 2 个“百”、3 个“十”、以及个位的 4。输入格式:每个测试输入包含 1 个测试用例,给出正整数 n(<1000)。输出格式:每个测试用例的输出占一行,用规定的...
2020-02-09 21:24:09 70
原创 PAT乙级(二)(1003-1005)
1003“答案正确”是自动判题系统给出的最令人欢喜的回复。本题属于 PAT 的“答案正确”大派送 —— 只要读入的字符串满足下列条件,系统就输出“答案正确”,否则输出“答案错误”。得到“答案正确”的条件是:字符串中必须仅有 P、 A、 T这三种字符,不可以包含其它字符;任意形如 xPATx 的字符串都可以获得“答案正确”,其中 x 或者是空字符串,或者是仅由字母 A 组成的字符串;如果 ...
2020-02-03 22:20:40 191
原创 PAT乙级(一)(1001-1002)
1001卡拉兹(Callatz)猜想:对任何一个正整数 n,如果它是偶数,那么把它砍掉一半;如果它是奇数,那么把 (3n+1) 砍掉一半。这样一直反复砍下去,最后一定在某一步得到 n=1。卡拉兹在 1950 年的世界数学家大会上公布了这个猜想,传说当时耶鲁大学师生齐动员,拼命想证明这个貌似很傻很天真的命题,结果闹得学生们无心学业,一心只证 (3n+1),以至于有人说这是一个阴谋,卡拉兹是在蓄意...
2020-02-03 01:01:44 91
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人