From 387b5f6823b92518f62a9e8b5e0c72a1b56cbe72 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EC=8B=AC=EB=AF=BC=EC=84=B1?= Date: Thu, 8 Aug 2024 16:20:51 +0900 Subject: [PATCH] feat: add 10825 15641 --- 10000/10825.cpp | 41 ++++++++++++ README.md | 66 +++++++++---------- .../15641.txt" | 1 + 3 files changed, 75 insertions(+), 33 deletions(-) create mode 100644 10000/10825.cpp create mode 100644 "\354\240\2341\355\232\214 \352\265\254\353\215\260\352\270\260\354\273\265/15641.txt" diff --git a/10000/10825.cpp b/10000/10825.cpp new file mode 100644 index 0000000..50e0e3a --- /dev/null +++ b/10000/10825.cpp @@ -0,0 +1,41 @@ +#include +#include +#include +using namespace std; + +struct Score { + string name; + int korean; + int english; + int math; +}; + +Score students[100001]; +int n; + +bool cmp(Score a, Score b) { + if (a.korean == b.korean && a.english == b.english && a.math == b.math) { + return a.name < b.name; + } + + if (a.korean == b.korean && a.english == b.english) { + return a.math > b.math; + } + + if (a.korean == b.korean) { + return a.english < b.english; + } + + return a.korean > b.korean; +} + +int main() { + cin >> n; + for (int i = 0; i < n; i++) { + cin >> students[i].name >> students[i].korean >> students[i].english >> students[i].math; + } + sort(students, students + n, cmp); + for (int i = 0; i < n; i++) { + cout << students[i].name << "\n"; + } +} \ No newline at end of file diff --git a/README.md b/README.md index 7bc4d9e..aa42492 100644 --- a/README.md +++ b/README.md @@ -42,36 +42,36 @@ ## 8월 -| 날짜 | 대회 | 푼 문제 | 문제 유형 | -|:----:|------------------------------------------------------------------------------------------|:--------------------------------------------------:|:------:| -| 8/1 | [2016 Arab Collegiate Programming Contest](https://www.acmicpc.net/category/detail/2188) | [18691](https://www.acmicpc.net/problem/18691) | 수학 | -| 8/2 | | **_[1247](https://www.acmicpc.net/problem/1247)_** | 큰 수 연산 | -| 8/3 | | **_[2338](https://www.acmicpc.net/problem/2338)_** | 큰 수 연산 | -| 8/4 | [제1회 한국항공대학교 프로그래밍 경진대회(KAUPC)](https://www.acmicpc.net/category/detail/2838) | [23351](https://www.acmicpc.net/problem/23351) | 그리디 | -| 8/5 | | | | -| 8/6 | | | | -| 8/7 | | | | -| 8/8 | | | | -| 8/9 | | | | -| 8/10 | | | | -| 8/11 | | | | -| 8/12 | | | | -| 8/13 | | | | -| 8/14 | | | | -| 8/15 | | | | -| 8/16 | | | | -| 8/17 | | | | -| 8/18 | | | | -| 8/19 | | | | -| 8/20 | | | | -| 8/21 | | | | -| 8/22 | | | | -| 8/23 | | | | -| 8/24 | | | | -| 8/25 | | | | -| 8/26 | | | | -| 8/27 | | | | -| 8/28 | | | | -| 8/29 | | | | -| 8/30 | | | | -| 8/31 | | | | +| 날짜 | 대회 | 푼 문제 | 문제 유형 | +|:----:|:-------------------------------------------------------------------------------------------------------------------:|:-----------------------------------------------------------------------------------------:|:---------:| +| 8/1 | [2016 Arab Collegiate Programming Contest](https://www.acmicpc.net/category/detail/2188) | [18691](https://www.acmicpc.net/problem/18691) | 수학 | +| 8/2 | | **_[1247](https://www.acmicpc.net/problem/1247)_** | 큰 수 연산 | +| 8/3 | | **_[2338](https://www.acmicpc.net/problem/2338)_** | 큰 수 연산 | +| 8/4 | [제1회 한국항공대학교 프로그래밍 경진대회(KAUPC)](https://www.acmicpc.net/category/detail/2838) | [23351](https://www.acmicpc.net/problem/23351) | 그리디 | +| 8/5 | | | | +| 8/6 | | | | +| 8/7 | [NCPC 2007](https://www.acmicpc.net/category/detail/214) [coci1314-5](https://www.acmicpc.net/category/detail/1230) | [5052](https://www.acmicpc.net/problem/5052) [9935](https://www.acmicpc.net/problem/9935) | 문자열 집합 스택 | +| 8/8 | | **_[10825](https://www.acmicpc.net/problem/10825)_** | 정렬 | +| 8/9 | | | | +| 8/10 | | | | +| 8/11 | | | | +| 8/12 | | | | +| 8/13 | | | | +| 8/14 | | | | +| 8/15 | | | | +| 8/16 | | | | +| 8/17 | | | | +| 8/18 | | | | +| 8/19 | | | | +| 8/20 | | | | +| 8/21 | | | | +| 8/22 | | | | +| 8/23 | | | | +| 8/24 | | | | +| 8/25 | | | | +| 8/26 | | | | +| 8/27 | | | | +| 8/28 | | | | +| 8/29 | | | | +| 8/30 | | | | +| 8/31 | | | | diff --git "a/\354\240\2341\355\232\214 \352\265\254\353\215\260\352\270\260\354\273\265/15641.txt" "b/\354\240\2341\355\232\214 \352\265\254\353\215\260\352\270\260\354\273\265/15641.txt" new file mode 100644 index 0000000..d7765fe --- /dev/null +++ "b/\354\240\2341\355\232\214 \352\265\254\353\215\260\352\270\260\354\273\265/15641.txt" @@ -0,0 +1 @@ +70 \ No newline at end of file