diff --git "a/Programmers/\353\223\261\354\210\230_\353\247\244\352\270\260\352\270\260.cpp" "b/Programmers/\353\223\261\354\210\230_\353\247\244\352\270\260\352\270\260.cpp" new file mode 100644 index 0000000..e4bd0aa --- /dev/null +++ "b/Programmers/\353\223\261\354\210\230_\353\247\244\352\270\260\352\270\260.cpp" @@ -0,0 +1,24 @@ +#include +#include + +using namespace std; + +vector solution(vector> score) { + int n = score.size(); + vector avg(n); + vector ranks(n, 1); + + for (int i = 0; i < n; i++) { + avg[i] = (score[i][0] + score[i][1]) / 2.0; + } + + for (int i = 0; i < n; i++) { + for (int j = 0; j < n; j++) { + if (avg[i] < avg[j]) { + ranks[i]++; + } + } + } + + return ranks; +} \ No newline at end of file