ICode9

精准搜索请尝试: 精确搜索
  • CF1515F Phoenix and Earthquake2021-11-15 09:35:29

    https://www.luogu.com.cn/problem/CF1515F 首先必须保证 s u m a [ i ]

  • 「ABC221」A - Seismic magnitude scales 题解2021-10-04 17:03:34

    A - Seismic magnitude scales Time Limit: \(2\; sec\) / Memory Limit: \(1024\; MB\) Score : \(100\; points\) Problem Statement|题目描述 The magnitude of an earthquake is a logarithmic scale of the energy released by the earthquake. It is known that

  • P4951 [USACO01OPEN]Earthquake2021-09-03 17:33:05

    度限制最小生成树 就是01分数规划,裸的。 #include<bits/stdc++.h> using namespace std; #define orz cout<<"lytcltcltcltcltcltcl"<<endl inline int r(){int s=0,k=1;char c=getchar();while(!isdigit(c)){if(c=='-')k=-1;c=getchar();}while(isdigi

  • [USACO09JAN]Earthquake Damage2021-05-29 19:06:59

    嘟嘟嘟   刚开始因为没看到只能走没有损坏的农场,磨叽了20多分钟……不管了,写题解吧。 首先如果一个点不能到达原点,那么和他相邻的点也不能到达原点,所以刚开始我们把不能走的点和他相邻的点都打上标记,然后跑dfs就行了。   1 #include<cstdio> 2 #include<iostream> 3 #inclu

  • P4951 Earthquake 经典题目 /01分数规划小记2021-03-13 09:04:08

    01分数规划。 和最优比率生成树比较相似。 设选了的边集为\(S\),答案为\(k\)则有: \(k\leq \frac{f-\sum_{i \in S}c_i}{\sum_{i \in S}t_i}\) 移项得: \(f-\sum_{i \in S}{c_i-k*t_i} \ge 0\) 我们发现: 对于\(k\)的取值\(k_1\)和\(k_2\),当\(k_1 > k_2\)时,\(k_1\)满足上面的式子

  • BZOJ-2987 Earthquake(类欧几里得算法)2020-12-01 19:05:43

    题目描述   给定 \(A,B,C\),求满足方程 \(Ax+By\leq C\) 的 非负 整数解 \((x,y)\)(\(A,B\leq 10^9,C\leq \min(A,B)\times 10^9\))。 分析   考虑枚举 \(y\),移项得:\(0\leq y\leq \lfloor\frac{C-Ax}{B}\rfloor\),当 $ x=0$ 时,\(y\) 枚举的上界为 \(\lfloor\frac{C}{A}\rfloor\)。

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

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

ICode9版权所有