시나위

  • 홈
  • 태그
  • 방명록

2798 2

[백준] 2798 블랙잭

www.acmicpc.net/problem/2798 2798번: 블랙잭 첫째 줄에 카드의 개수 N(3 ≤ N ≤ 100)과 M(10 ≤ M ≤ 300,000)이 주어진다. 둘째 줄에는 카드에 쓰여 있는 수가 주어지며, 이 값은 100,000을 넘지 않는 양의 정수이다. 합이 M을 넘지 않는 카드 3장 www.acmicpc.net n, m = map(int, input().split()) cards = list(map(int, input().split())) max_val = 0 def blackjack(index=0, visit_index=-1, arr=[], length=n, key=m): if index == 3: if sum(arr) > key: return global max_val if max_..

STUDY/Algorithm 2021.03.04

[백준] 2798 블랙잭

N, M = map(int,input().split()) cards = list(map(int,input().split())) card_list = [(cards[x]+cards[y]+cards[z]) for x in range(len(cards)) \ for y in range(len(cards)) for z in range(len(cards)) if x < y < z] print(max([x for x in card_list if x

STUDY/Algorithm 2021.01.30
이전
1
다음
더보기
프로필사진

하고 싶은 거 다하고 정리하는 블로그

  • 분류 전체보기 (669)
    • STUDY (529)
      • Algorithm (402)
      • C, C++ (7)
      • Python (33)
      • Rust (28)
      • Swift & iOS (16)
      • Web (10)
      • Raspberry Pi (10)
      • Others (23)
    • OTHERS (140)
      • 내 생각 (134)
      • 리뷰 (5)

Tag

파이썬, python3, 시뮬레이션, 혼공단, 브루트포스, 백준, BOJ, 혼공파, 프로그래머스, 그래프탐색, 다익스트라, python, 백트래킹, BFS, dp, C++, 구현, baekjoon, C, dfs,

최근글과 인기글

  • 최근글
  • 인기글

최근댓글

공지사항

페이스북 트위터 플러그인

  • Facebook
  • Twitter

Archives

Calendar

«   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 :

Copyright © Kakao Corp. All rights reserved.

티스토리툴바