//注意只有一组数据,否则OLE //题意:输出字符串的全排列 #include <iostream>#include <string>#include <algorithm>#include <cstdlib>#include <queue>//less算子 using namespace std;int main(){ int i,j,k; char s[210]; //while(1) { memset(s,0,sizeof(s)); cin>>s; // if(s=="NULL") // bre
转载
2012-08-14 21:18:00
43阅读
2评论
C - OrdersTime Limit:1000MS Memory Limit:10000KB 64bit IO Format:%I64d & %I64uSubmit StatusDescriptionThe stores manager has sorted all ki
原创
2023-04-21 01:25:43
72阅读
不重复的全排列,可以使用stl中的next_permutationView Code #include<iostream>#include<algorithm>#include<stdio.h>char a[250];using namespace std;int main(){ int len; scanf("%s",a); len=strlen(a); sort(a,a+len); do { printf("%s\n",a); } while(next_permutation(a,a+len)); return 0
转载
2011-04-08 19:08:00
26阅读
2评论
Orders Time Limit: 1000MS Memory Limit: 10000K Total Submissions: Accepted: Description The stores manager has sorted all kinds of goods in an alphabe
转载
2017-06-04 13:09:00
100阅读
2评论
题目地址:POJ 1731 这题能够直接用STL函数做,非常轻松。。next_permutation函数非常给力。。 代码例如以下: #include <algorithm> #include <iostream> #include <cstring> #include <cstdlib> #inc
转载
2017-05-05 14:58:00
192阅读
2评论
题目地址:
原创
2014-07-30 15:47:55
20阅读
描述
商店经理按照标签的字母顺序对各种商品进行了分类。所有标签以同一字母开头的种类都存放在标有该字母的同一仓库(即在同一建筑物内)。在白天,商店经理接收并预订要从商店发货的货物订单。每个订单只需要一种货物。商店经理按照预订的顺序处理请求。
你事先知道今天商店经理必须处理的所有订单,但你不知道他们的预订订单。计算所有可能的仓库访问方式,以便门店经理在一天中逐个解决所有需求。输入
输入包含一行所请求货
原创
2023-11-03 13:26:20
107阅读
OrdersTime Limit: 1000MS Memory Limit: 10000KDescriptionThe stores
原创
2022-11-30 13:11:42
56阅读
#include<iostream> #include<algorithm> #include<cstring> #include<cstdio> using namespace std; int main(){ char data[205]; scanf("%s",data); int len = ...
转载
2021-08-05 14:57:00
111阅读
2评论
OrdersTime Limit: 1000MS Memory Limit: 10000KTotal Submissions: 10868 Accepted: 6517DescriptionThe stores manager has sorted all kinds...
转载
2017-07-15 00:08:00
89阅读
2评论
POJ 1731 OrdersDescriptionThe sts starting with the same letter are stored
原创
2023-07-26 17:21:40
96阅读
一道排列组合的题目 先从阵地里选出哪几个阵...
转载
2016-03-24 19:59:00
43阅读
题目背景 7月17日是Mr.W的生日,ACM-THU为此要制作一个体积为Nπ的M层 生日蛋糕,每层都是一个圆柱体。 设从下往上数第i(1<=i<=M)层蛋糕是半径为Ri, 高度为Hi的圆柱。当i<M时,要求Ri>Ri+1且Hi>Hi+1。 由于要在蛋糕上抹奶油,为尽可能节约经费,我们希望蛋糕外表面(
转载
2016-11-12 21:06:00
131阅读
2评论
1731: 矩阵 Description Input Output Sample Input 1 3 4 4 Q 1 1 1 1 Q 1 1 3 2 M 1 1 3 Q 1 1 3 4 Sample Output 2 21 55 HINT Source 给定一个矩阵,和两种操作Q输出子矩阵的值,M改
转载
2017-04-09 17:15:00
43阅读
2评论
1731. Dill
Time limit: 0.5 second
Memory limit: 64 MBIvan Vasil'evich likes to work in his garden. Once he heard that dill was a very beautiful and healthy crop and planted his whole garden with two
原创
2022-01-10 16:30:17
83阅读
题目背景 7月17日是Mr.W的生日,ACM-THU为此要制作一个体积为Nπ的M层 生日蛋糕,每层都是一个圆柱体。 设从下往上数第i(1<=i<=M)层蛋糕是半径为Ri, 高度为Hi的圆柱。当i<M时,要求Ri>Ri+1且Hi>Hi+1。 由于要在蛋糕上抹奶油,为尽可能节约经费,我们希望蛋糕外表面(
转载
2017-06-01 21:19:00
180阅读
2评论
题目:https://www.lydsy.com/JudgeOnline/problem.php?id=1731 差分约束; ML: dis[y] - dis[x] <= k,即 x 向 y 连边权为 k 的边; MD: dis[y] - dis[x] >= k,即 y 向 x 连边权为 -k 的边
转载
2018-09-26 09:57:00
81阅读
2评论
P1731 生日蛋糕 P1731 生日蛋糕 P1731 生日蛋糕 题目背景 7月17日是Mr.W的生日,ACM-THU为此要制作一个体积为Nπ的M层 生日蛋糕,每层都是一个圆柱体。 设从下往上数第i(1<=i<=M)层蛋糕是半径为Ri, 高度为Hi的圆柱。当i<M时,要求Ri>Ri+1且Hi>Hi+
转载
2017-10-18 16:04:00
146阅读
2评论
P1731 生日蛋糕 P1731 生日蛋糕 P1731 生日蛋糕 题目背景 7月17日是Mr.W的生日,ACM-THU为此要制作一个体积为Nπ的M层 生日蛋糕,每层都是一个圆柱体。 设从下往上数第i(1<=i<=M)层蛋糕是半径为Ri, 高度为Hi的圆柱。当i<M时,要求Ri>Ri+1且Hi>Hi+
转载
2017-09-02 17:51:00
86阅读
2评论
Description Like everyone else, cows like to stand close to their friends when queuing for feed. FJ has N (2 <= N <= 1,000) cows numbered 1..N standin
原创
2021-05-20 22:43:37
116阅读