比赛链接 :点击这里

大概会写 F G J L 吧

F

给你一个序列 最多删除一个数使他构成 最长不上升或者不下降子序列

这题不会不会on的算法只能 t*n*logn 了 还是压常过

求两次 LIS

#include<bits/stdc++.h>
using namespace std;
#define maxn 300005
#define ll int
int a[maxn],b[maxn],c[maxn];
int n;
inline ll read()
{
    ll x=,f=;char ch=getchar();
    '){
        ;ch=getchar();
    }
    '){
        x=x*+ch-';ch=getchar();
    }return x*f;
}
int bin(int l,int r,int x){
   while(l<=r){
      ;
      if(b[mid]>=x){
         r=mid-;
      };
   }
   return l;
}
int work(){
   memset(b,,sizeof(b));
   ;
   ;j<n;j++){
      ]){
         b[len++]=a[j];
      }else{
        ,len,a[j]+);
        b[i]=a[j];
      }
     // for(int j=1;j<=len;j++){
     //   cout<<b[j]<<" ";
     // }
      //cout<<endl;
   }
   ;
}
int main(){
  int t;
  cin>>t;
  while(t--){
     n=read();
     ,mx=;
     ;j<n;j++){
       a[j]=read();
     }
     int len=work();
     reverse(a,a+n);
     int len1=work();
     )||len1>=n-){
        printf("YES\n");
     }else printf("NO\n");
  }
  ;
}

G 只有4个点才能组成一个正四边形

#pragma comment(linker, "/STACK:1024000000,1024000000")
#include<stdio.h>
#include<string.h>
#include<stdlib.h>
#include<queue>
#include<stack>
#include<math.h>
#include<vector>
#include<map>
#include<set>
#include<stdlib.h>
#include<cmath>
#include<string>
#include<algorithm>
#include<iostream>
#define exp 1e-10
using namespace std;
;
;
;
;
];
int main()
{
    int  t,i,j,n,k;
    scanf("%d",&t);
    while(t--)
    {
        scanf("%d",&n);
        ;i<n;i++)
            scanf("%d%d",&x[i],&y[i]);
        )
        {
            puts("NO");
            continue;
        }
        ;i<n;i++)
            ;j<i;j++,k++)
                L[k]=(x[i]-x[j])*(x[i]-x[j])+(y[i]-y[j])*(y[i]-y[j]);
        sort(L,L+);
        ]==L[]&&L[]==L[]&&L[]==L[]&&L[]==L[]&&L[]!=L[])
            puts("YES");
        else
            puts("NO");
    }
    ;
}

J

字典树

#include<bits/stdc++.h>
using namespace std;
#define maxn 1000100
#define LL long long
LL a[maxn];
struct ac{
   LL x,nex[];
   void init(){
     x=;
     memset(nex,,sizeof(nex));
   }
}tre[maxn];
LL tot,n;
void init(){
   memset(tre,,sizeof(tre));
   tot=;
}
void add(LL x){
   LL k=;
   tre[k].x++;
   ;j>=;j--){
      <<j))&x);
      ){
         tre[k].nex[fa]=++tot;
         tre[tot].init();
      }
      k=tre[k].nex[fa];
      tre[k].x++;
   }
}
void del(LL x){
   LL k=;
   tre[k].x--;
   ;j>=;j--){
      <<j))&x);
      k=tre[k].nex[fa];
      tre[k].x--;
   }
}
LL query(LL x){
  LL k=,ans=;
  ;j>=;j--){
     <<j))&x);
     ]&&tre[tre[k].nex[fa^]].x>){
        ans+=1LL*(<<j);
        k=tre[k].nex[fa^];
     }else k=tre[k].nex[fa];
  }
  return ans;
}
int main(){
   LL t;
   cin>>t;
   while(t--){
      cin>>n;
      init();
      ;j<n;j++){
         scanf("%d",&a[j]);
         add(a[j]);
      }
      LL mx=;
      ;j<n;j++){
         ;k<n;k++){
            del(a[j]);
            del(a[k]);
            mx=max(mx,query(a[j]+a[k]));
            add(a[j]);
            add(a[k]);
         }
      }
      cout<<mx<<endl;
   }
}

L

Select Code
#include<bits/stdc++.h>
using namespace std;
#define maxn 100
int a[maxn][maxn];
int main(){
   int t;
   cin>>t;
   while(t--){
      ,ans=;
      cin>>n>>m;
      ;j<=n;j++){
         ;k<=m;k++){
            cin>>a[j][k];
            mx=max(mx,a[j][k]);
            if(a[j][k]){
               ans+=a[j][k]*+;
            }
         }
      }
      ;j<=n;j++){
         ;k<=m;k++){
            ][k],a[j][k]);
            ],a[j][k]);
            ans-=z*;
            ans-=zz*;
         }
      }
      cout<<ans<<endl;
   }
   ;
}

ACM-ICPC 2015 ChangChun的更多相关文章

  1. ACM ICPC 2015 Moscow Subregional Russia, Moscow, Dolgoprudny, October, 18, 2015 G. Garden Gathering

    Problem G. Garden Gathering Input file: standard input Output file: standard output Time limit: 3 se ...

  2. ACM ICPC 2015 Moscow Subregional Russia, Moscow, Dolgoprudny, October, 18, 2015 D. Delay Time

    Problem D. Delay Time Input file: standard input Output file: standard output Time limit: 1 second M ...

  3. ACM ICPC 2015 Moscow Subregional Russia, Moscow, Dolgoprudny, October, 18, 2015 I. Illegal or Not?

    I. Illegal or Not? time limit per test 1 second memory limit per test 512 megabytes input standard i ...

  4. ACM ICPC 2015 Moscow Subregional Russia, Moscow, Dolgoprudny, October, 18, 2015 K. King’s Rout

    K. King's Rout time limit per test 4 seconds memory limit per test 512 megabytes input standard inpu ...

  5. ACM ICPC 2015 Moscow Subregional Russia, Moscow, Dolgoprudny, October, 18, 2015 H. Hashing

    H. Hashing time limit per test 1 second memory limit per test 512 megabytes input standard input out ...

  6. ACM ICPC 2015 Moscow Subregional Russia, Moscow, Dolgoprudny, October, 18, 2015 C. Colder-Hotter

    C. Colder-Hotter time limit per test 1 second memory limit per test 512 megabytes input standard inp ...

  7. ACM ICPC 2015 Moscow Subregional Russia, Moscow, Dolgoprudny, October, 18, 2015 A. Anagrams

    A. Anagrams time limit per test 1 second memory limit per test 512 megabytes input standard input ou ...

  8. HDU 5437 & ICPC 2015 Changchun Alisha's Party(优先队列)

    Alisha’s Party Time Limit: 3000/2000 MS (Java/Others)    Memory Limit: 131072/131072 K (Java/Others) ...

  9. hdu 5444 Elven Postman(二叉树)——2015 ACM/ICPC Asia Regional Changchun Online

    Problem Description Elves are very peculiar creatures. As we all know, they can live for a very long ...

  10. (并查集)Travel -- hdu -- 5441(2015 ACM/ICPC Asia Regional Changchun Online )

    http://acm.hdu.edu.cn/showproblem.php?pid=5441 Travel Time Limit: 1500/1000 MS (Java/Others)    Memo ...

随机推荐

  1. OpenCV__type()返回的数字

    OpenCV中的类型以宏定义的形式给出 type_c.h中片段 #define CV_CN_MAX 512 #define CV_CN_SHIFT 3 #define CV_DEPTH_MAX (1 ...

  2. php 生成订单号201807205598981

    php版 /** * 生成唯一订单号 */ public function build_order_no() { $no = date('Ymd').substr(implode(NULL, arra ...

  3. java学习之—链表(1)

    /** * 单链表操作 * Create by Administrator * 2018/6/14 0014 * 下午 2:05 **/ public class Link { public int ...

  4. Netty ByteBuf和Nio ByteBuffer

    参考https://blog.csdn.net/jeffleo/article/details/69230112 一.简介 Netty中引入了ByteBuf,它相对于ByteBuffer来说,带来了很 ...

  5. Django--ORM 多表查询

    一 . 建立外键 一对一建立外键 外键名称 = models.OneToOneField(to='要连接的类名', to_field='字段') 一对多建立外键 外键名称 = models.Forei ...

  6. 【转】使用 lsof 查找打开的文件

      在 UNIX® 环境中,文件无处不在,这便产生了一句格言:“任何事物都是文件”.通过文件不仅仅可以访问常规数据,通常还可以访问网络连接和硬件.在有些情况下,当您使用 ls 请求目录清单时,将出现相 ...

  7. elasticsearch概念及倒排索引简单介绍

    一.概念 集群:一个或者多个节点组织在一起 节点:一个节点是集群中的一个服务器,由一个名字来标识,默认是一个随机的漫威角色名字. 分片:将索引划分为多份的能力,允许水平分割和扩展容量,多个分片相应请求 ...

  8. 老男孩python学习自修第八天【函数式编程】

    1.可变参数,将传参自动汇总成列表 2.可变参数,将参数自动汇总成字典 实战如下: #!/usr/bin/env python # _*_ coding:UTF-8 _*_ def show(*arg ...

  9. Ubuntu16.04网络不能访问解决办法

      问题: 系统重启后,网络不能正常使用,加载网络配置失败,且重启网络时也提示错误. 解决方法: 在定位的过程中发现是配置中的网络设备号与实际设备号不符. 1.查看网络配置中的配备号: vi /etc ...

  10. PC平台的SIMD支持检测

    如果我们希望在用SIMD来提升程序处理的性能,首先需要做的就是检测程序所运行的平台是否支持相应的SIMD扩展.平台对SIMD扩展分为两部分的支持: CPU对SIMD扩展的支持.SIMD扩展是随着CPU ...