Skip to content

Commit aa4853e

Browse files
committed
[Silver V] Title: Election Time, Time: 20 ms, Memory: 2488 KB -BaekjoonHub
1 parent 7d9877f commit aa4853e

2 files changed

Lines changed: 8 additions & 6 deletions

File tree

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#include <algorithm>
2-
#include <cstdio>
2+
#include <iostream>
33

44
using namespace std;
55

@@ -8,14 +8,16 @@ struct Vote {
88
};
99

1010
int main() {
11+
ios_base::sync_with_stdio(0);
12+
cin.tie(0);
1113
int N, K;
1214
Vote arr[50000];
13-
scanf("%d%d", &N, &K);
15+
cin >> N >> K;
1416
for (int i = 0; i < N; i++) {
15-
scanf("%d%d", &arr[i].f, &arr[i].s);
17+
cin >> arr[i].f >> arr[i].s;
1618
arr[i].i = i + 1;
1719
}
1820
sort(arr, arr + N, [](auto &a, auto &b) { return a.f > b.f; });
1921
sort(arr, arr + K, [](auto &a, auto &b) { return a.s > b.s; });
20-
printf("%d", arr[0].i);
22+
cout << arr[0].i;
2123
}

백준/Silver/6160. Election Time/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,15 @@
44

55
### 성능 요약
66

7-
메모리: 1584 KB, 시간: 24 ms
7+
메모리: 2488 KB, 시간: 20 ms
88

99
### 분류
1010

1111
수학, 구현, 정렬
1212

1313
### 제출 일자
1414

15-
2026년 2월 27일 13:00:47
15+
2026년 2월 27일 13:02:34
1616

1717
### 문제 설명
1818

0 commit comments

Comments
 (0)