自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(40)
  • 收藏
  • 关注

原创 CCF202009-2风险人群筛查

#include <bits/stdc++.h>using namespace std;int main(){int n,k,t,x1,y1,x2,y2;cin >> n >> k >> t >> x1 >> y1 >> x2 >> y2;int ans1 = 0;int ans2 = 0;for(int i = 0;i < n;i++){bool flag = false;vector

2020-10-16 17:25:31 173

原创 CCFCSP 送货(70)

#include<iostream>#include<queue>#include <bits/stdc++.h>using namespace std;int n,m;const long long INF = 1e9;vector<int> g[10005];bool visited1[10005][10005];bool flag = false;int ans1[100005];void dfs(int x,int temp[],

2020-09-02 15:25:25 181

原创 CCFCSP201903-3 试题名称: 损坏的RAID5(不知道为啥就过了)

#include <bits/stdc++.h>using namespace std;string temps[1005];int main(){ ios::sync_with_stdio(0); int n,s,l;cin >> n >> s >> l; for(int i = 0;i < l;i++){ int t;cin >> t; cin >> temps[t]; } int m;cin >

2020-08-31 17:44:15 214 1

原创 2019计算机学科夏令营上机考试:跳蛙

#include <iostream>#include <string.h>using namespace std;int main(){ int n; string s; while(cin >> n){ if(n == 0) break; cin >> s; if(n == 2){ cout << "N"; cont

2020-08-26 22:58:17 398

原创 ccf 201903-5 317号子任务【60分】

#include<bits/stdc++.h>using namespace std;struct node{ int u; int x;};vector<node> g[10005];int n,m,k;vector<int> ju_dian;long long dis1[10005];vector<long long> dis2[10005];bool visited[10005];const long long INF

2020-08-21 18:24:37 175

原创 pat1103

#include <bits/stdc++.h>using namespace std;int n,k,p;int r;void init(){ for(int i = 1;i <= 20;i++){ int temp = 1; for(int j = 0;j < p;j++){ temp *= i; } if(temp >= n){ r = i;

2020-08-20 14:30:03 105

原创 CCFCSP压缩编码

#include<iostream>#include<vector>#include<queue>#include<cstdio>using namespace std;int n;const int INF = 999999999;int a[1005];int dp[1005][1005];int sum[1005];int main(){ cin >> n; for(int i = 1;i <= n

2020-08-19 12:21:55 304

原创 CCF CSP 201312-5 试题名称: I’m stuck!

#include<bits/stdc++.h>using namespace std;char maze[105][105];bool visited[105][105];int xx[10] = {1,-1,0,0};int yy[10] = {0,0,1,-1};int n,m;struct node{ int x; int y;};vector<node> t;bool flag = false;void bfs(int x,int y,i

2020-08-11 10:22:50 358

原创 试题编号: 201403-4 试题名称: 无线网络

#include<bits/stdc++.h>using namespace std;struct node{ long long x; long long y; int step; int rest_k;};bool visited[1005];int xx[1005];int yy[1005];int sx,sy,fx,fy;int main(){ ios::sync_with_stdio(0); long long r;

2020-08-09 09:59:21 248 1

原创 CCF CSP 201403-2 试题名称: 窗口

#include<bits/stdc++.h>using namespace std;int maze[2600][1500];int x1[15];int y1[15];int x2[15];int y2[15];int main(){ ios::sync_with_stdio(0); int n,m;cin >> n >> m; for(int i = 1;i <= n;i++){ int a,b,c,d;c

2020-08-09 09:33:20 194

原创 ccf2016-09-04

#include<bits/stdc++.h>using namespace std;struct node{ int u; int dis;};bool visited[100005];const int INF = 99999999;int dis[100005];int cost[100005];vector<node> g[1000005];int n,m;void spfa(){ for(int i = 0;i < n;i+

2020-07-21 17:57:19 100

原创 ccf201609-2

#include<bits/stdc++.h>using namespace std;bool visited[1005];int main(){ ios::sync_with_stdio(0); int n; cin >> n; for(int i = 0;i < n;i++){ int t; cin >> t; bool flag = false; for(in

2020-07-21 17:02:58 137

原创 2016-12-3 ccf 权限查询

#include<bits/stdc++.h>using namespace std;set<string> private_names;set<string> private_levels;struct role{ set<string> private1; map<string,int> private2;};map<string,role> map1;map<string,vector<.

2020-07-20 14:47:26 109

原创 数据库乱码问题

driverClassName=com.mysql.jdbc.Driverurl=jdbc:mysql://127.0.0.1:3306/day17?characterEncoding=utf-8(一定注意配置文件后面应该加这一句话,否则有可能会出现乱码问题)username=rootpassword=11235fbnqinitialSize=5maxActive=10maxWait=3000minIdle=3...

2020-06-30 21:40:59 121

原创 深入理解Java String类

String类

2020-04-27 10:46:16 135

原创 CCFCSP推荐系统

此题有一个大坑id范围为1e9此题题意是按照同类按照价格大小从大到小输出,如果价格相等再按照id从小到大输出。​#include<bits/stdc++.h>using namespace std;struct node{ int id; int score; int type; int sell; bool friend oper...

2020-04-24 16:53:54 314

原创 正则表达式替换标点符号,求字符串中指定字符串出现次数

求字符串中指定字符串出现次数利用indexof函数 返回指定字符串第一次出现的位置for(int i = 1;i < chapters.length;i++) { String content = chapters[i]; int temp = content.indexOf(str,0); while(temp != -1) { ans[i-1]++; ...

2020-04-16 18:25:41 333

原创 LCA的递归求法

leetcode236如果root=null return NULL如果root等于任意一个寻找的节点返回root如果LCA不在左子树上返回右子树结果如果LCA不在右子树上返回左子树结果如果既在左子树又在右子树上返回rootclass Solution {public: TreeNode* lowestCommonAncestor(TreeNo...

2020-04-15 17:09:51 205

原创 CCF通信网络

每个点能达到的点数为n-1,那么这个点就满足条件。此题目有环因此设置一个maze[1005][1005]判断之前a到b是否已经基数,也可不设判断tt[a]+tt[b] >= n - 1;此题与poj3660相似poj3360(vj上的)#include<iostream>#include <map>#include <vector>#i...

2020-04-11 18:38:50 222

原创 java中==和equals

Java中的==和equals还有String.intern()

2020-04-09 23:39:05 99

原创 pat1131

#include<iostream>#include<algorithm>#include<map>#include<vector>#include<string.h>#include<cmath>#include<cstdio>#include<queue>using namespa...

2020-04-08 17:18:44 149

原创 ccf 201803-2 碰撞的小球

戳这里不可能会有三个小球碰撞。#include <bits/stdc++.h>using namespace std;const int INF = 999999999;struct node{ int x; int b; int pos;};node a[1005];bool cmp1(node a,node b){ retur...

2020-03-28 11:18:36 103

原创 不用sqrt如何在C语言中开平方

迭代法求a的平方根:temp=a/temp时,temp为其平方根,计算机上表示当两者差小于10的负6次方,<1e-6,认为他们相等,temp 和 a/temp 分别位于a的平方根的两头,一个大于,一个小于,取两者的平均值进行迭代。void main(){int a;scanf("%d",&a);float temp=1;while(abs(temp-a/temp)...

2020-03-26 21:21:24 1751

原创 hdu1530 最大团裸题

```cpp#include <bits/stdc++.h>using namespace std;int g[100][100];int n,ans;int temp[100];bool ok(int x,int currentlevel){    for(int i = 1;i <= currentlevel;i++){&nbs...

2019-10-30 20:36:30 129

原创 百炼oj 1817 城堡问题

&运算 按位与 3&1 = 1 011&001 = 001 = 1此题中若maze[x][y] & 1 == 0 则 maze[x][y] 有西墙同理可推得其他#include <iostream>#include <map>#include <queue>#include &l...

2019-08-10 16:10:51 219

原创 百炼3258 最小新整数

#include <iostream>#include <map>#include <queue>#include <string.h>#include <algorithm>#include <cmath>using namespace std;const int INF = 99999999;const ...

2019-08-10 15:23:28 127

原创 poj1094 Sorting It All Out(拓扑排序)

Sorting It All OutTime Limit: 1000MS Memory Limit: 10000K Total Submissions: 42094 Accepted: 14742 DescriptionAn ascending sorted sequence of distinct values is one in which so...

2019-08-09 11:03:31 127

原创 百炼oj 48:移动办公

48:移动办公查看 提交 统计 提问总时间限制:1000ms内存限制:65536kB描述假设你经营着一家公司,公司在北京和南京各有一个办公地点。公司只有你一个人,所以你只能每月选择在一个城市办公。在第i个月,如果你在北京办公,你能获得Pi的营业额,如果你在南京办公,你能获得Ni的营业额。但是,如果你某个月在一个城市办公,下个月在另一个城市办公,你需要支付M的交通费。...

2019-08-08 14:36:43 1380 3

原创 百炼1064 1064:网线主管

总时间限制:1000ms内存限制:65536kB描述仙境的居民们决定举办一场程序设计区域赛。裁判委员会完全由自愿组成,他们承诺要组织一次史上最公正的比赛。他们决定将选手的电脑用星形拓扑结构连接在一起,即将它们全部连到一个单一的中心服务器。为了组织这个完全公正的比赛,裁判委员会主席提出要将所有选手的电脑等距离地围绕在服务器周围放置。为购买网线,裁判委员会联系了当地的一个网络解...

2019-08-08 10:27:58 179

原创 poj1860 floyd变形

//坑点在于要使用两次floyd因为可能存在不是起始货币的环#include <iostream>#include <algorithm>#include <cmath>#include <cstdio>#include <string.h>#include <algorithm>#include &lt...

2019-08-06 16:47:14 161

原创 百炼Noi 热血格斗场

#include <iostream>#include <algorithm>#include <cmath>#include <cstdio>#include <string.h>#include <algorithm>#include <map>using namespace std;cons...

2019-08-06 14:30:30 142

原创 poj1062 2019 H

#include <iostream>#include <map>#include <queue>#include <string.h>using namespace std;const int INF = 9999999;int maze[105][105];int value[305];int level[305];bool ...

2019-08-03 14:29:19 107

原创 上交oj1219 2018计算机学科夏令营上机考试 E:重要逆序对

http://bailian.openjudge.cn/xly2018/E/#include <bits/stdc++.h>using namespace std;int visited[30];long long ans = 0;int n;int a[500005];int temp[500005];void Merge(int a[],int l1,int r...

2019-08-01 11:03:50 429

原创 百炼2988:计算字符串距离

2988:计算字符串距离查看 提交 统计 提问总时间限制:1000ms内存限制:65536kB描述对于两个不同的字符串,我们有一套操作方法来把他们变得相同,具体方法为:修改一个字符(如把“a”替换为“b”) 删除一个字符(如把“traveling”变为“travelng”)比如对于“abcdefg”和“abcdef”两个字符串来说,我们认为可以通过增加/减...

2019-07-31 09:51:35 135

原创 poj1323 贪心

#include <iostream>#include <algorithm>#include <cstdio>#include <string.h>#include <vector>using namespace std;const int INF = 99999999;int n,k;int a[1005];boo...

2019-07-30 16:48:36 101

原创 poj2392多重背包

#include <iostream>#include <algorithm>#include <cstdio>#include <string.h>using namespace std;const int INF = 99999999;struct node{ int x; int y; int z;};...

2019-07-30 13:27:58 133

原创 hihocoder 1969 等差数列暴力

#include <iostream>#include <string.h>#include <algorithm>#include <vector>using namespace std;int a[100005];int ha[1000005];//int ans[5005];int main(){ ios::sy...

2019-07-28 16:20:59 135

原创 codeforces1130B 贪心

#include <iostream>#include <string.h>#include <algorithm>using namespace std;struct node{ int x; int pos;};node a[1000005];bool cmp(node a,node b){ if(a.x != b....

2019-07-28 13:42:50 126

原创 POJ1481 The Die Is Cast (bfs+bfs)

http://poj.org/showmessage?message_id=159857巨佬的测试数据 我的第二组数据在每加那个之前有0‘

2019-07-27 21:10:29 151

原创 hihocoder 1722

#include <iostream>#include <string.h>#include <algorithm>using namespace std;struct node{    int x;    int pos;};bool cmp(node a,node b){&nbsp...

2019-07-27 13:47:08 165

空空如也

空空如也

TA创建的收藏夹 TA关注的收藏夹

TA关注的人

提示
确定要删除当前文章?
取消 删除