- 博客(9)
- 资源 (1)
- 收藏
- 关注
原创 L2-005. 集合相似度
给定两个整数集合,它们的相似度定义为:Nc/Nt*100%。其中Nc是两个集合都有的不相等整数的个数,Nt是两个集合一共有的不相等整数的个数。你的任务就是计算任意一对给定集合的相似度。输入格式:输入第一行给出一个正整数N(<=50),是集合的个数。随后N行,每行对应一个集合。每个集合首先给出一个正整数M(<=104),是集合中元素的个数;然后跟M个[0, 109]区间内的整数。之后一行...
2018-04-22 13:28:59 115
原创 L2-017. 人以群分
水题,还以为是并查集想练练的。。。#include<iostream>#include<algorithm>using namespace std;//分两种情况,偶数好办,奇数也办,总之就是外向的人数大于等于内向的人数 int main() { int n,ji,ou; cin>>n; ji = n / 2; ou = n - ji; in...
2018-04-22 10:57:01 96
原创 LCS-入门
最长公共子序列问题(longest-common-subsequence problem)问题解释:对两个序列X,Y,求他们的长度最长的公共子序列。子序列:例如,X = {5, 6, 7},那么{5} {6} {7} {5,6} {5,7} {6,7} {5,6,7}, 空集都是X的子序列。暴力求解:用暴力求解,那么就要穷举X的所有子序列,然后一个个检查X的子序列是否也是Y的子序列,找到最长的...
2018-04-21 12:20:31 244
原创 表值函数练习
1. 自定义一个函数,实现如下功能:对于一个给定的课程号,查询没有修读该课程的学生名字。表值函数就是返回一个表create function badstudent(@Cno char(3)) returns table as return ( select SName from Student where not exists(select ...
2018-04-20 15:00:07 959
原创 标量函数
题目:自定义一个函数,实现如下功能:对于一个给定的学生姓名,查询该姓名是否在Student表中,如果有两个或两个以上相同的名字,则返回-2,如果只有唯一名字,则返回该学生所修的总学分(及格才算有学分),如果没有该名字,则返回-1,然后编程调用该函数测试create function isexists_sname(@sname varchar(20)) returns int as be...
2018-04-20 14:56:23 1881
原创 L1-054. 福到了
思路用getline接收带空格的字符串,用字符串数组保存输入的内容,注意需要用getchar()把回车移除,否则getline会接收回车接下来就是判断和输出了#include<iostream>#include<string>using namespace std;//用string数组吧 int main() { int n; char c; cin>...
2018-04-20 12:32:54 127
原创 L2-027. 名人堂与代金券
#include<iostream>#include<string>#include<algorithm>using namespace std;//一个构造体保存账号,分数struct student { string id; int score;}; bool myCoop(student a, student b) { if(a.s...
2018-04-17 23:05:25 262
原创 L1-048. 矩阵A乘以B
水题不多解释#include<iostream>#include<string.h>using namespace std;int main() { int n1, m1, n2, m2; cin>>n1>>m1; int ju1[n1][m1]; for(int i = 0; i < n1; i++) for(int...
2018-04-17 21:48:43 86
原创 天梯赛——L1-009. N个数求和
#include<iostream>//输入n个分数//每输入一个数就往总数上加//最后再对总数约分和化简 //注意输出 using namespace std;int big(int a, int b) { if(a % b == 0) return b; if(b == 0) return a; else return big(b,...
2018-04-14 12:41:15 276
php73和拓展curl需要用到的dll
2019-01-13
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人