UVA 11176 Winning Streak】的更多相关文章

#include <iostream> #include <stdio.h> #include <cstring> #define N 501 using namespace std; int n; double p; double pa[N][N]; double pow[N]; void Init() { memset(pa,,sizeof(pa)); pow[]=; ;i<N;i++) { pow[i] = pow[i-]*p; } } void Do()…
题目 Volume 0. Getting Started 开始10055 - Hashmat the Brave Warrior 10071 - Back to High School Physics 10300 - Ecological Premium 458 - The Decoder 494 - Kindergarten Counting Game 414 - Machined Surfaces 490 - Rotating Sentences 445 - Marvelous Mazes…
题目大意:给一个序列,求最大连续和. 用sum[i]表示前i个元素之和,那么以第i个元素结尾的最大连续和就是sum[i]-sum[j] (j<i)的最大值,也就是找前i-1个位置sum[]的最小值,因此只需要扫描一次数组,维护目前遇到的最小sum即可. #include <cstdio> #include <algorithm> using namespace std; int main() { #ifdef LOCAL freopen("in", &qu…
import news_cnn_model import numpy as np import os import pandas as pd import pickle import shutil import tensorflow as tf from sklearn import metrics learn = tf.contrib.learn REMOVE_PREVIOUS_MODEL = True MODEL_OUTPUT_DIR = '../model/' DATA_SET_FILE…
TEXT 87 Fund management基金管理   A Miller's tale 米勒传奇(陈继龙编译) Dec 7th 2006 From The Economist print edition The winning streak of a super-investor comes to an end 一位投资大师的连胜势头终结. (1)BEATING the S&P 500 index over one year could be put down to[1] luck. But…
TEXT 87 Fund management基金管理   A Miller's tale 米勒传奇(陈继龙编译) Dec 7th 2006 From The Economist print edition The winning streak of a super-investor comes to an end 一位投资大师的连胜势头终结. (1)BEATING the S&P 500 index over one year could be put down to[1] luck. But…
Juliano is a fan of the TV show Erasing and Winning, where participants are selected in a draw and receive money for taking part in the show. In the show, the presenter writes a number of N digits in a board. The participant must then erase exactly D…
题意: 给你一个n位整数,让你删掉d个数字,剩下的数字要尽量大. 分析: 用了vector数组模拟.如果当前要插入的数>vector数组里的最后一位数,就替换且d-- 代码: #include <iostream>#include<cstdio>#include<vector>#include <algorithm>using namespace std;vector<char> s;int main(){ int n,d; while(~…
题意:给一个数字(开头非0),拿掉其中的d个数字,使剩下的数字最大(前后顺序不能变). 析:拿掉d个数字,还剩下n-d个数字.相当于从n个数字中按先后顺序选出n-d个数字使组成的数字最大,当然采用窗口滑动优先选取大的. 也就是说,当然第一位最大,这个数就最大了,所以这是一个贪心算法.我开始并不知道有这个算法, 所以开始我是暴力的,700ms,要是数据量再大一点,就TLE了.所以我想肯定有高效率的算法,查了查,原来还有这个. 先说我想法,首先在前d个数字中选最大的,然后在从这个数字到d+1个中选最…
题意:给一个长n(n<10^5)位的数,删除d位,求删除后最大的数.(原数无前导0) 思路:从前往后扫,如果a[i] > a[i-1],则删除a[i-1].我暴力的用链表实现了…… #include <cstdio> #include <cstring> #include <cstdlib> #include <list> using namespace std; #define N 100020 char str[N]; int main()…