您现在的位置是:主页 > news > 优秀网站作品截图/服务营销策划方案

优秀网站作品截图/服务营销策划方案

admin2025/5/11 3:43:26news

简介优秀网站作品截图,服务营销策划方案,手机网站建设公司,利用博客做网站傲娇的人 Time Limit: 1 Sec Memory Limit: 256 MB 题目连接 http://acm.uestc.edu.cn/#/problem/show/1151Description 有 N 个傲娇的人,你要指派他们去完成工作。只有当现在被指派的人完成了工作,你才能指派下一个。每个人完成工作需要花费 Ti 分钟&…

优秀网站作品截图,服务营销策划方案,手机网站建设公司,利用博客做网站傲娇的人 Time Limit: 1 Sec Memory Limit: 256 MB 题目连接 http://acm.uestc.edu.cn/#/problem/show/1151Description 有 N 个傲娇的人,你要指派他们去完成工作。只有当现在被指派的人完成了工作,你才能指派下一个。每个人完成工作需要花费 Ti 分钟&…

傲娇的人

Time Limit: 1 Sec  

Memory Limit: 256 MB

题目连接

http://acm.uestc.edu.cn/#/problem/show/1151

Description

有 N 个傲娇的人,你要指派他们去完成工作。只有当现在被指派的人完成了工作,你才能指派下一个。每个人完成工作需要花费 Ti 分钟,但!他们都好傲娇,他们都希望你马上就指派他,如果你拖延了 t 分钟才指派他,那么就需要付给他 tCi 元钱作为补偿。问,最少需要花费多少元钱才能去指派所有傲娇的人?

Input

第一行输入一个整数N (1N105)

第二行输入四个种子数abcd (1abcd10007)。你需要通过这4个种子数来得到 Ti 和 Ci,方法如下:

const int mod=10007; typedef long long ll; void getdata(int a,int b,int c,int d,int N,int *T,int *C){ T[0]=C[0]=0; for(int i=1;i<=N;i++){ T[i]=(T[i-1]*a+b)%mod+1; C[i]=(C[i-1]*c+d)%mod+1; } }

Output

第一行输出一个整数,表示最少需要花费多少钱去指派这些傲娇的人。

第二行输出 N 个整数,表示每次指派哪个人去,即按指派顺序输出被指派人的编号。比如,有5个人,按顺序指派他们,则输出"1 2 3 4 5"。如果有多解,输出字典序最小解。

Sample Input

5
1 1 1 1

Sample Output

340 
1 2 3 4 5

HINT

 

题意

 

题解:

排个序就好了

每个值对于后面的贡献度就是T[i]*其他的C[i]

然后根据这个排序就吼了

代码:

//qscqesze
#include <cstdio>
#include <cmath>
#include <cstring>
#include <ctime>
#include <iostream>
#include <algorithm>
#include <set>
#include <bitset>
#include <vector>
#include <sstream>
#include <queue>
#include <typeinfo>
#include <fstream>
#include <map>
#include <stack>
typedef long long ll;
using namespace std;
//freopen("D.in","r",stdin);
//freopen("D.out","w",stdout);
#define sspeed ios_base::sync_with_stdio(0);cin.tie(0)
#define maxn 200500
#define mod 10007
#define eps 1e-9
#define pi 3.1415926
int Num;
//const int inf=0x7fffffff;
const ll inf=999999999;
inline ll read()
{ll x=0,f=1;char ch=getchar();while(ch<'0'||ch>'9'){if(ch=='-')f=-1;ch=getchar();}while(ch>='0'&&ch<='9'){x=x*10+ch-'0';ch=getchar();}return x*f;
}
//*************************************************************************************

ll T[maxn];
ll C[maxn];
struct node
{ll x,y,z;friend bool operator < (const node & a,const node & b){if(a.x*b.y<a.y*b.x)return true;else if( a.x*b.y==a.y*b.x && a.z<b.z)return true;return false;}
};
node ans[maxn];
int main()
{int n=read();int a=read(),b=read(),c=read(),d=read();for(int i=1;i<=n;i++){ans[i].z=i;ans[i].x=(ans[i-1].x*a+b)%mod+1;ans[i].y=(ans[i-1].y*c+d)%mod+1;}sort(ans+1,ans+1+n);ll now = 0,Ans = 0;for(int i=1;i<=n;i++)Ans += now * ans[i].y,now += ans[i].x;printf("%lld\n",Ans);for(int i=1;i<=n;i++){if(i==1)printf("%d",ans[i].z);elseprintf(" %d",ans[i].z);}printf("\n");
}

 

转载于:https://www.cnblogs.com/qscqesze/p/4796325.html