Created
April 14, 2017 09:23
-
-
Save moo1o/40470234b92ce6027006523a1005d590 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// | |
// 11053.cpp | |
// AlgorithmTest | |
// | |
// Created by 김무열 on 2017. 4. 14.. | |
// Copyright © 2017년 김무열. All rights reserved. | |
// | |
#include <iostream> | |
#include <algorithm> | |
#include <vector> | |
using namespace std; | |
int main(void){ | |
int n, cnt = 1; | |
cin >> n; | |
vector<int> a(n); | |
for(int i = 0 ; i< n ; i++){ | |
cin >> a[i]; | |
} | |
sort(a.begin(), a.end()); | |
reverse(a.begin(), a.end()); | |
for(int i = 1; i<n ; i++){ | |
if(a[i] < a[i-1]){ | |
++cnt; | |
} | |
} | |
cout << cnt << '\n'; | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment