Codeforces-450D-Jzzhu and Cities+dji】的更多相关文章

#include<bits/stdc++.h> #define MAXN 100050 #define MAXM 900000 using namespace std; struct st { int id; long long dis; st(int a,long long b) { id=a; dis=b; } st(){}; }; struct edge{ bool im; int id; long long w; edge *next; }; edge *adj[MAXN]; edge…
题目描述: Jzzhu and Cities time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output Jzzhu is the president of country A. There are n cities numbered from 1 to n in his country. City 1 is the capital of…
[题目链接] https://codeforces.com/contest/449/problem/B [算法] 最短路 时间复杂度 : O(N ^ 2) [代码] #include<bits/stdc++.h> using namespace std; ; const int INF = 2e9; int n , m , k; int mark[MAXN]; long long dist[MAXN]; bool inq[MAXN]; vector< pair<int,int>…
输入一个无向图<V,E>    V<=1e5, E<=3e5 现在另外给k条边(u=1,v=s[k],w=y[k]) 问在不影响从结点1出发到所有结点的最短路的前提下,最多可以删除k条边的多少条 跑最短路的时候维护或者统计就好了 一开始用spfa.然后TLE 45...好久没写  Dij+堆优化   ... p.s.优先队列默认大顶堆 Dij+堆优化   264ms #include <cstdio> #include <cstring> #include…
D. Jzzhu and Cities time limit per test: 2 seconds memory limit per test: 256 megabytes input: standard input output: standard output Jzzhu is the president of country A. There are \(n\) cities numbered from \(1\) to \(n\) in his country. City \(1\)…
D. Jzzhu and Cities time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output Jzzhu is the president of country A. There are n cities numbered from 1 to n in his country. City 1 is the capital of A.…
堆优化dijkstra,假设哪条铁路能够被更新,就把相应铁路删除. B. Jzzhu and Cities time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output Jzzhu is the president of country A. There are n cities numbered from 1 to n in his co…
CF449B CF450D http://codeforces.com/contest/450/problem/D http://codeforces.com/contest/449/problem/B Codeforces Round #257 (Div. 2) D Codeforces Round #257 (Div. 1) B D. Jzzhu and Cities time limit per test 2 seconds memory limit per test 256 megaby…
CodeForces 450B Jzzhu and Sequences (矩阵优化) Description Jzzhu has invented a kind of sequences, they meet the following property: \[f_1=x\] \[f_2=y\] \[f_i=f_{i-1}+f_{i+1}\text {(i>2)}\] You are given x and y, please calculate fn modulo 1000000007 (10…
CF449B Jzzhu and Cities 其实这一道题并不是很难,只是一个最短路而已,请继续看我的题解吧~(^▽^) AC代码: #include<bits/stdc++.h> #define maxn 3000005 #define pa pair<long long,long long> #define inf 1000000000000000000ll using namespace std; long long n,m,k; struct edge{ long lon…