比赛链接 :点击这里

大概会写 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. Git-用 cherry-pick 挑好看的小樱桃

         版权声明:本文为博主原创文章,转载请在文章明显位置标明文章原属哦. https://blog.csdn.net/qq_32452623/article/details/79449534 ti ...

  2. Windows 机器上面同时安装mysql5.6 和 mysql5.7 的方法

    1. 自己遇到的两个坑: . mysql 登录的时候 需要使用-P 来指定端口号 不然默认走 呢 . mysql 5.6 和 mysql 5.7 更改用户密码的命令不一样.. 我这边浪费了很长时间: ...

  3. CBV源码分析+APIVIew源码分析

    {drf,resful,apiview,序列化组件,视图组件,认证组件,权限组件,频率组件,解析器,分页器,响应器,URL控制器,版本控制} 一.CBV源码分析准备工作: 新建一个Django项目 写 ...

  4. Ansible入门与实践

    一.ansible介绍 Ansible是一个简单的自动化运维管理工具,基于Python语言实现,由Paramiko和PyYAML两个关键模块构建,可用于自动化部署应用.配置.编排task(持续交付.无 ...

  5. jenkins插件findbugs+pmd+checkstyle结合sonar与maven(java环境代码质量和代码规范管理)

    一.下载jdk并安装(最好jdk官网下载解压安装的) 二.下载maven并安装maven 三.安装jenkins及插件 安装checkstyle.pmd.findbugs.maven.sonar等相关 ...

  6. mysql数据库的备份和还原的总结

    mysql数据库的备份和还原的总结 (来自一运维同事的总结) 1. 备份方式: 热备:数据库在线进行备份,不影响读和写的在线备份方式! 温备:数据库在线进行备份,对表备份时先锁定写操作,仅可以执行读操 ...

  7. for 循环增强

    package cn.zhou.com; /* * 增强for循环 * * for(int i:arr) * { * System.out.print(i+1+" "); * } ...

  8. 五、core开发

    一.支付方面的 https://www.cnblogs.com/stulzq/p/7606164.htmlhttps://www.cnblogs.com/guolianyu/

  9. NC部门考勤月报定制sql

    SELECT t_1.pk_psndoc pk_psndoc, t_1.pk_group pk_group, t_1.pyear pyear, t_1.month month, t_1.code ps ...

  10. codeforces732C

    Sanatorium CodeForces - 732C Vasiliy spent his vacation in a sanatorium, came back and found that he ...