zcy真是垃圾,啥都不会的那种。

菜的不行。

这场手速上了三题,然后各种E被卡……

日个吗居然E不开栈,傻逼吧

有毒吧

来看题:

A.sqc给的我的神奇公式,gtmd居然能A?

  1. #include<bits/stdc++.h>
  2. using namespace std;
  3. int n;double ans=;
  4. int main(){
  5. scanf("%d",&n);
  6. for(int i=;i<n-;i++){
  7. int j=(n-i)/,k=(n-i)-(n-i)/;
  8. ans=max(ans,sin(i)+sin(j)+sin(k));
  9. }
  10. printf("%.9lf\n",ans);
  11. }

B.小学生容斥,2^m次系列。

  1. #include <stdio.h>
  2. #include <iostream>
  3. #include <algorithm>
  4. #include <memory.h>
  5. using namespace std;
  6. typedef long long ll;
  7. #define N 2
  8. const int maxn=;
  9. const int L=<<;
  10. int a[maxn],T,n,m;ll f[L];int bin[L];
  11. ll gcd(ll n,ll m){
  12. return m?gcd(m,n%m):n;
  13. }
  14. inline ll lcm(ll n,ll m){return n/gcd(n,m)*m;}
  15. void dfs(int stp,int s,ll w){
  16. if (w>n) return ;
  17. if (stp>m) {f[s]+=n/w;return ;}
  18. dfs(stp+,s<<,w);
  19. dfs(stp+,s<<|,lcm(w,a[stp]));
  20. }
  21. int main(){
  22.  
  23. for (int i=;i<L;i++) bin[i]=bin[i>>]+(i&);
  24. for (scanf("%d",&T);T--;) {
  25. memset(f,,sizeof f);
  26. scanf("%d %d",&n,&m);
  27. for (int i=;i<=m;i++) scanf("%d",&a[i]);
  28. dfs(,,);ll ans=;
  29. for (int j=;j<m;j++)
  30. for (int i=;i<(<<m);i++)
  31. if (((i>>j)&)==) f[i]-=f[i+(<<j)];
  32. for (int i=;i<(<<m);i++)
  33. if (bin[i]&) ans+=f[i];
  34. printf("%lld\n",ans);
  35. }
  36. return ;
  37. }

剩下就一堆不会……

Ctm烦得跟什么一样,Etm卡空间卡常数,还狗日的不开栈。

D裸FFT算下。

  1. #include<bits/stdc++.h>
  2. #define N 1000005
  3. typedef long long ll;
  4. using namespace std;
  5. const double pi=acos(-);
  6. struct E{
  7. double x,y;
  8. E (double x=,double y=):x(x),y(y){}
  9. }a[N];
  10. E operator+(const E &a,const E &b){return E(a.x+b.x,a.y+b.y);}
  11. E operator-(const E &a,const E &b){return E(a.x-b.x,a.y-b.y);}
  12. E operator*(const E &a,const E &b){return E(a.x*b.x-a.y*b.y,a.x*b.y+a.y*b.x);}
  13. int n,m,l,q,L,nmax;
  14. int r[N],c[N];ll ans[N];
  15. void FFT(E *x,int k){
  16. for (int i=;i<n;i++) if (i<r[i]) swap(x[i],x[r[i]]);
  17. for (int i=;i<n;i<<=){
  18. E wn(cos(pi/i),sin(pi*k/i));
  19. for (int j=;j<n;j+=(i<<)){
  20. E w(,),l,r;
  21. for (int p=j;p<j+i;p++,w=w*wn){
  22. l=x[p],r=x[p+i];
  23. x[p]=l+w*r;
  24. x[p+i]=l-w*r;
  25. }
  26. }
  27. }
  28. if (k==-) for (int i=;i<=n;i++) x[i].x/=n;
  29. }
  30. inline int read(){
  31. int f=,x=;char ch;
  32. do{ch=getchar();if(ch=='-')f=-;}while(ch<''||ch>'');
  33. do{x=x*+ch-'';ch=getchar();}while(ch>=''&&ch<='');
  34. return f*x;
  35. }
  36. int main(){
  37. int T=read();
  38. while(T--){
  39. n=read();q=read();m=n;nmax=;L=;
  40. memset(ans,,sizeof(ans));memset(a,,sizeof(a));
  41. for(int i=;i<=m;i++)c[i]=read(),nmax=max(n,c[i]),a[c[i]].x++;
  42. nmax*=;for (n=;n<=nmax;n<<=,L++);
  43. for(int i=;i<n;i++)r[i]=(r[i>>]>>)|((i&)<<(L-));
  44. FFT(a,);
  45. for(int i=;i<=n;i++)a[i]=a[i]*a[i];
  46. FFT(a,-);
  47. for(int i=;i<=n;i++)ans[i]=(ll)(a[i].x+0.5);
  48. for(int i=;i<=m;i++)ans[c[i]*]--;
  49. for(int i=;i<=n;i++)ans[i]>>=;
  50. for(int i=n;i>=;i--)ans[i]+=ans[i+];
  51. for(int i=;i<=q;i++){
  52. int k=read();printf("%lld\n",ans[k]);
  53. }
  54. }
  55. }

好气啊,要是知道开栈我就能rank1了

巨气。

【玲珑杯Round17】xjb总结的更多相关文章

  1. 程设大作业xjb写——魔方复原

    鸽了那么久总算期中过[爆]去[炸]了...该是时候写写大作业了 [总不能丢给他们不会写的来做吧 一.三阶魔方的几个基本定义 ↑就像这样,可以定义面的称呼:上U下D左L右R前F后B UD之间的叫E,LR ...

  2. hdu_5881_Tea(xjb猜)

    题目链接:hdu_5881_Tea 题意: 有一壶水, 体积在 L 和 R 之间, 有两个杯子, 你要把水倒到两个杯子里面, 使得杯子水体积几乎相同(体积的差值小于等于1), 并且使得壶里剩下水体积不 ...

  3. hdu_5873_Football Games(xjb搞)

    题目链接:hdu_5873_Football Games 题意: 有n个队,每个队都会给其他队打一场,赢一场得2分,平局得一分,输了不得分,然后给你全部比赛结束后的得分,问你是否有假分 题解: 可以知 ...

  4. hdu_5761_Rower Bo(xjb猜公式)

    题目链接:hdu_5761_Rower Bo 题意: 让你求一个物理问题 题解: xjb猜公式,由题目样例可得,答案为8/7,然后我们可以xjb猜出公式为v1*a/(v1*v1-v2*v2),然后特判 ...

  5. “玲珑杯”ACM比赛 Round #12题解&源码

    我能说我比较傻么!就只能做一道签到题,没办法,我就先写下A题的题解&源码吧,日后补上剩余题的题解&源码吧!                                     A ...

  6. “玲珑杯”ACM比赛 Round #19题解&源码【A,规律,B,二分,C,牛顿迭代法,D,平衡树,E,概率dp】

    A -- simple math problem Time Limit:2s Memory Limit:128MByte Submissions:1599Solved:270 SAMPLE INPUT ...

  7. “玲珑杯”ACM比赛 Round #19 B -- Buildings (RMQ + 二分)

    “玲珑杯”ACM比赛 Round #19 Start Time:2017-07-29 14:00:00 End Time:2017-07-29 16:30:00 Refresh Time:2017-0 ...

  8. “玲珑杯”ACM比赛 Round #1

    Start Time:2016-08-20 13:00:00 End Time:2016-08-20 18:00:00 Refresh Time:2017-11-12 19:51:52 Public ...

  9. 玲珑杯”ACM比赛 Round #15

    手速狗从西安回来一只浑浑噩噩,好不容易迎来一场送饭比赛体验一把河南的优势,结果被高中生狂虐,无缘奖金..我的奖品梦就这样一次次被打破.... A -- Reverse the lights 最后半小时 ...

随机推荐

  1. 【bzoj2653】middle 可持久化线段树区间合并

    题目描述 一个长度为n的序列a,设其排过序之后为b,其中位数定义为b[n/2],其中a,b从0开始标号,除法取下整.给你一个长度为n的序列s.回答Q个这样的询问:s的左端点在[a,b]之间,右端点在[ ...

  2. Hyperledger Fabric 实战(十): Fabric node SDK 样例 - 投票DAPP

    Fabric node SDK 样例 - 投票DAPP 参考 fabric-samples 下的 fabcar 加以实现 目录结构 . ├── app │ ├── controllers │ │ └─ ...

  3. BZOJ5288 & 洛谷4436 & LOJ2508:[HNOI/AHOI2018]游戏——题解

    https://www.lydsy.com/JudgeOnline/problem.php?id=5288 https://www.luogu.org/problemnew/show/P4436 ht ...

  4. BZOJ2820:YY的GCD——题解

    http://www.lydsy.com/JudgeOnline/problem.php?id=2820 Description 神犇YY虐完数论后给傻×kAc出了一题给定N, M,求1<=x& ...

  5. 数组分组chunk的一种写法

    lodash的_.chunk函数可以将数组按照数量分成若干组, 例如: const data = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11]; const groupByN ...

  6. 【并查集】【P1525】关押罪犯

    传送门 Description Input Output Sample Input Sample Output Hint Solution 非常显然的并查集题目,在本题中,对于每个罪犯i,维护两个信息 ...

  7. Android LocalBroadcastManager解析

    阿里巴巴Android开发手册[强制]避免使用隐式 Intent 广播敏感信息,信息可能被其他注册了对应BroadcastReceiver 的 App 接收.说明:通过 Context#sendBro ...

  8. mysql 常用总结

    centos7 安装mysql 数据库安装参考:http://www.cnblogs.com/longrui/p/6071581.htmlhttps://www.cnblogs.com/yoursou ...

  9. 初学VS的目录结构

    工程目录下各文件的含义 一般大部分的文章可能介绍到上面就算结束了,但我这还没有.创建工程产生的各个文件都你知道是什么用的吗? 如果你是一个初学者,你可能会不知道(老手请跳过本文).Ok,我就带你逐一了 ...

  10. HDU1542 扫描线+离散化

    Atlantis Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/32768 K (Java/Others)Total Su ...