![](https://img-blog.csdnimg.cn/20201014180756913.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
ACM_思维贪心
DATELOST
I'm curious.
展开
-
HDU-1051 贪心 vector.erase
Problem Description There 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 · 93 阅读 · 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 · 98 阅读 · 0 评论 -
POJ-3190 贪心
Description Oh 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 · 115 阅读 · 0 评论 -
牛客OI周赛11-提高组 - A 矩形异或 - 打表找规律
链接:https://ac.nowcoder.com/acm/contest/941/A 来源:牛客网 题目描述 Pi 有一个 nn 的表格 第 x 行第 y 列写着正整数 x+y-1 m 次询问,每次给出 xl, yl, xr, yr 求第 xl 行到第 xr 行中第 yl 列到第 yr 列这 (xr-xl+1)(yr-yl+1) 个正整数的异或和 输入描述: 第一行两个正整数 n, m 接下来...原创 2019-06-28 21:46:18 · 318 阅读 · 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 · 529 阅读 · 0 评论 -
CF-1165E 思维
E. Two Arrays and Sum of Functions You 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 · 257 阅读 · 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 · 610 阅读 · 0 评论 -
CF 1144B 贪心
B. Parity Alternated Deletions Polycarp 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 · 175 阅读 · 0 评论 -
CF 1144A 思维
A. Diverse Strings A 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 · 184 阅读 · 0 评论 -
CF 1140C 贪心
C. Playlist You 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 · 691 阅读 · 2 评论 -
CF 1140B 思维
B. Good String You 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 · 403 阅读 · 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 · 96 阅读 · 0 评论