Set / Map
Introduction
특정 원소가 속해 있는지 빠르게 찾거나, 각 원소에 대응되는 원소를 빠르게 찾는 자료구조를 배워 봅시다.
Example
https://www.acmicpc.net/step/49
숫자 카드
import sys
input = sys . stdin . readline
N = int ( input ())
num_card = set ( map ( int , input (). split ()))
M = int ( input ())
check_card = list ( map ( int , input (). split ()))
is_card = num_card & set ( check_card )
output = ""
for card in check_card :
if card in is_card :
output += "1 "
else :
output += "0 "
print ( output [: - 1 ])
문자열 집합
import sys
input = sys . stdin . readline
N , M = map ( int , input (). split ())
S = set ()
for _ in range ( N ):
name = input (). rstrip ( " \n " )
S . add ( name )
cnt = 0
for _ in range ( M ):
name = input (). rstrip ( " \n " )
if name in S :
cnt += 1
print ( cnt )
나는야 포켓몬 마스터 이다솜
import sys
input = sys . stdin . readline
N , M = map ( int , input (). split ())
dict_num = {}
dict_name = {}
num = 1
for _ in range ( N ):
name = input (). rstrip ( " \n " )
dict_num [ num ] = name
dict_name [ name ] = num
num += 1
for _ in range ( M ):
inputs = input (). rstrip ( " \n " )
if inputs . isdigit ():
print ( dict_num [ int ( inputs )])
else :
print ( dict_name [ inputs ])
숫자 카드 2
대칭 차집합
서로 다른 부분 문자열의 개수
Please enable JavaScript to view the comments powered by Disqus.
2022
2 minute read
Introduction
less than 1 minute read
Introduction
1 minute read
Introduction
less than 1 minute read
Introduction
1 minute read
Introduction
less than 1 minute read
Introduction
1 minute read
Introduction
less than 1 minute read
Introduction
less than 1 minute read
Introduction
less than 1 minute read
Introduction
less than 1 minute read
Introduction
1 minute read
Introduction
1 minute read
Introduction
1 minute read
Introduction
less than 1 minute read
Introduction
less than 1 minute read
Introduction
less than 1 minute read
Introduction
less than 1 minute read
Introduction
less than 1 minute read
Introduction
less than 1 minute read
Introduction
less than 1 minute read
Introduction
less than 1 minute read
Introduction
less than 1 minute read
Introduction
less than 1 minute read
Introduction
1 minute read
Introduction
3 minute read
Introduction
1 minute read
Introduction
1 minute read
Introduction
1 minute read
Introduction
less than 1 minute read
Introduction
1 minute read
Introduction
less than 1 minute read
Introduction
1 minute read
Introduction
less than 1 minute read
Introduction
2 minute read
Introduction
less than 1 minute read
Introduction
2 minute read
Introduction
1 minute read
Introduction
less than 1 minute read
Introduction
1 minute read
Introduction
less than 1 minute read
Introduction
2 minute read
Introduction
1 minute read
Introduction
4 minute read
1167 트리의 지름
4 minute read
Introduction
1 minute read
Introduction
1 minute read
Introduction
less than 1 minute read
Introduction
3 minute read
Introduction
less than 1 minute read
Introduction
5 minute read
Introduction
3 minute read
Introduction
1 minute read
Introduction
1 minute read
Introduction
3 minute read
Introduction
2 minute read
Introduction
2 minute read
Introduction
3 minute read
Introduction
less than 1 minute read
Git 명령어를 사용한 하위 디렉토리 다운로드
Clone 할 로컬 저장소 생성
1 minute read
Introduction
less than 1 minute read
# Fetch the submodule commits into the main repository
git remote add submodule_origin git://url/to/submodule/origin
git fetch submodule_origin
less than 1 minute read
Introduction
less than 1 minute read
Introduction
4 minute read
Introduction
less than 1 minute read
Introduction
less than 1 minute read
Introduction
3 minute read
Introduction
less than 1 minute read
Introduction
1 minute read
Introduction
less than 1 minute read
Introduction
less than 1 minute read
Introduction
2 minute read
Introduction
less than 1 minute read
Introduction
1 minute read
Introduction
less than 1 minute read
Spring Project
less than 1 minute read
the page for java
3 minute read
가벼운 Base image를 사용
less than 1 minute read
version: 3.0.0a10
less than 1 minute read
WIDTH
less than 1 minute read
version: 3.0.0a10
less than 1 minute read
#include <iostream>
#include <thread>
#include <chrono>
#include <mutex>
#include <atomic>
#include <string.h>
1 minute read
version: 3.0.0a10
less than 1 minute read
https://cplusplus.com/reference/future/
less than 1 minute read
Multithreading support was introduced in C++11.
less than 1 minute read
how to costom github blog using jekyll
less than 1 minute read
You’ll find this post in your _posts directory. Go ahead and edit it and re-build the site to see your changes. You can rebuild the site in many different wa...
Back to top ↑