当前位置: 首页 > news >正文

兼职 网站建设如何生成链接

兼职 网站建设,如何生成链接,免费做情网站,广东省建设监理协会网站http://acm.whu.edu.cn/land/problem/detail?problem_id1470 大概是给你一个队列,每次移动队头的数到队尾并减1,如果本身这个数为1就删去. 然后ans 这个数 * (队列长度-1),求最小的ans 只要最小的元素最先删除就能保证结果最小 解法: 先对原数列排序 然后模拟原操作 ...但是…http://acm.whu.edu.cn/land/problem/detail?problem_id1470 大概是给你一个队列,每次移动队头的数到队尾并减1,如果本身这个数为1就删去. 然后ans  这个数 * (队列长度-1),求最小的ans 只要最小的元素最先删除就能保证结果最小 解法:  先对原数列排序 然后模拟原操作 ...但是t[i] 太大 .显然不能一个个的模拟...其实稍微推一下就能得出 每次到达能删除元素的时候 整个队列循环了t[i]-1次... 我们维护一下后缀和suffix...就能得到这个公式:  前面等差数列,后面等差数列O(1)就能求出 总共n个数,总共O(n) Notice : 等差数列里面/2不能随意取模,我们要对2求1e97的逆元再取模 过程举例: 2 3 4 5 6 第一轮:  2 3 4 5 6    to  1 2 3 4 5 第二轮: 2 3 4 5    to 1 2 3 4 第三轮:  2 3 4      to 1 2 3 第四轮: 2 3       to 2 第五轮: 2 (结果懒得写了...自己可以拍一下)   /********************* Template ************************/ #include set #include map #include list #include cmath #include ctime #include deque #include queue #include stack #include bitset #include cstdio #include string #include vector #include cassert #include cstdlib #include cstring #include sstream #include fstream #include numeric #include iomanip #include iostream #include algorithm #include functional using namespace std;#define EPS 1e-8 #define MAXN 100005 #define MOD ((int)1e97) #define PI acos(-1.0) #define DINF (1e10) #define LINF ((1LL)50) #define INF (0x3f3f3f3f) #define max(a,b) ((a) (b) ? (a) : (b)) #define min(a,b) ((a) (b) ? (a) : (b)) #define max3(a,b,c) (max(max(a,b),c)) #define min3(a,b,c) (min(min(a,b),c)) #define BUG coutBUG! endl #define line cout--------------endl #define L(t) (t 1) #define R(t) (t 1 | 1) #define Mid(a,b) ((a b) 1) #define lowbit(a) (a -a) #define FIN freopen(in.txt,r,stdin) #define FOUT freopen(out.txt,w,stdout) #pragma comment (linker,/STACK:102400000,102400000)typedef long long LL; typedef unsigned long long ULL; // typedef __int64 LL; // typedef unisigned __int64 ULL; // LL gcd(LL a,LL b){ return b?gcd(b,a%b):a; } // LL lcm(LL a,LL b){ return a*b/gcd(a,b); }/********************* F ************************/ LL suf; LL a[MAXN]; LL r2 (1000000007)/21; int main() {int T;scanf(%d,T);int cas 1;for(int cas 1; cas T; cas){suf 0;int n,num;scanf(%d,n);num n-1;for(int i 0 ; i n ; i)scanf(%lld,a[i]);sort(a,an);for(int i 1 ; i n ; i){suf a[i];}LL res 0;LL ct 0;for(int i 0 ; i n-1 ; i){a[i] a[i] - ct;res (res ((a[i]1)%MOD*a[i]%MOD*r2%MOD*num%MOD))%MOD;int cnt a[i] - 1;if(cnt 0){LL sum (suf (suf - (cnt-1) * num)) % MOD * cnt % MOD * r2 % MOD;res (res (sum*num)%MOD) % MOD;}suf - (num * cnt);suf suf - ((a[i1]-ct) - cnt);num--;ct cnt;}printf(Case %d: ,cas);printf(%lld\n,res);}return 0; }        转载于:https://www.cnblogs.com/Felix-F/p/3279689.html
http://wiki.neutronadmin.com/news/82633/

相关文章:

  • 360怎么免费建网站神一般的网页设计网站
  • 看电视剧的免费网站大全如何开通个人网站
  • 专业网站制作公司招聘网络广告推广的兼职
  • 做任务领q币网站花木公司网站源码
  • 网站未授权cas要怎么做做lt行业的人让我登网站
  • 网站标识描述可以填关键词吗温州哪里做网站设计
  • 营销型企业、公司网站案例如何自建网站 卖东西
  • 专业3合1网站建设价格网站建设与代运营产品介绍
  • 培训型网站建设方案东莞广告公司电话
  • 网站小程序app定制开发wordpress 夜间模式
  • 网站在网络文化建设方面的成果深圳宝安中心区
  • vs和sql怎么做网站深圳宝安外贸网站建设公司
  • tornado 网站开发目前做哪个网站能致富
  • 服装电子商务网站版式设计网站建设活动
  • 手机网站与电脑网站兼容珠海手机网站建设
  • 现在济南可以正常出入吗企业网站优化策略
  • 网站登录按钮点击没反应什么原因淘宝入口
  • 商城网站建设都需要多少钱专业网站建设加工
  • 网站建站网站496565js网站效果
  • 免费做效果图的网站网站地图怎么提交
  • 手机管理网站模板宁波妇科医院私立哪家医院好
  • 鹤山网站建设花店网站建设论文
  • 单页营销网站后台做不了大流量网站
  • 石家庄建站培训网络免费推广网站
  • 南宁网站快速优网页编辑器怎么打开
  • 做啥英文网站赚钱网站建设业务提成
  • ssh jsp做网站海南省生态文明村建设促进会网站
  • 山东网站建设开发维护企查查免费查询
  • 如何用vs2012做网站做标签网站是什么
  • 专做药材的网站有哪些在上海做兼职在哪个网站