목록오블완 (21)
정화 코딩
https://www.acmicpc.net/problem/16953 #include #include #include using namespace std;int INTMAX = 1000000000;int main() { ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0); long long a, b; cin >> a >> b; queue> q; q.emplace(a, 0); int ans = -1; while (!q.empty()) { long long x = q.front().first; int cnt = q.front().second; q.pop(); if (x..
https://www.acmicpc.net/problem/2206 #include #include #include using namespace std;int dx[] = {1, -1, 0, 0};int dy[] = {0, 0, 1, -1};int main() { ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0); int n, m; cin >> n >> m; vector> g(n, vector(m)); vector> chk(n, vector(m, 0)); for (int i = 0; i > s; for (int j = 0; j > q; // {x index, y index, didBreak, coun..
https://www.acmicpc.net/problem/2096 #include #include using namespace std;int const INTMAX = 1000000000;int const MAX_N = 100000;int m[MAX_N][3];int dpmax[2][3];int dpmin[2][3];int main() { ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0); int n; cin >> n; for (int i = 0; i > m[i][j]; } } for (int j = 0; j 처음에는 dp 배열을 n * 3으로 선언했었는데 메모리 초과가 났었다. (MLE) 생각해보니 d..
https://www.acmicpc.net/problem/1987 #include #include using namespace std;int r, c;vector m;bool vst[26];int maxc = 0;int di[] = {1, -1, 0, 0};int dj[] = {0, 0, 1, -1};void dfs(int curi, int curj, int cnt) { if (cnt > maxc) maxc = cnt; for (int k = 0; k = 0 && nxti = 0 && nxtj > r >> c; m = vector(r); for (int i = 0; i > m[i]; } vst[m[0][0] - 'A'] = true; dfs(0, 0, 1); ..
https://www.acmicpc.net/problem/2448 #include #include #include using namespace std;int n;vector> ans;void recur(int si, int ni, int sj, int nj) { if (ni == 3) { ans[si][sj + 2] = '*'; ans[si + 1][sj + 1] = '*'; ans[si + 1][sj + 3] = '*'; ans[si + 2][sj] = '*'; ans[si + 2][sj + 1] = '*'; ans[si + 2][sj + 2] = '*'; ans[si + 2][sj + 3] = '*'; ..
가상환경 생성conda create -n emotionTTS python=3.10필요한 라이브러리 설치conda activate emotionTTSpip install librosa torch torchvision torchaudio matplotlib pandas사진에는 몇개 빠졌지만 위에 적은 것들 전부 받아야 한다.프로젝트 구조모델 관련 코드# emotionTTS.pyimport torchimport torch.nn as nnclass EmotionTTS(nn.Module): def __init__(self, emotion_embedding_dim, input_dim, output_dim): """ 감정 정보를 반영하여 Mel Spectrum을 생성하는 TTS 모델. ..
https://www.acmicpc.net/problem/1504 #include #include #include using namespace std;int INTMAX = 1000000;int n, e, v1, v2;vector>> edge;int dijkstra(int s, int e) { vector dst(n + 1, INTMAX); priority_queue> pq; dst[s] = 0; pq.emplace(0, s); while (!pq.empty()) { int cost = -pq.top().first; int cur = pq.top().second; pq.pop(); for (auto nxt: edge[cur]) ..
Simple Two Hidden Layer Deep Learningimport tensorflow as tffrom sklearn.metrics import confusion_matrix, ConfusionMatrixDisplay, accuracy_scorefrom sklearn.model_selection import train_test_splitimport numpy as npimport matplotlib.pyplot as plt# MNIST 데이터셋 로드(X_train_full, y_train_full), (X_test, y_test) = tf.keras.datasets.mnist.load_data()# 데이터 전처리: 픽셀 값을 0~1 사이로 스케일링X_train_full = X_train_fu..