
ACM_思维贪心
DATELOST
I'm curious.
展开
-
HDU-1051 贪心 vector.erase
Problem DescriptionThere is a pile of n wooden sticks. The length and weight of each stick are known in advance. The sticks are to be processed by a woodworking machine in one by one fashion. It need...原创 2019-03-06 22:19:56 · 114 阅读 · 0 评论 -
POJ-1456 二叉堆
题目小根堆#include<iostream>#include<stdio.h>#include<string.h>#include<vector>#include<algorithm>#define op < //小根堆using namespace std;typedef long long ll;con...原创 2019-08-11 13:05:48 · 128 阅读 · 0 评论 -
POJ-3190 贪心
DescriptionOh those picky N (1 <= N <= 50,000) cows! They are so picky that each one will only be milked over some precise time interval A…B (1 <= A <= B <= 1,000,000), which includes ...原创 2019-07-31 20:43:47 · 146 阅读 · 0 评论 -
牛客OI周赛11-提高组 - A 矩形异或 - 打表找规律
链接:https://ac.nowcoder.com/acm/contest/941/A来源:牛客网题目描述Pi 有一个 nn 的表格第 x 行第 y 列写着正整数 x+y-1m 次询问,每次给出 xl, yl, xr, yr求第 xl 行到第 xr 行中第 yl 列到第 yr 列这 (xr-xl+1)(yr-yl+1) 个正整数的异或和输入描述:第一行两个正整数 n, m接下来...原创 2019-06-28 21:46:18 · 373 阅读 · 0 评论 -
CF 1176C贪心
You are given an array a consisting of n integers. Each ai is one of the six following numbers: 4,8,15,16,23,42.Your task is to remove the minimum number of elements to make this array good.An array...原创 2019-06-10 21:43:06 · 559 阅读 · 0 评论 -
CF-1165E 思维
E. Two Arrays and Sum of FunctionsYou are given two arrays a and b, both of length n.Let’s define a function f(l,r)=∑l≤i≤r ai⋅bi.Your task is to reorder the elements (choose an arbitrary order of ...原创 2019-05-15 11:21:43 · 292 阅读 · 0 评论 -
黑龙江大学程序设计竞赛(重现赛)牛客网
A暴力现在要求上课的同学们把所有的串依次连接起来,于是得到:那么你能告诉在S串中的第N个字母是多少吗?1<=N<1e4解题思路:懒得找规律。代码:#include<bits/stdc++.h>using namespace std;inline int read(){ int x=0,f=0;char ch=getchar(); w...原创 2019-04-25 19:26:56 · 667 阅读 · 0 评论 -
CF 1144B 贪心
B. Parity Alternated DeletionsPolycarp has an array a consisting of n integers.He wants to play a game with this array. The game consists of several moves. On the first move he chooses any element a...原创 2019-04-01 17:56:56 · 202 阅读 · 0 评论 -
CF 1144A 思维
A. Diverse StringsA string is called diverse if it contains consecutive (adjacent) letters of the Latin alphabet and each letter occurs exactly once. For example, the following strings are diverse: “...原创 2019-04-01 17:55:20 · 207 阅读 · 0 评论 -
CF 1140C 贪心
C. PlaylistYou have a playlist consisting of n songs. The i-th song is characterized by two numbers ti and bi — its length and beauty respectively. The pleasure of listening to set of songs is equal ...原创 2019-03-23 20:12:35 · 733 阅读 · 2 评论 -
CF 1140B 思维
B. Good StringYou have a string s of length n consisting of only characters > and <. You may do some operations with this string, for each operation you have to choose some character that still...原创 2019-03-23 20:09:36 · 438 阅读 · 0 评论 -
POJ-1456 贪心并查集
题目优先卖利润大的,并且在过期前尽量晚地卖出建立关于天数的并查集:维护未被占用的最晚的一天对于每个商品,在d天过期,查询d的根节点r在r天卖出,合并r, r-1#include<iostream>#include<vector>#include<stdio.h>#include<algorithm>#include<strin...原创 2019-08-30 18:53:33 · 121 阅读 · 0 评论