Algorithm ๐ง๐ป๐ป457 [c++] ํ๋ก๊ทธ๋๋จธ์ค - H-Index ( Level 2 ) ์ฝ๋ฉํ ์คํธ ์ฐ์ต - H-Index H-Index๋ ๊ณผํ์์ ์์ฐ์ฑ๊ณผ ์ํฅ๋ ฅ์ ๋ํ๋ด๋ ์งํ์ ๋๋ค. ์ด๋ ๊ณผํ์์ H-Index๋ฅผ ๋ํ๋ด๋ ๊ฐ์ธ h๋ฅผ ๊ตฌํ๋ ค๊ณ ํฉ๋๋ค. ์ํค๋ฐฑ๊ณผ1์ ๋ฐ๋ฅด๋ฉด, H-Index๋ ๋ค์๊ณผ ๊ฐ์ด ๊ตฌํฉ๋๋ค. ์ด๋ค ๊ณผํ์๊ฐ ๋ฐํ programmers.co.kr #include #include #include using namespace std; struct info{ int h_index; int min_cnt; int max_cnt; }; int solution(vector citations) { int answer = 0; vectorvec; sort(citations.begin(),citations.end()); int max_h=citations.back(); for(int i=.. 2021. 10. 19. [๋ฐฑ์ค,c++] 10718๋ฒ - We love kriii 10718๋ฒ: We love kriii ACM-ICPC ์ธํฐ๋ท ์์ , Regional, ๊ทธ๋ฆฌ๊ณ World Finals๊น์ง ์ด๋ฏธ 2ํ์ฉ ์ง์ถํด๋ฒ๋ฆฐ kriii๋ ๋ฏธ๋ จ์ ๋ฒ๋ฆฌ์ง ๋ชปํ๊ณ ์ ์ง ๋ชจ๋ฅด๊ฒ ์ฌํด์๋ ํ์ฃผ World Finals ์ค๋น ์บ ํ์ ์ฐธ์ฌํ๋ค. ๋ํ๋ฅผ ๋ฐ ์ค ๋ชจ๋ฅด๋ ์ง๋ฐ www.acmicpc.net #include using namespace std; int main() { ios_base::sync_with_stdio(false); cin.tie(0); cout 2021. 10. 16. [๋ฐฑ์ค,c++] 10610๋ฒ - 30 10610๋ฒ: 30 ์ด๋ ๋ , ๋ฏธ๋ฅด์ฝ๋ ์ฐ์ฐํ ๊ธธ๊ฑฐ๋ฆฌ์์ ์์ N์ ๋ณด์๋ค. ๋ฏธ๋ฅด์ฝ๋ 30์ด๋ ์๋ฅผ ์กด๊ฒฝํ๊ธฐ ๋๋ฌธ์, ๊ทธ๋ ๊ธธ๊ฑฐ๋ฆฌ์์ ์ฐพ์ ์์ ํฌํจ๋ ์ซ์๋ค์ ์์ด 30์ ๋ฐฐ์๊ฐ ๋๋ ๊ฐ์ฅ ํฐ ์๋ฅผ ๋ง๋ค๊ณ ์ถ์ดํ www.acmicpc.net // Copyright © 2021 ์์ฃผํ. All rights reserved. // // https://www.acmicpc.net/problem/10610 // BOJ10610 30 #include #include #include #include using namespace std; int main() { ios_base::sync_with_stdio(false); cin.tie(0); string N; cin >> N; long long sum = 0; bo.. 2021. 10. 16. [๋ฐฑ์ค,c++] 10451๋ฒ - ์์ด ์ฌ์ดํด 10451๋ฒ: ์์ด ์ฌ์ดํด 1๋ถํฐ N๊น์ง ์ ์ N๊ฐ๋ก ์ด๋ฃจ์ด์ง ์์ด์ ๋ํ๋ด๋ ๋ฐฉ๋ฒ์ ์ฌ๋ฌ ๊ฐ์ง๊ฐ ์๋ค. ์๋ฅผ ๋ค์ด, 8๊ฐ์ ์๋ก ์ด๋ฃจ์ด์ง ์์ด (3, 2, 7, 8, 1, 4, 5, 6)์ ๋ฐฐ์ด์ ์ด์ฉํด ํํํ๋ฉด \(\begin{pmatrix} 1 & 2 &3&4&5&6&7&8 \\ 3 www.acmicpc.net // Copyright © 2021 ์์ฃผํ. All rights reserved. // https://github.com/dkswnkk // https://www.acmicpc.net/problem/10451 // BOJ10451 ์์ด ์ฌ์ดํด #include #include #include using namespace std; int graph[1001]; int visited[1001]; .. 2021. 10. 16. [๋ฐฑ์ค,c++] 1032๋ฒ - ๋ช ๋ น ํ๋กฌํํธ 1032๋ฒ: ๋ช ๋ น ํ๋กฌํํธ ์ฒซ์งธ ์ค์ ํ์ผ ์ด๋ฆ์ ๊ฐ์ N์ด ์ฃผ์ด์ง๋ค. ๋์งธ ์ค๋ถํฐ N๊ฐ์ ์ค์๋ ํ์ผ ์ด๋ฆ์ด ์ฃผ์ด์ง๋ค. N์ 50๋ณด๋ค ์๊ฑฐ๋ ๊ฐ์ ์์ฐ์์ด๊ณ ํ์ผ ์ด๋ฆ์ ๊ธธ์ด๋ ๋ชจ๋ ๊ฐ๊ณ ๊ธธ์ด๋ ์ต๋ 50์ด๋ค. ํ์ผ์ด๋ฆ์ www.acmicpc.net // Copyright © 2021 ์์ฃผํ. All rights reserved. // // https://www.acmicpc.net/problem/1032 // BOJ1032 ๋ช ๋ น ํ๋กฌํํธ #include #include using namespace std; int main() { ios_base::sync_with_stdio(false); cin.tie(0); int N; cin >> N; string check; cin >> check; string.. 2021. 10. 16. [๋ฐฑ์ค,c++] 1026๋ฒ - ๋ณด๋ฌผ 1026๋ฒ: ๋ณด๋ฌผ ์ฒซ์งธ ์ค์ N์ด ์ฃผ์ด์ง๋ค. ๋์งธ ์ค์๋ A์ ์๋ N๊ฐ์ ์๊ฐ ์์๋๋ก ์ฃผ์ด์ง๊ณ , ์ ์งธ ์ค์๋ B์ ์๋ ์๊ฐ ์์๋๋ก ์ฃผ์ด์ง๋ค. N์ 50๋ณด๋ค ์๊ฑฐ๋ ๊ฐ์ ์์ฐ์์ด๊ณ , A์ B์ ๊ฐ ์์๋ 100๋ณด๋ค ์๊ฑฐ www.acmicpc.net // Copyright © 2021 ์์ฃผํ. All rights reserved. // // https://www.acmicpc.net/problem/1026 // BOJ1026 ๋ณด๋ฌผ #include #include #include using namespace std; int main() { ios_base::sync_with_stdio(false); cin.tie(0); int T; int ans = 0; cin >> T; vectorless(T); v.. 2021. 10. 16. [๋ฐฑ์ค,c++] 10174๋ฒ - ํฐ๋ฆฐ๋๋กฌ 10174๋ฒ: ํฐ๋ฆฐ๋๋กฌ ํฐ๋ฆฐ๋๋กฌ์ ์์ผ๋ก ์ฝ์ผ๋ ๋ค๋ก ์ฝ์ผ๋ ๋๊ฐ์ ๋จ์ด๋ ์ซ์๋ค์ ๋งํ๋ค. ์ผ๋ฐ์ ์ผ๋ก ๋์๋ฌธ์๋ฅผ ๊ตฌ๋ถํ์ง ์์ง๋ง, ๊ณต๋ฐฑ์ ๊ตฌ๋ถํ๋ค. ๋ค์์ ํฐ๋ฆฐ๋๋กฌ์ ์์์ด๋ค. Anna Harrah Arora Nat tan 9998999 123 www.acmicpc.net // Copyright © 2021 ์์ฃผํ. All rights reserved. // // https://www.acmicpc.net/problem/10174 // BOJ10174 ํฐ๋ฆฐ๋๋กฌ #include #include #include using namespace std; int main() { ios_base::sync_with_stdio(false); cin.tie(0); int N; cin >> N; cin.ignore();.. 2021. 10. 16. [๋ฐฑ์ค,c++] 10162๋ฒ - ์ ์๋ ์ธ์ง 10162๋ฒ: ์ ์๋ ์ธ์ง 3๊ฐ์ ์๊ฐ์กฐ์ ์ฉ ๋ฒํผ A B C๊ฐ ๋ฌ๋ฆฐ ์ ์๋ ์ธ์ง๊ฐ ์๋ค. ๊ฐ ๋ฒํผ๋ง๋ค ์ผ์ ํ ์๊ฐ์ด ์ง์ ๋์ด ์์ด ํด๋น ๋ฒํผ์ ํ๋ฒ ๋๋ฅผ ๋๋ง๋ค ๊ทธ ์๊ฐ์ด ๋์์๊ฐ์ ๋ํด์ง๋ค. ๋ฒํผ A, B, C์ ์ง์ ๋ ์๊ฐ์ www.acmicpc.net // Copyright © 2021 ์์ฃผํ. All rights reserved. // https://github.com/dkswnkk // https://www.acmicpc.net/problem/10162 // BOJ10162 ์ ์๋ ์ธ์ง #include #include using namespace std; int main() { ios_base::sync_with_stdio(false); cin.tie(0); vectorv(3), ans; v[0] =.. 2021. 10. 16. [๋ฐฑ์ค,c++] 10159๋ฒ - ์ ์ธ 10159๋ฒ: ์ ์ธ ์ฒซ ์ค์๋ ๋ฌผ๊ฑด์ ๊ฐ์ N ์ด ์ฃผ์ด์ง๊ณ , ๋์งธ ์ค์๋ ๋ฏธ๋ฆฌ ์ธก์ ๋ ๋ฌผ๊ฑด ์์ ๊ฐ์ M์ด ์ฃผ์ด์ง๋ค. ๋จ, 5 ≤ N ≤ 100 ์ด๊ณ , 0 ≤ M ≤ 2,000์ด๋ค. ๋ค์ M๊ฐ์ ์ค์ ๋ฏธ๋ฆฌ ์ธก์ ๋ ๋น๊ต ๊ฒฐ๊ณผ๊ฐ ํ ์ค์ ํ๋์ฉ www.acmicpc.net // Copyright © 2021 ์์ฃผํ. All rights reserved. // ํ๋ก์ด๋-์์ฌ ์๊ณ ๋ฆฌ์ฆ // https://www.acmicpc.net/problem/10159 // BOJ10159 ์ ์ธ #include #define INF 1e9 //๋ฌดํ๋๋ฅผ ์๋ฏธํ๋ ๊ฐ์ผ๋ก 10์ต์ ์ง์ using namespace std; int N, M; //N=๋ฌผ๊ฑด์ ๊ฐ์, M=๋ฌผ๊ฑด ์์ ๊ฐ์ int graph[101][101]; int a.. 2021. 10. 16. ์ด์ 1 ยทยทยท 47 48 49 50 51 ๋ค์