一、算法分析 当时比赛做的时候有点急躁,就首先考虑了三种情况,分别是砝码总重恰好为x,大于x和小于x.显然只有总重恰好为x的时候才会必然爆炸,否则都可以通过一定的方式进行规避。然后考虑如何安排顺序进行规避,如果总重小于x则显然随便安排都不会炸。但是如果总重大于x则就要考虑怎么安排了,思路如下: 先排 ...
分类:
其他好文 时间:
2021-05-23 23:40:03
阅读次数:
0
webpack Webpack 是一个前端资源的打包工具,它可以将js、image、css等资源当成一个模块进行打包。 好处: 将许多碎小文件打包成一个整体,减少单页面内的衍生请求次数,提高网站效率 将ES6的高级语法进行转换编译,以兼容老版本的浏览器 将代码打包的同时进行混淆,提高代码的安全性 核 ...
分类:
其他好文 时间:
2021-05-23 23:18:49
阅读次数:
0
题目 Atcoder 思路 代码 #include <iostream> #include <cstring> #include <algorithm> using namespace std; const int N = 4000010, mod = 1e9 + 7; int n, k, fact ...
分类:
其他好文 时间:
2021-05-23 23:13:50
阅读次数:
0
There is a function signFunc(x) that returns: 1 if x is positive. -1 if x is negative. 0 if x is equal to 0. You are given an integer array nums. Let ...
分类:
其他好文 时间:
2021-05-23 23:06:06
阅读次数:
0
很明显的拓扑 推一波: https://www.luogu.com.cn/blog/Hehe-0/p2017-dizzy-cows-g 1 #include<bits/stdc++.h> 2 3 4 using namespace std; 5 const int mmm=1e6+1; 6 7 in ...
分类:
其他好文 时间:
2021-05-23 23:01:52
阅读次数:
0
1.前端实现socketIO跨域: (1)vueconfig.js配置 const webpack = require("webpack"); module.exports = { configureWebpack: { resolve: { alias: { 'assets': "@/assets ...
分类:
其他好文 时间:
2021-05-23 22:57:37
阅读次数:
0
C# 数据类型与流程控制 1. 数据类型 C#数据类型分为两类:值类型和引用类型 值类型:包括简单类型、枚举类型、结构类型、可空类型 引用类型:包括类、接口、数组、委托。一般把引用类型的变量称为对象。 下文仅介绍部分数据类型 1.1 常量 const double pi = 3.14; 常量是在编译 ...
贪心。 经典活动安排问题。 注意点 不要忘记最后一个区间对最长连续挤奶时间区间的更新。 const int N=5010; PII a[N]; int n; int main() { cin>>n; for(int i=0;i<n;i++) cin>>a[i].fi>>a[i].se; sort(a ...
分类:
其他好文 时间:
2021-05-04 16:30:13
阅读次数:
0
最裸的暴力,时间复杂度:\(O(n^3)\)。 const int N=110; int a[3],b[3]; int n; bool check(int c[],int a[]) { for(int i=0;i<3;i++) if(abs(a[i]-c[i]) > 2 && abs(a[i]-c[ ...
分类:
其他好文 时间:
2021-05-04 16:12:32
阅读次数:
0
Course Schedule III (H) There are n different online courses numbered from 1 to n. You are given an array courses where courses[i] = [durationi, lastD ...
分类:
其他好文 时间:
2021-05-04 16:09:30
阅读次数:
0