-
Notifications
You must be signed in to change notification settings - Fork 25
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #30 from luizacbcampos/site_correto
Cria um site com todos os códigos
- Loading branch information
Showing
210 changed files
with
16,018 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,75 @@ | ||
name: Deploy Hugo site to Pages | ||
|
||
on: | ||
push: | ||
branches: | ||
- master | ||
|
||
# Allows manual triggering from the Actions tab | ||
workflow_dispatch: | ||
# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages | ||
permissions: | ||
contents: read | ||
pages: write | ||
id-token: write | ||
|
||
# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued. | ||
# However, do NOT cancel in-progress runs as we want to allow these production deployments to complete. | ||
concurrency: | ||
group: "pages" | ||
cancel-in-progress: false | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
env: | ||
HUGO_VERSION: 0.123.3 | ||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v4 | ||
with: | ||
submodules: recursive | ||
fetch-depth: 0 | ||
|
||
- name: Setup Hugo | ||
uses: peaceiris/actions-hugo@v2 | ||
with: | ||
hugo-version: ${{ env.HUGO_VERSION }} | ||
extended: true | ||
|
||
- name: Install Node.js dependencies | ||
run: "[[ -f package-lock.json || -f npm-shrinkwrap.json ]] && npm ci || true" | ||
|
||
- name: Get Hugo modules | ||
run: | | ||
hugo mod get | ||
- name: Get baseURL from hugo.toml | ||
id: get_base_url | ||
run: | | ||
echo "HUGO_BASE_URL=$(grep -Po '(?<=^baseURL = ")[^"]*' hugo.toml)" >> $GITHUB_ENV | ||
- name: Build site with Hugo | ||
env: | ||
# For maximum backward compatibility with Hugo modules | ||
HUGO_ENVIRONMENT: production | ||
HUGO_ENV: production | ||
HUGO_BASE_URL: ${{ env.HUGO_BASE_URL }} | ||
run: hugo --gc --minify --baseURL "${{ env.HUGO_BASE_URL }}/" | ||
|
||
- name: Upload artifact | ||
uses: actions/upload-pages-artifact@v3 | ||
with: | ||
path: ./public | ||
|
||
# Deployment job | ||
deploy: | ||
environment: | ||
name: github-pages | ||
url: ${{ steps.deployment.outputs.page_url }} | ||
runs-on: ubuntu-latest | ||
needs: build | ||
steps: | ||
- name: Deploy to GitHub Pages | ||
id: deployment | ||
uses: actions/deploy-pages@v4 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,77 @@ | ||
# Prerequisites | ||
*.d | ||
|
||
# Compiled Object files | ||
*.slo | ||
*.lo | ||
*.o | ||
*.obj | ||
|
||
# Precompiled Headers | ||
*.gch | ||
*.pch | ||
|
||
# Compiled Dynamic libraries | ||
*.so | ||
*.dylib | ||
*.dll | ||
|
||
# Fortran module files | ||
*.mod | ||
*.smod | ||
|
||
# Compiled Static libraries | ||
*.lai | ||
*.la | ||
*.a | ||
*.lib | ||
|
||
# Executables | ||
*.exe | ||
*.out | ||
*.app | ||
|
||
# Visual Studio Code | ||
.vscode/ | ||
# Local History for Visual Studio Code | ||
.history/ | ||
# Built Visual Studio Code Extensions | ||
*.vsix | ||
## User settings | ||
xcuserdata/ | ||
|
||
## Xcode 8 and earlier | ||
*.xcscmblueprint | ||
*.xccheckout | ||
|
||
# General | ||
.DS_Store | ||
.AppleDouble | ||
.LSOverride | ||
|
||
# Icon must end with two \r | ||
Icon | ||
|
||
# Thumbnails | ||
._* | ||
|
||
# Files that might appear in the root of a volume | ||
.DocumentRevisions-V100 | ||
.fseventsd | ||
.Spotlight-V100 | ||
.TemporaryItems | ||
.Trashes | ||
.VolumeIcon.icns | ||
.com.apple.timemachine.donotpresent | ||
|
||
# Directories potentially created on remote AFP share | ||
.AppleDB | ||
.AppleDesktop | ||
Network Trash Folder | ||
Temporary Items | ||
.apdisk | ||
|
||
*~ | ||
latex/biblioteca.tex | ||
latex/biblioteca.log | ||
latex/getlatex |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
--- | ||
weight: 10 | ||
title: "DP" | ||
draft: false | ||
date: "2024-05-09T18:39:19-0300" | ||
description: "" | ||
publishdate: "2024-05-09T18:39:19-0300" | ||
--- |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
--- | ||
weight: 10 | ||
title: "Divide and Conquer DP" | ||
draft: false | ||
toc: true | ||
date: "2024-05-09T18:39:19-0300" | ||
publishdate: "2024-05-09T18:39:19-0300" | ||
description: "" | ||
--- | ||
|
||
## Sobre | ||
Particiona o array em k subarrays | ||
|
||
minimizando o somatorio das queries | ||
|
||
|
||
|
||
O(k n log n), assumindo quer query(l, r) eh O(1) | ||
|
||
|
||
|
||
Link original: [dcDp.cpp](https://github.com/brunomaletta/Biblioteca/tree/master/Codigo/DP/dcDp.cpp) | ||
|
||
## Código | ||
```cpp | ||
ll dp[MAX][2]; | ||
|
||
void solve(int k, int l, int r, int lk, int rk) { | ||
if (l > r) return; | ||
int m = (l+r)/2, p = -1; | ||
auto& ans = dp[m][k&1] = LINF; | ||
for (int i = max(m, lk); i <= rk; i++) { | ||
ll at = dp[i+1][~k&1] + query(m, i); | ||
if (at < ans) ans = at, p = i; | ||
} | ||
solve(k, l, m-1, lk, p), solve(k, m+1, r, p, rk); | ||
} | ||
|
||
ll DC(int n, int k) { | ||
dp[n][0] = dp[n][1] = 0; | ||
for (int i = 0; i < n; i++) dp[i][0] = LINF; | ||
for (int i = 1; i <= k; i++) solve(i, 0, n-i, 0, n-i); | ||
return dp[0][k&1]; | ||
} | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,94 @@ | ||
--- | ||
weight: 10 | ||
title: "Longest Common Subsequence" | ||
draft: false | ||
toc: true | ||
date: "2024-05-09T18:39:19-0300" | ||
publishdate: "2024-05-09T18:39:19-0300" | ||
description: "" | ||
--- | ||
|
||
## Sobre | ||
Computa a LCS entre dois arrays usando | ||
|
||
o algoritmo de Hirschberg para recuperar | ||
|
||
|
||
|
||
O(n*m), O(n+m) de memoria | ||
|
||
|
||
|
||
Link original: [lcs.cpp](https://github.com/brunomaletta/Biblioteca/tree/master/Codigo/DP/lcs.cpp) | ||
|
||
## Código | ||
```cpp | ||
int lcs_s[MAX], lcs_t[MAX]; | ||
int dp[2][MAX]; | ||
|
||
// dp[0][j] = max lcs(s[li...ri], t[lj, lj+j]) | ||
void dp_top(int li, int ri, int lj, int rj) { | ||
memset(dp[0], 0, (rj-lj+1)*sizeof(dp[0][0])); | ||
for (int i = li; i <= ri; i++) { | ||
for (int j = rj; j >= lj; j--) | ||
dp[0][j - lj] = max(dp[0][j - lj], | ||
(lcs_s[i] == lcs_t[j]) + (j > lj ? dp[0][j-1 - lj] : 0)); | ||
for (int j = lj+1; j <= rj; j++) | ||
dp[0][j - lj] = max(dp[0][j - lj], dp[0][j-1 -lj]); | ||
} | ||
} | ||
|
||
// dp[1][j] = max lcs(s[li...ri], t[lj+j, rj]) | ||
void dp_bottom(int li, int ri, int lj, int rj) { | ||
memset(dp[1], 0, (rj-lj+1)*sizeof(dp[1][0])); | ||
for (int i = ri; i >= li; i--) { | ||
for (int j = lj; j <= rj; j++) | ||
dp[1][j - lj] = max(dp[1][j - lj], | ||
(lcs_s[i] == lcs_t[j]) + (j < rj ? dp[1][j+1 - lj] : 0)); | ||
for (int j = rj-1; j >= lj; j--) | ||
dp[1][j - lj] = max(dp[1][j - lj], dp[1][j+1 - lj]); | ||
} | ||
} | ||
|
||
void solve(vector<int>& ans, int li, int ri, int lj, int rj) { | ||
if (li == ri){ | ||
for (int j = lj; j <= rj; j++) | ||
if (lcs_s[li] == lcs_t[j]){ | ||
ans.push_back(lcs_t[j]); | ||
break; | ||
} | ||
return; | ||
} | ||
if (lj == rj){ | ||
for (int i = li; i <= ri; i++){ | ||
if (lcs_s[i] == lcs_t[lj]){ | ||
ans.push_back(lcs_s[i]); | ||
break; | ||
} | ||
} | ||
return; | ||
} | ||
int mi = (li+ri)/2; | ||
dp_top(li, mi, lj, rj), dp_bottom(mi+1, ri, lj, rj); | ||
|
||
int j_ = 0, mx = -1; | ||
|
||
for (int j = lj-1; j <= rj; j++) { | ||
int val = 0; | ||
if (j >= lj) val += dp[0][j - lj]; | ||
if (j < rj) val += dp[1][j+1 - lj]; | ||
|
||
if (val >= mx) mx = val, j_ = j; | ||
} | ||
if (mx == -1) return; | ||
solve(ans, li, mi, lj, j_), solve(ans, mi+1, ri, j_+1, rj); | ||
} | ||
|
||
vector<int> lcs(const vector<int>& s, const vector<int>& t) { | ||
for (int i = 0; i < s.size(); i++) lcs_s[i] = s[i]; | ||
for (int i = 0; i < t.size(); i++) lcs_t[i] = t[i]; | ||
vector<int> ans; | ||
solve(ans, 0, s.size()-1, 0, t.size()-1); | ||
return ans; | ||
} | ||
``` |
Oops, something went wrong.