Skip to content

Commit 12533a6

Browse files
authored
[BOJ] 1205 등수 구하기 (S4)
1 parent b7dca01 commit 12533a6

File tree

1 file changed

+26
-0
lines changed

1 file changed

+26
-0
lines changed

박예진/10주차/260305.cpp

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
//https://www.acmicpc.net/problem/1205
2+
#include <iostream>
3+
#include <vector>
4+
#include <algorithm>
5+
using namespace std;
6+
7+
// 랭킹 리스트에 올라갈 수 있는 점수 개수 P
8+
9+
int N, score, P;
10+
int arr[51], cnt = 1;
11+
12+
int main(){
13+
ios_base::sync_with_stdio(false);
14+
cin.tie(NULL); cout.tie(NULL);
15+
16+
cin >> N >> score >> P;
17+
for(int i = 0; i < N; i++){
18+
cin >> arr[i];
19+
if (arr[i] > score) cnt++;
20+
}
21+
22+
if (N == P && arr[N - 1] >= score) cnt = -1;
23+
cout << cnt;
24+
25+
return 0;
26+
}

0 commit comments

Comments
 (0)