본문 바로가기 메뉴 바로가기

My life story

프로필사진
  • 글쓰기
  • 관리
  • 태그
  • 방명록
  • RSS

My life story

검색하기 폼
  • 분류 전체보기 (257)
    • 여행 (56)
      • 일본 (48)
      • 대만 (4)
      • 태국 (4)
    • 알고리즘 (172)
      • 삼성 SW테스트 (29)
      • BFS (25)
      • Binary search (4)
      • Bipartite matching (6)
      • Brute force (2)
      • Convex hull (5)
      • DFS (4)
      • Dijkstra (4)
      • Dynamic Programming (32)
      • Greedy (11)
      • Implementation (11)
      • LCA (4)
      • Math (3)
      • MCMF (3)
      • Min cut (1)
      • Minimum vertex cover (2)
      • MST (3)
      • Network flow (6)
      • Segment tree (7)
      • Simulation (1)
      • SCC (3)
      • Topological sorting (2)
      • Tree (2)
      • Trie (1)
      • 그 외 (1)
    • 개발 (26)
      • C++ (10)
      • C# (10)
      • Docker (3)
      • 그 외 (3)
    • 네트워크 (1)
    • 일상 (0)
    • 생존신고 (2)
  • 방명록

백준 기타줄 (1)
boj, 백준 ) 1049 기타줄 (C++)

#include #include using namespace std; int line_set[100]; int line_single[100]; int main() { int n, m; cin >> n >> m; for (int i = 0; i > line_set[i] >> line_single[i]; sort(line_set, line_set + m); sort(line_single, line_single + m); int ret = 0; if (line_set[0] < line_single[0] * 6) { //세트로 사는게 이득 if (n % 6 == 0) { int num = n / 6; ret = num * line_set[0]; } else { //최대한 세트로 사고 ..

알고리즘/Implementation 2020. 1. 28. 12:49
이전 1 다음
이전 다음
«   2025/05   »
일 월 화 수 목 금 토
1 2 3
4 5 6 7 8 9 10
11 12 13 14 15 16 17
18 19 20 21 22 23 24
25 26 27 28 29 30 31
Total
Today
Yesterday

Blog is powered by Tistory / Designed by Tistory

티스토리툴바