丽娃河的狼人传说 Time limit per test: 1.0 seconds Time limit all tests: 1.0 seconds Memory limit: megabytes 丽娃河是华师大著名的风景线.但由于学校财政紧缺,丽娃河边的路灯年久失修,一到晚上就会出现走在河边要打着手电的情况,不仅非常不方便,而且影响安全:已经发生了大大小小的事故多起. 方便起见,丽娃河可以看成是从 到 n 的一条数轴.为了美观,路灯只能安装在整数点上,每个整数点只能安装一盏路灯.经专业勘测,…
丽娃河的狼人传说 Time limit per test: 1.0 seconds Memory limit: 256 megabytes 丽娃河是华师大著名的风景线.但由于学校财政紧缺,丽娃河边的路灯年久失修,一到晚上就会出现走在河边要打着手电的情况,不仅非常不方便,而且影响安全:已经发生了大大小小的事故多起. 方便起见,丽娃河可以看成是从 1 到 n 的一条数轴.为了美观,路灯只能安装在整数点上,每个整数点只能安装一盏路灯.经专业勘测,有 m 个区间特别容易发生事故,所以至少要安装一定数量的…
一定要纪念一下第一道在比赛中自己做出来的贪心. 题目链接:http://acm.ecnu.edu.cn/problem/3263/ Time limit per test: 1.0 seconds Time limit all tests: 1.0 seconds Memory limit: 256 megabytes 丽娃河是华师大著名的风景线.但由于学校财政紧缺,丽娃河边的路灯年久失修,一到晚上就会出现走在河边要打着手电的情况,不仅非常不方便,而且影响安全:已经发生了大大小小的事故多起. 方…
链接:http://acm.ecnu.edu.cn/problem/3263/ 题意: 从 1 到 n 的一条数轴.有 m 个区间至少要安装一定数量的路灯,路灯只能装在整数点上,有k盏路灯已经安装好 ,现在求最少需要安装多少盏路灯. 分析: 一开始我的想法是按重叠部分给数轴每个整数点一个优先级,然后在区间中优先度高的先补灯.但比赛中无论如何都是WA,最后找出错误是因为这样补灯优先级相同时候他会按顺序补灯. 最后看题解发现他是根据右端点升序排序进行处理,然后不满足的话尽量往右边补灯,因为如果按右端…
差分约束系统,$spfa$. 首先判断无解,若某个约束的$t$大于区间长度,则一定无解. 否则一定有解,可以得到一系列的不等式: 最终区间和大于等于目前的区间和:$S[R]-S[L-1]≥val$, 每一个位置的值小于等于$1$:$S[R]-S[R-1]≤1$, 每一个约束条件:$S[R]-S[L-1]≥t$, 最终是要求$S[n]-S[0]$最小是多少,扔进差分约束系统,跑$S[0]$到$S[n]$的最长路即可. #include <cstdio> #include <cmath>…
传送门 题意 分析 考虑将区间按右端点排序,再遍历区间,操作即可 建议以加方式写 trick 1.不需要判区间重合 代码 #include<cstdio> #include<cstring> #include<algorithm> using namespace std; int t; int n,m,k; int a[1010]; struct node { int l,r,num; bool operator<(const node &p)const…
题目链接:http://poj.org/problem?id=3468 A Simple Problem with Integers Time Limit: 5000MS   Memory Limit: 131072K Total Submissions: 56005   Accepted: 16903 Case Time Limit: 2000MS Description You have N integers, A1, A2, ... , AN. You need to deal with…
A Simple Problem with Integers [题目链接]A Simple Problem with Integers [题目类型]线段树 成段增减+区间求和 &题解: 线段树 成段增减+区间求和 模板题 这种题真的应该理解并且可以流畅的独立码出来了 [时间复杂度]\(O(nlogn)\) &代码: #include <iostream> #include <cstdio> #include <cstring> using namespa…
称号: You can Solve a Geometry Problem too Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others) Total Submission(s): 145 Accepted Submission(s): 100   Problem Description Many geometry(几何)problems were designed in the ACM/IC…
I'm using keras 2.1.* with tensorflow 1.13.* backend. I save my model during training with .h5 format and after that I convert it into protobuf (.pb) model. Everything looks good during converting process, but the result of tensorflow model is a bit…