说一点东西:

昨天晚上$9:05$开始太不好了,我在学校学校$9:40$放学我呆到十点然后还要跑回家耽误时间....要不然$D$题就写完了

周末一些成绩好的同学单独在艺术楼上课然后晚上下第一节晚自习和他们在回廊里玩开灯之后再关上一片漆黑真好玩


 

A.Andryusha and Socks

日常煞笔提.....我竟然$WA$了一次忘了$n<<1$

 

#include <iostream>
#include <cstdio>
#include <cstring>
#include <algorithm>
#include <cmath>
using namespace std;
typedef long long ll;
const int N=2e5+5;
inline int read(){
    char c=getchar();int x=0,f=1;
    while(c<'0'||c>'9'){if(c=='-')f=-1;c=getchar();}
    while(c>='0'&&c<='9'){x=x*10+c-'0';c=getchar();}
    return x*f;
}
int n,a,vis[N],now,ans;
int main(){
    //freopen("in","r",stdin);
    n=read()<<1;
    for(int i=1;i<=n;i++){
        a=read();
        if(!vis[a]) now++,vis[a]=1;
        else now--;
        ans=max(ans,now);
    }
    printf("%d",ans);
}
View Code

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2021-10-16
  • 2021-07-29
  • 2022-01-06
  • 2022-02-10
  • 2021-07-05
猜你喜欢
  • 2022-01-25
  • 2022-02-17
  • 2021-11-11
  • 2022-12-23
  • 2021-07-03
  • 2022-12-23
相关资源
相似解决方案