일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 |
Tags
- Multi Task Learning Objectives for Natural Language Processing
- BART 논문리뷰
- Zero-shot Generalization in Dialog State Tracking through GenerativeQuestion Answering
- hugging face tokenizer에서 special case 추가하기
- UBAR: Towards Fully End-to-End Task-Oriented Dialog System with GPT-2
- NLP 논문 리뷰
- A Neural Attention Model for Abstractive Sentence Summarization
- BERT 사용방법
- CNN 논문리뷰
- BERT란
- BERT: Pre-training of Deep Bidirectional Transformers for Language Understanding 논문리뷰
- TOD 논문리뷰
- Attention Is All You Need
- The Natural Language Decathlon:Multitask Learning as Question Answering
- 정책기반 agent
- Attention Is All You Need 리뷰
- 바닥부터 배우는 강화 학습
- 뉴텝스 400
- Exploring the Limits of Transfer Learning with a Unified Text-to-Text Transformer 리뷰
- BERT: Pre-training of Deep Bidirectional Transformers for Language Understanding 리뷰
- attention 설명
- Multi Task Learning Objectives for Natural Language Processing 리뷰
- 다양한 모듈에서 log쓰기
- T5 논문 리뷰
- RuntimeError: DataLoader worker (pid(s) ) exited unexpectedly
- Evaluate Multiwoz
- 길찾기
- Exploring the Limits of Transfer Learning with a Unified Text-to-Text Transformer
- ImageNet Classification with Deep ConvolutionalNeural Networks 리뷰
- MMTOD
Archives
- Today
- Total
one by one ◼◻◼◻
백준 2667 단지번호 붙이기 본문

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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
|
# 단지 번호붙이기
import sys
from collections import deque
dx = [-1,1,0,0]
dy = [0,0,-1,1]
N = int(sys.stdin.readline().split()[0])
x,y = N,N
data = [[0] * y for _ in range(x)]
visit = [[0] * y for _ in range(x)]
for i in range(x):
line = list(sys.stdin.readline().split()[0])
for j, temp in enumerate(line):
data[i][j] = int(temp)
living = []
danji = 0
togo = deque()
for i in range(x):
for j in range(y):
if data[i][j] == 1 and visit[i][j] == 0:
danji +=1
apart = 0
togo.append((i,j))
visit[i][j] = 1
while togo:
x_, y_ = togo.popleft()
apart += 1
for k in range(4):
x_move, y_move = x_ +dx[k], y_ + dy[k]
if x_move >=0 and y_move>=0 and x_move<x and y_move<y:
if data[x_move][y_move] == 1 and visit[x_move][y_move]==0:
visit[x_move][y_move] =1
togo.append((x_move, y_move))
living.append(apart)
living = sorted(living)
print(danji)
for l in living:
print(l)
|
cs |
'코딩문제' 카테고리의 다른 글
백준 1697번 숨바꼭질 (1) | 2022.06.16 |
---|---|
백준 2178 , 미로탐색 (0) | 2022.06.16 |
백준 1009, 분산처리 (0) | 2022.06.16 |
정수 삼각형 (코딩테스트 연습동적계획법(Dynamic Programming)) (0) | 2022.06.10 |
베스트 앨범(코딩테스트 연습-해시) (0) | 2022.06.10 |