ICode9

精准搜索请尝试: 精确搜索
  • POJ1681 Painter's Problem(高斯消元)2022-04-30 13:32:59

    题目看似与线性方程组无关,但可以通过建模转化为线性方程组的问题。 对于一块砖,刷两次是没有必要的,我们令x=1表示刷了一次,x=0没有刷,一共有n*n个,所以相当于有n*n个未知量x。 定义aij表示i和j的关系,是邻居则为1,否则是0;我们又用0表示黄色,1表示白色,一个方格最后的颜色,取决于它的初始颜

  • Freebuds Connnect Problem in the Windows2022-04-25 22:32:44

    Problem when you connect to windows platform, the freebus cannot play music. This is because you connect your phone and windows together. Because the bad design at first and the update of windows and android. The music switch between windows and android a

  • R语言马尔可夫链(Markov Chain, MC)模拟赌徒破产模型Gambler‘s Ruin Problem可视化2022-04-03 14:00:07

    原文链接:http://tecdat.cn/?p=26124  原文出处:拓端数据部落公众号 赌徒的破产问题是指玩家有获胜的概率p和失败的概率q。例如,让我们来看看一个技能游戏,玩家X可以通过接近目标,以0.6的概率击败玩家Y。游戏开始时,玩家X被分配到5分,玩家Y被分配到10分。每轮游戏后,玩家的积分要么减少

  • CF1446D2 Frequency Problem2022-03-19 12:02:52

    题面 给出 \(n(1≤n≤200000)\) 个元素组成的序列 \(a_1,a_2,...,a_n\) 求最长的子段使得其中有至少两个出现次数最多的元素。 输出最长子段长度。 题解 看到了没啥思路 让求的是满足众数个数 >1 的最长区间长度,然后这题有一个关于众数的性质,就是答案区间的众数一定包含序列的众数

  • 498. Diagonal Traverse2022-03-09 14:31:54

    This is a hard problem. If I got this problem the first time when I was interviewed, I would not be able to solve it. public int[] findDiagonalOrder(int[][] mat) { int m = mat.length, n = mat[0].length; int[] res = new int[m*n];

  • P1601 A+B Problem(高精)2022-03-09 09:00:54

    题目链接 https://www.luogu.com.cn/problem/P1601 题目思路 模板 题目代码 #include <iostream> #include <algorithm> #include <vector> using namespace std; vector<int> a, b; vector<int> add(vector<int> &a, vector<int> &b

  • P1303 A*B Problem2022-03-09 09:00:07

    题目链接 https://www.luogu.com.cn/problem/P1303 题目思路 模板题 题目代码 #include <iostream> #include <algorithm> #include <vector> using namespace std; vector<int> a, b; vector<int> mult(vector<int> &a, vector<int> &

  • LALP Assessment 32022-03-07 13:32:28

    LALP 3rd Continuous Assessment Q1 Suppose it makes \(x\) product A and \(y\) product B. Then the LP problem is: \[\text{Maximize}\quad 2.4 x+2.6 y, \\ \left\{\ \begin{array} 5 x+4 y\leq 160\\ 2 x+3 y\leq 85\\ x+2 y\leq 50 \end{array}

  • The 14th Jilin Provincial Collegiate Programming Contest2022-03-06 11:19:12

    The 14th Jilin Provincial Collegiate Programming Contest 目录The 14th Jilin Provincial Collegiate Programming ContestProblem A. ChordProblem B. Problem Select题解代码Problem C. String Game题解代码Problem D. TrieProblem E. Shorten the Array题解代码Problem F. Q

  • 1150 Travelling Salesman Problem (25 分)(图论)2022-02-27 17:04:10

    The “travelling salesman problem” asks the following question: “Given a list of cities and the distances between each pair of cities, what is the shortest possible route that visits each city and returns to the origin city?” It is an NP-hard problem in co

  • 2022/2/26DP专题赛总结2022-02-27 15:02:19

    赛题链接:动态规划专题测评(易) Problem A 众所周知,这一题考的是语文。 Problem B 几乎是区间DP的模板了; 只有一种特殊情况:当两个区间的首尾两位相同时,操作数取 \([start,end-1]\) 和 \([start+1,end]\) 中较小的那个就可以了; code: 点击查看代码 #include<bits/stdc++.h> usin

  • D. Yet Another Minimization Problem2022-02-26 09:32:45

    D. Yet Another Minimization Problem 题目大意: ​ 有两个长度相等的数组ab,可以将相同下标的ai,bi交换无限次。求以下式子的最小值。 $$ \sum_{i=1}^{n}\sum_{j = i+1}{n}(a_i+a_j)2+\sum_{i=1}^{n}\sum_{j = i+1}{n}(b_i+b_j)2 $$ 思路和代码: 这道题的关键就是化简该公式。因为a和

  • An easy problem2022-02-20 11:59:08

    An easy problem | JXNUOJ  翻译: 描述: 在这个问题中,你需要制作一个 N * N 的乘法表,就像样本一样。 第 i 行第 j 列的元素应该是 i 和 j 的乘积。 输入: 输入第一行是一个整数 C,表示测试用例的数量。 然后是 C 个测试用例。每个测试用例在上面提到的一行中包含一个整数 N (1<=N<

  • Yuuki and a problem (树套树)2022-02-10 12:58:32

    Yuuki and a problem 树状数组(线段树)套主席树,修改的部分会用到,算是积累一个带修主席树的板子 #include <bits/stdc++.h> #define inf 0x7fffffff #define ll long long //#define int long long //#define double long double #define re register int #define void inline

  • CF1618G Trader Problem2022-02-09 12:32:14

    原题链接 ← Click it 这题难产了快一个月终于决定要攻克下来 题目大意:现在你手里有\(n\)件物品,它们的价值分别是\(a_1,a_2,...,a_n\),你现在可以和一个商人交换物品,他有\(m\)件物品,价值分别为\(b_1,b_2,...,b_m\),价值为\(w\)的物品,最多可以与价值为\(w + k\)的物品交换,现在你有\(

  • Messager Problem(NOIOPJENGLISH20)2022-02-08 00:02:37

    Messager Problem https://acs.jxnu.edu.cn/problem/NOIOPJENGLISH20  1000ms  65536K 描述: There are N nodes in the graph. Given the length of edges between the nodes, find the shortest path of size N and the nodes in the path are all different. 图上有n个节点

  • 【做题笔记】CF776D The Door Problem2022-02-05 22:31:46

    Problem CF776D The Door Problem 题目大意: 有 \(n\) 扇门和 \(m\) 把钥匙,初始时有些门开着,有些门关着。一把钥匙对应多个门,每个门对应恰好两把钥匙。使用一把钥匙会使该钥匙对应的所有门的状态改变(开变成关,关变成开),问是否有存在一种钥匙的使用方案使得所有门都被打开。 Solution

  • The Castle(题目地址链接:https://acs.jxnu.edu.cn/problem/NOIOPJCH0205166)2022-02-05 12:02:04

    描述:      1   2   3   4   5   6   7      #############################  1 #   |   #   |   #   |   |   #    #####---#####---#---#####---#  2 #   #   |   #   #   #   #   #    #---

  • 【CF1626F】A Random Code Problem2022-02-05 11:32:02

    传送门 好题。 题目分析: 首先,总方案数有 \(n^k\) 种,每种的概率都是均等的,为 \(\frac{1}{n^k}\),即 \(E=\frac{1}{n^k}\sum w\),而我们最后要输出 \(n^kE\),那么只用求 \(\sum w\),即所有方案的 \(ans\) 总和。 如果没有修改,那么所求即为 \(kn^{k-1}\sum a\),这是因为 \(n^k\) 种方案,每

  • 647. Palindromic Substrings2022-02-03 11:02:29

    This is a "palindromic" problem, I think DP can solve this problem, but there is a easier way to solve it, the time complexity is O(n2): private int res = 0; public int countSubstrings(String s) { for(int i=0;i<s.length();i++

  • UVA201 正方形 Squares 题解2022-02-02 23:33:22

    输入输出格式 输入格式 输入包含了多个游戏棋盘。每个棋盘包含了 n^2 个点的正方形矩阵 (其中 2 ≤ n ≤ 9),以及一些起连接作用的横向或纵向的线段。棋盘的的 n^2 个点和 m 条连接线段,格式如下: 第 1 行:n,表示矩阵中单行或单列的点的数目 第 2 行:m,表示连接线段的数目 接下来的

  • 1783 Problem A 完数2022-02-01 20:31:27

    题目描述 求1-n内的完数,所谓的完数是这样的数,它的所有因子相加等于它自身,比如6有3个因子1,2,3,1+2+3=6,那么6是完数。即完数是等于其所有因子相加和的数。 输入 测试数据有多组,输入n,n数据范围不大。 输出 对于每组输入,请输出1-n内所有的完数。如有案例输出有多个数字,用空格隔

  • 1067 Problem A2022-01-30 17:03:34

    题目描述 我们定义如下矩阵: 1/1 1/2 1/3 1/2 1/1 1/2 1/3 1/2 1/1 矩阵对角线上的元素始终是1/1,对角线两边分数的分母逐个递增。 请求出这个矩阵的总和。 输入 输入包含多组测试数据。每行给定整数N(N<50000),表示矩阵为N*N。当N=0时,输入结束。 输出 输出答案,结果保留2位小数。

  • Another Sorting Problem2022-01-30 16:34:01

    #include<bits/stdc++.h> using namespace std; struct stu{ string s; int num; }a[1000005]; int cmp(stu a,stu b){ return a.s<b.s; } int main(){ int n,m; scanf("%d %d",&n,&m); for(int i=1;i<=n;i++){

  • CF1175G Yet Another Partiton Problem2022-01-30 13:31:50

    CF1175G Yet Another Partiton Problem。 非常有启发性和挑战性的题目,超高难度斜率优化。建议先学习 DP 优化 II 斜率优化部分 以及 线段树的高级用法 李超树部分。 2D/1D 动态规划首先考虑决策单调性分治,但是没有决策单调性,因为贡献函数不满足四边形不等式:如当 \(a = \{10, 1, 10

专注分享技术,共同学习,共同进步。侵权联系[81616952@qq.com]

Copyright (C)ICode9.com, All Rights Reserved.

ICode9版权所有