백준

Algorithm/PS

[BOJ/백준] 5341 - Pyramids [C++/python]

문제 번호 5341번: Pyramids The input will be a sequence of integers, one per line. The end of input will be signaled by the integer 0, and does not represent the base of a pyramid. All integers, other than the last (zero), are positive. www.acmicpc.net 문제 풀이 입력값으로 n이 주어질 때, 1부터 n까지의 합을 출력하는 문제이다. 0이 입력되면 종료된다. 메모리 제한이 128MB로 4바이트의 크기를 가지는 int형은 128MB = 128 * 1024KB = 128 * 1024 * 1024B = int형 128 * 1..

Algorithm/PS

[BOJ/백준] 5300 - Fill the Rowboats! [C++/python]

문제 번호 5300번: Fill the Rowboats! The output will be the number of each pirate separated by spaces, with the word ”Go!” after every 6th pirate, and after the last pirate. www.acmicpc.net 문제 풀이 6의 배수일때 혹은 마지막 수 출력 이후 "Go!"를 출력하는 문제이다. 정답 코드 C++ #include #include #include #include #include using namespace std; #define fast ios_base::sync_with_stdio(false); cin.tie(0), cout.tie(0) #define ll long lon..

Algorithm/PS

[BOJ/백준] 4589 - Gnome Sequencing [C++/python]

문제 번호 4589번: Gnome Sequencing In the book All Creatures of Mythology, gnomes are kind, bearded creatures, while goblins tend to be bossy and simple-minded. The goblins like to harass the gnomes by making them line up in groups of three, ordered by the length of their beards. The gnomes www.acmicpc.net 문제 풀이 테스트 케이스마다 3개의 수를 입력받고, 3개의 수가 오름차순 혹은 내림차순으로 정렬되어있는지 판단한다. 정답 코드 C++ #include #include #i..

Algorithm/PS

[BOJ/백준] 4470 - 줄 번호 [C++/python]

문제 링크 4470번: 줄번호 텍스트에서 줄을 입력받은 뒤, 줄 번호를 출력하는 프로그램을 작성하시오. www.acmicpc.net 문제 풀이 입력값을 받아, 번호를 붙여 순서대로 출력시켜준다. 정답 코드 C++ #include #include #include #include #include using namespace std; #define fast ios_base::sync_with_stdio(false); cin.tie(0), cout.tie(0) #define ll long long int main() { fast; string N, s; getline(cin, N); for (int i = 1; i

Algorithm/PS

[BOJ/백준] 3765 - Celebrity jeopardy [C++/python]

[BOJ/백준] 3765 - Celebrity jeopardy [C++/python] 문제 링크 3765번: Celebrity jeopardy It’s hard to construct a problem that’s so easy that everyone will get it, yet still difficult enough to be worthy of some respect. Usually, we err on one side or the other. How simple can a problem really be? Here, as in Celebrity Jepoardy, questions www.acmicpc.net 문제 풀이 입력값의 수가 정해지지 않는 EOF를 받아야 종료되는 문제이다. 정답 코드 C+..

chanwoong1
'백준' 태그의 글 목록 (16 Page)