网页学习体会

  • 首页
  • 个人博客
您的位置: 首页  >  IT文章  >  Codeforces Round #497 (Div. 2) C. Reorder the Array

Codeforces Round #497 (Div. 2) C. Reorder the Array

分类: IT文章 • 2025-01-24 13:50:13

Bryce1010模板

http://codeforces.com/contest/1008/problems

#include <bits/stdc++.h>

using namespace std;
#define ll long long

const int MAXN=1e5+10;
const int INF=0x3f3f3f3f;

int a[MAXN];



int main()
{
    int n;
    cin>>n;
    for(int i=1;i<=n;i++)
    {
        cin>>a[i];
    }
    sort(a+1,a+1+n);
    int j=1,cnt=0;
    for(int i=1;i<=n;i++)
    {
        if(a[i]>a[j])
        {
            cnt++;
            j++;
        }

    }
    cout<<cnt<<endl;

    //cout << "Hello world!" << endl;
    return 0;
}

相关推荐

  • Codeforces Round #416 (Div. 2) C. Vladik and Memorable Trip
  • C. Finite or not? Codeforces Round #483 (Div. 2)
  • Codeforces Round #267 (Div. 2) C. George and Job(DP)补题
  • Codeforces Round #553 (Div. 2) 【C. Problem for Nazar】
  • Educational Codeforces Round 92 (Rated for Div. 2)B-Array Walk
  • Codeforces Round #692 (Div. 2, based on Technocup 2021 Elimination Round 3) C. Peaceful Rooks (思维,dsu找环)
  • Codeforces Round #497 (Div. 2)B. Turn the Rectangles
  • Codeforces Round #497 (Div. 2)
  • Codeforces Round #497 (Div. 2) C. Reorder the Array
  • Codeforces Round #497 (Div. 2) A. Romaji
  • hao.360.cn不停跳....
  • 3769 [spoj 8549] BST again
    网站免责声明 网站地图 最新文章 用户隐私 版权申明
本站所有数据收集于网络,如果侵犯到您的权益,请联系网站进行下架处理。   

Copyright © 2018-2021   Powered By 网页学习体会    备案号:   粤ICP备20002247号