https://open.kattis.com/problems/researchproductivityindex 这道题是考场上没写出来的一道题,今年看看感觉简单到不像话,当时自己对于dp没有什么概念,所以导致考场只能空流泪 首先问期望,肯定就要确定概率.看到这个 就知道肯定一块求是不太好写的,先求上面,上面求发表的期望,那么对于期望我们有e(x) = Σxipi 这里p知道了但是xi不知道,那么我们根据题目描述我们有一个分子一个分母,分子是发表的次数,分母是论文数,首先对于任何j篇论文发表…
题目描述 Peter returned from the recently held ACM ICPC World finals only to find that his return flight was overbooked and he was bumped from the flight! Well, at least he wasn’t beat up by the airline and he’s received a voucher for one free flight bet…
题目大意: 输入n,有n个地方(1~n)需要送pizza pizza点为0点 接下来n+1行每行n+1个值 表示 i 到 j 的路径长度 输出从0点到各点送pizza最后回到0点的最短路(点可重复走) Sample Input 30 1 10 101 0 1 210 1 0 1010 2 10 00 Sample Output 8 #include <bits/stdc++.h> #define INF 0x3f3f3f3f using namespace std; ][],dp[][]; /…
https://icpc.baylor.edu/regionals/finder/north-america-qualifier-2015 一个人打.... B 概率问题公式见代码 #include <cstdio> #include <cstring> #include <iostream> #include <queue> #include <stack> #include <vector> #include <algori…
0.起因 有时.DFS总是比BFS受人喜爱--毕竟DFS简单粗暴,更,而有些东西BFS不要启动,DFS它似乎是一个可行的选择-- 但是有一个问题,DFS默认直接写入到系统堆栈.系统堆栈和足够浅,此时OI传统的方法是通过手工叠写,acm究一下旁门左道--开栈外挂. Uva上的神贴(Set heap size and stack size in C++,http://acm.uva.es/board/viewtopic.php?f=14&t=16685)里面提到了一个拓栈外挂: #include &l…
Then n - 1n−1 lines follow. ii-th line contains two integers f_{a_i}(1 \le f_{a_i} < i)fai​​(1≤fai​​<i), w_i(0 \le w_i \le 10^{18})wi​(0≤wi​≤1018) —The parent of the ii-th node and the edge weight between the ii-th node and f_{a_i} (ifai​​(istart fr…
Miku is matchless in the world!” As everyone knows, Nakano Miku is interested in Japanese generals, so Fuutaro always plays a kind of card game about generals with her. In this game, the players pick up cards with generals, but some generals have con…
Problem G. Garden Gathering Input file: standard input Output file: standard output Time limit: 3 seconds Memory limit: 512 megabytes Many of you may have been to St. Petersburg, but have you visited Peterhof Palace? It is a collection of splendid pa…
目录 ACM ICPC China final G Pandaria ACM ICPC China final G Pandaria 题意:给一张\(n\)个点\(m\)条边的无向图,\(c[i]\)代表点\(i\)的颜色,每条边有一个权值 现在有q个询问如下 u w代表从点u出发,每次只能走权值不超过w的边,经过的颜色中次数最多的是哪种颜色,若有多种,输出编号最小的. $ 1<=n<=1e5$ $ 1<=m,q<=2e5$ $ 1<=c_i<=n$ $ 1<=w…
比赛链接: http://202.197.224.59/OnlineJudge2/index.php/Contest/problems/contest_id/36 题目来源: 2014嘉杰信息杯ACM/ICPC湖南程序设计邀请赛暨第六届湘潭市程序设计竞赛 ×  Problem A A simple problem   (求N % 1 + N % 2 + ....+ N % N, 待补) ?  Problem B Path √  Problem C Range   (单调栈) √  Problem…