We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent b7dca01 commit 12533a6Copy full SHA for 12533a6
1 file changed
박예진/10주차/260305.cpp
@@ -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