ICode9

精准搜索请尝试: 精确搜索
  • JSON——学习笔记2019-08-03 21:08:53

    1.简介 json的全称是JavaScript Object Notation,是一种数据交换格式,独立于编程语言,可以用来存储数据,优点是非常利于人类阅读和编写,同时也利于机器的解析和生成,同时还可以提升网络传输效率。 json的数据格式是以名-值对的方式存储的,可以将其看做是一个字符串,下面就是一个jso

  • LeetCode 1135. Connecting Cities With Minimum Cost2019-08-01 09:50:29

    原题链接在这里:https://leetcode.com/problems/connecting-cities-with-minimum-cost/ 题目: There are N cities numbered from 1 to N. You are given connections, where each connections[i] = [city1, city2, cost] represents the cost to connect city1 and city2to

  • codeforces723E2019-07-15 15:01:29

    One-Way Reform  CodeForces - 723E  There are n cities and m two-way roads in Berland, each road connects two cities. It is known that there is no more than one road connecting each pair of cities, and there is no road which connects the city with itself.

  • CF1062F Upgrading Cities2019-06-16 17:00:53

    http://codeforces.com/problemset/problem/1062/F 题解 有意思的题。 首先考虑在\(DAG\)上拓扑的过程,设当前队列中的点集为\(S\),那么有结论是这些点之间都不能互相到达,这个比较好理解。 那么我们考虑在弹出一个点的时候计算它能够到达多少点,如果当前队列里有超过一个点,那它肯定就

  • CF449B jzzhu and cities 最短路2019-06-08 19:49:09

    CF449B jzzhu and cities 最短路 题目:…… 第一次做的想法: 就是不考虑附加边,求一次最短路,结果就是由多少dis[i]<=teshu[i](1到I特殊边的边长),如果一个点不被影响,则其松弛的节点也不被影响,所以就这样就可以了 发现有误:附加边有可能松弛某些点 更改:每次松弛时用min(dis[i],teshu

  • 【最短路】CF449B Jzzhu and Cities2019-06-08 19:48:19

    【题目描述】 CF449B Jzzhu and Cities 【分析】 题意:n个点,m条带权边的无向图,其中有k条特殊边连接1和i 问最多能删除多少条特殊边,能使每个点到1的最短距离不变 解答:直接在原图上跑最短路,得到dis[x]表示x到1的最短路。 对于每个用特殊边k连接的点i,如果dis[x]<w[k],那么k可以

  • Survey lists 10 most innovative cities2019-05-28 19:52:50

    From China Daily Beijing and Shanghai are among the 10 most innovative cities in the world, based on published articles in leading academic journals, a survey released on Friday said. The reported by the Shanghai Institute for Science of Science and Sprin

  • PAT_A1150#Travelling Salesman Problem2019-05-16 20:38:44

    Source: PAT A1150 Travelling Salesman Problem (25 分) Description: 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 t

  • hdu2876 Connections between cities2019-05-04 17:38:12

    图不一定联通,所以用并查集找各个联通块的祖先分别建图,之后就和LCA的步骤差不多了 #include<iostream>#include<cstring>#include<algorithm>#include<cmath>#include<algorithm>#include<vector>using namespace std;inline int read(){ int sum=0,x=1; char ch=getchar();

  • PAT(甲级)1030.Travel Plan(30)2019-04-10 20:47:38

    PAT 1030.Travel Plan(30) A traveler’s map gives the distances between cities along the highways, together with the cost of each highway. Now you are supposed to write a program to help a traveler to decide the shortest path between his/her starting city a

  • 1013 Battle Over Cities2019-04-08 15:49:00

    1013 Battle Over Cities (25 分) It is vitally important to have all the cities connected by highways in a war. If a city is occupied by the enemy, all the highways from/toward that city are closed. We must know immediately if we need to repair any other

  • PTA 1013 Battle Over Cities2019-03-31 19:51:38

    #include <iostream> #include <stdio.h> #include <string.h> using namespace std; int graph[1010][1010]={0}; int visited[1010] = {0}; int check[1010] = {0}; int N,M,K; void DFS(int i) { visited[i] = 1; for(int j = 1;j<=N;j++)

  • codeforces703B2019-03-31 19:48:42

    Mishka and trip  CodeForces - 703B  小米什卡是一个伟大的旅行者,她访问了许多国家。在这次考虑去哪里旅行之后,她选择了XXX--这个美丽,但鲜为人知的北方国家。 以下是关于XXX的一些有趣事实: XXX由n个城市组成,其中k个(只是想象!)是省会城市。 这个国家的所有城市都很漂亮,但每个城

  • [ Codeforces Round #549 (Div. 2)][D. The Beatles][exgcd]2019-03-31 11:50:30

    https://codeforces.com/contest/1143/problem/D D. The Beatles time limit per test1 second memory limit per test256 megabytes inputstandard input outputstandard output Recently a Golden Circle of Beetlovers was found in Byteland. It is a circle route

  • AtCoder Beginner Contest 049 & ARC065 連結 / Connectivity AtCoder - 2159 (并查集)2019-03-26 20:44:59

    Problem Statement   There are N cities. There are also K roads and L railways, extending between the cities. The i-th road bidirectionally connects the pi-th and qi-th cities, and the i-th railway bidirectionally connects the ri-th and si-th citie

  • Java中的数组数据结构需要了解的要点2019-03-14 11:56:32

    . 首先,数组是Java中的对象。它们不是像int、short或long这样的基本类,也不是具有很多方法的全功能对象,但由于它们是对象,所以它们隐式地扩展了Object,这就是为什么可以使用数组引用(例如toString())调用java.lang.object的任何方法。 Java中数组的另一个重要之处是,一旦创建,就不能更改数

  • 1013 Battle Over Cities (25 分)2019-03-12 16:50:17

    1013 Battle Over Cities (25 分) It is vitally important to have all the cities connected by highways in a war. If a city is occupied by the enemy, all the highways from/toward that city are closed. We must know immediately if we need to repair any other hi

  • Java8 将List转变为逗号分隔的字符串2019-03-05 18:51:46

    import java.util.Arrays; import java.util.List; import java.util.stream.Collectors; public class Test { /** * 将List转变为逗号分隔的字符串 * * @param args */ public static void main(String[] args) { /** * JDK8 */ List<String> cities

  • BZOJ 5180 [Baltic2016]Cities(斯坦纳树)2019-02-26 14:04:24

    include include include include include include using namespace std; define int long long const int INF=1e16; const int N=101000; const int M=201000; struct edge{ int to,nxt,w; }e[M*2]; int cnt,head[N]; void add_edge(int u,int v,int w){ cnt++; e[cnt].nxt=

  • 二.Vue2.5开发去哪儿网app城市列表页④——字母表随下拉而变换(兄弟组件间的联动)2019-02-24 18:50:40

    当我们处理兄弟组件时,可以让一个组件的数据给父组件,然后让父组件的这个数据传递给另一个组件 设置Alphabet子组件,当其一个字母被点击时向外触发一个change事件,并携带它的文本内容 <template> <ul class="list"> <li class="item" v-for="(item, key) of cities" :key="ke

  • Wunder Fund Round 2016 (Div. 1 + Div. 2 combined) D. Hamiltonian Spanning Tree2019-02-22 19:37:29

    time limit per test2 seconds memory limit per test256 megabytes inputstandard input outputstandard output A group of n cities is connected by a network of roads. There is an undirected road between every pair of cities, so there are roads in total. It tak

  • js 把数组中每个元素的某个字段取出2019-02-22 16:01:57

    方法一:map() let cities = [   {city:"北京",bOn:false},  {city:"上海",bOn:false},  {city:"重庆",bOn:false},  {city:"广州",bOn:false},  {city:"西安",bOn:false}];  let city = cities.map((item) =>{    return item.ci

  • SPOJ - HIGH :Highways (生成树计数)2019-02-17 22:02:07

    Highways 题目链接:https://vjudge.net/problem/SPOJ-HIGH Description: In some countries building highways takes a lot of time... Maybe that's because there are many possiblities to construct a network of highways and engineers can't make up their mind

  • PAT A1013 Battle Over Cities (25 分)2019-02-15 13:00:08

    It is vitally important to have all the cities connected by highways in a war. If a city is occupied by the enemy, all the highways from/toward that city are closed. We must know immediately if we need to repair any other highways to keep the rest of the

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

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

ICode9版权所有