BZOJ2456: mode 众数卡空间
来源:互联网 发布:unity3d初音炫舞源码 编辑:程序博客网 时间:2024/06/16 08:03
这题做法就是把不同的数字相互消除
剩下最后的就是众数了
不太清楚这个空间怎么算的。。bits居然会被空间卡掉
/*#include<bits/stdc++.h>#include<stdio.h>#include<algorithm>#include<queue>#include<string.h>#include<iostream>#include<math.h>#include<set>#include<map>#include<vector>#include<iomanip>*/#include<cstdio>using namespace std;#define ll long long#define ull unsigned long long#define pb push_back#define FOR(a) for(int i=1;i<=a;i++)const int inf=0x3f3f3f3f;const ll Linf=9e18;const int maxn=1e6+7; const ll mod=1e9+7;const double eps=1e-6;int n,t,x,tot;int main(){scanf("%d",&n);for(int i=1;i<=n;i++){scanf("%d",&x);if(x==t)tot++;else if(!tot){t=x;tot=1;}else{tot--;}}printf("%d\n",t);}
阅读全文
0 0
- BZOJ2456: mode 众数卡空间
- 【BZOJ2456】mode,卡内存
- BZOJ2456 Mode & zju2132 The Most Frequent Number(众数性质)
- bzoj2456 mode
- [BZOJ2456]mode
- BZOJ2456: mode
- bzoj2456: mode
- bzoj2456:mode
- 【bzoj2456】 mode
- Bzoj2456 mode
- [bzoj2456] mode
- bzoj2456: mode
- BZoj2456: mode
- BZOJ2456: mode
- bzoj2456: mode
- bzoj2456: mode
- [bzoj2456]mode
- bzoj2456 mode
- javascript实现继承的方式
- Codeforces Round #400(A) A.A Serial Killer
- PAT_A 1052. Linked List Sorting (25)
- Java代码执行顺序
- 笔试中背包问题的应用
- BZOJ2456: mode 众数卡空间
- 手把手从零编写一个OGRE程序
- 负载均衡集群 LVS 详解(Loadbalancer & LVS)
- python基础06
- js 时间戳转日期格式
- C# 和 Linux 时间戳转换
- Hadoop简单入门和集群搭建
- 一.YUV格式与RGB格式的换算
- 浅析进程、线程和应用程序域的关系--为了更深入的学习