- 博客(79)
- 收藏
- 关注
原创 【那些年我问chatgpt的问题】关于文章Reducing GUI Test Suites via Program Slicing
【那些年我问chatgpt的问题】关于文章Reducing GUI Test Suites via Program Slicing
2023-03-13 23:08:30 179
原创 【名词解释】黑盒测试、白盒测试、灰盒测试、程序切片、有限状态自动机、正则表达式
【名词解释】黑盒测试、白盒测试、程序切片、有限状态自动机、正则表达式
2023-03-13 22:53:52 608
原创 【名词解释】concolic testing和instrumentation
【名词解释】concolic testing和instrumentation
2022-10-21 23:34:37 611
原创 (PAT A1047)Student List for Course
题目:Sample Input:10 5ZOE1 2 4 5ANN0 3 5 2 1BOB5 5 3 4 2 1 5JOE4 1 2JAY9 4 1 2 5 4FRA8 3 4 2 5DON2 2 4 5AMY7 1 5KAT3 3 5 4 2LOR6 4 2 4 1 5Sample Output:1 4ANN0BOB5JAY9LOR62 7ANN0BOB5FRA8JAY9JOE4KAT3LOR63 1BOB54 7BOB5.
2022-04-02 11:12:00 286
原创 (5.8A)计算组合数
题目:样例:代码:#include<stdio.h>long long res[70][70]={0};long long C(long long m,long long n){ if(n==0||m==n){ return 1; } if(res[m][n]!=0){ return res[m][n]; } return res[m][n]=C(m-1,n)+C(m-1,n-1);}int main(){ long long m; lon
2022-03-30 22:06:21 180
原创 (5.6C)浮点数加法
求2个浮点数相加的和题目中输入输出中出现浮点数都有如下的形式:P1P2...Pi.Q1Q2...Qj对于整数部分,P1P2...Pi是一个非负整数对于小数部分,Qj不等于0
2022-03-30 19:59:56 506
原创 (5.6F)10进制VS2进制
对于一个十进制数A,将A转换为二进制数,然后按位逆序排列,再转换为十进制数B,我们称B为A的二进制逆序数。例如对于十进制数173,它的二进制形式为10101101,逆序排列得到10110101,其十进制数为181,181即为173的二进制逆序数。
2022-03-29 17:17:40 216
原创 (5.5A)完数
求1-n内的完数,所谓的完数是这样的数,它的所有因子相加等于它自身,比如6有3个因子1,2,3,1+2+3=6,那么6是完数。即完数是等于其所有因子相加和的数。
2022-03-15 10:39:28 124
原创 (5.2A) Least Common Multiple
题目:样例:代码:#include<stdio.h>#include<algorithm>using namespace std;bool cmp(int a,int b){ return a>b;}int gcd(int a,int b){ if(b==0){ return a; } else{ return gcd(b,a%b); }}int main(){ int n; scanf("%d",&n); /
2022-03-09 16:52:29 109
原创 (5.1C)百鸡问题
题目:代码:#include<stdio.h>int main(){ double p1=5; double p2=3; double p3=1.0/3.0; double n; while(scanf("%lf",&n)!=EOF){ int x=0; int y=0; int z=0; if(n<100*p3){ continue; } else{ z=100; while(x*p1+y*p2+z*p3<.
2022-03-06 21:03:22 145
原创 (5.1B)反序数
代码:#include<cstdio>#include<algorithm>using namespace std;const int maxn=110;struct tv{ int st; int end; }tvs[maxn];bool cmp(tv a,tv b){ if(a.st==b.st){ return a.end<b.end; } else{ return a.st>b.st; }}int main(){ ..
2022-03-06 21:00:18 103
原创 (4.7A)求第K大数(随机选择算法)
给定一个长度为n(1≤n≤1,000,000)的无序正整数序列,以及另一个数k(1≤k≤1,000,000)(关于第k大的数:例如序列{1,2,3,4,5,6}中第3大的数是4。)
2022-03-06 20:58:05 147
原创 (4.6B)归并排序
题目:样例:代码:#include<stdio.h>void merge(int a[],int l1,int r1,int l2,int r2){ int i=l1; int j=l2; int temp[100010]; int index=0; while(i<=r1&&j<=r2){ if(a[i]==a[j]){ temp[index++]=a[i++]; } else if(a[i]<a[j]){
2022-03-04 16:43:41 47
原创 (4.5C)查找(二分法)
题目:样例:代码:#include<stdio.h>#include<algorithm>using namespace std;int findx(int a[],int left,int right,int x){ int mid; while(left<=right){ mid=(left+right)/2; if(a[mid]==x){ return mid; } else if(a[mid]>x){ r
2022-03-03 21:29:18 120
原创 (4.5B)打印极值点下标
题目:样例:代码:#include<cstdio>void findi(int a[],int n){ int t=0; if(a[0]!=a[1]){ t++; printf("0 "); } for(int i=1;i<n-1;i++){ int left=i-1; int right=i+1; if(a[i]>a[left]&&a[i]>a[right]){ t++; printf("%d..
2022-03-03 21:26:45 158
原创 (4.4F)迷瘴(贪心算法)
题目:样例:代码:#include<stdio.h>#include<algorithm>using namespace std;int main(){ int m; scanf("%d",&m); while(m--){ int n; double v; double w; double p[110]; scanf("%d%lf%lf",&n,&v,&w); for(int i=0;i&l..
2022-03-03 19:48:20 442
原创 (4.4E)FatMouse‘s Trade (贪心算法)
题目:样例:代码:#include<stdio.h>#include<algorithm>using namespace std;struct room{ double j; double f; double rate;}rooms[1010];bool cmp(room a,room b){ return a.rate>b.rate;}int main(){ double m; int n; while(1){ sca..
2022-03-01 22:37:04 101
原创 (4.4A)看电视(区间贪心)
题目:样例:代码:#include<cstdio>#include<algorithm>using namespace std;const int maxn=110;struct tv{ int st; int end; }tvs[maxn];bool cmp(tv a,tv b){ if(a.st==b.st){ return a.end<b.end; } else{ return a.st>b.st; }}in
2022-03-01 22:33:43 153
原创 (4.4D)Repair the Wall (贪心算法)
题目:样例:代码:#include<stdio.h>#include<algorithm>using namespace std;bool cmp(long long x,long long y){ return x>y;}int main(){ long long l; int n; while(scanf("%lld%d",&l,&n)!=EOF){ long long a[610]; for(int i=..
2022-03-01 22:31:32 138
原创 (PAT A1033 To Fill or Not to Fill)
题目:样例:代码:#include<stdio.h>#include<algorithm>using namespace std;struct station{ double P;//每个加油站每单位油价格 double D;//每个加油站到杭州的距离 }st[510];bool cmp(station a,station b){ return a.D<b.D;}int main(){ double cmax;//最多油量 ..
2022-03-01 20:05:29 128
原创 (4.4B)出租车费
题目:样例:代码:#include<stdio.h>#include<math.h>int main(){ int n; while(1){ scanf("%d",&n); if(n==0){ break; } int ans=0; double ans1=0; //注意只有在答案不是整数的时候才保留一位小数输出 if(n<=4){ ans=10; printf("%d\n",ans); .
2022-03-01 12:17:58 75
原创 (PAT B1020)月饼
题目:代码:#include<stdio.h>#include<algorithm>using namespace std;struct moon{ double st; double money; double dan;}moons[1010];bool cmp(moon a,moon b){ return a.dan>b.dan;}int main(){ int n; double need; double ans=0; whi.
2022-02-28 20:29:58 135
原创 (PAT B1023)组个最小数
题目:代码:#include<cstdio>#include<iostream>#include<algorithm>using namespace std;int main(){ int num[10]; char c[55]; while(cin>>num[0]>>num[1]>>num[2]>>num[3]>>num[4]>>num[5]>>num[6].
2022-02-28 20:20:22 47
原创 (4.3D)8皇后
题目:样例:代码:#include<stdio.h>#include<math.h>int num=0;//记录第几种方法得到的皇后串 int p[10];//记录元素在第几行第几列long long ans[100]={0};//其中每一个数字代表一个皇后串 bool hashhou[10]={false};//判断每一列有没有元素 void generateP(int index){ if(index==9){ for(int i=1;i&
2022-02-28 13:33:14 59
原创 (4.3C)神奇的口袋
题目:样例:代码:#include<stdio.h>int ob[25]; int bag(int w,int k){//从前k个物品中选出总体积为w的物体; if(w==0){//拿出的物体刚好重w return 1; } if(k<=0){//拿失败 return 0; } return bag(w,k-1)+bag(w-ob[k],k-1);//拿走当前物品和不拿走两种情况 }int main(){ int n; while(
2022-02-27 19:24:57 238
原创 (4.3B)数列
题目:样例:代码:#include<stdio.h>int fib(int n){ if(n==0||n==1){ return 1; } else{ return fib(n-1)+fib(n-2); }}int main(){ int m; scanf("%d",&m); int num[10][20]; while(m--){ int n; scanf("%d",&n); for(int i=0;i<n.
2022-02-27 16:43:55 45
原创 (4.3A)吃糖果
题目:样例:代码:#include<cstdio>int n;int p[25];int hashday[25]={0};int count=0;int eat(int n){ if(n==1||n==2){ return n; } else{ return eat(n-1)+eat(n-2);//拆成两个问题 }}int main(){ while(scanf("%d",&n)!=EOF){ printf("%d\n",eat
2022-02-27 16:01:18 64
原创 (4.2B)分组统计
题目:样例:代码:#include<cstdio>#include<map>#include<string>#include<iostream> using namespace std;int main(){ int m; scanf("%d",&m); while(m--){ int n; scanf("%d",&n); int num[110];//就用int就行,不需要特意用string.
2022-02-27 15:41:21 63
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人