Skip to content

Commit

Permalink
2024-03-01
Browse files Browse the repository at this point in the history
  • Loading branch information
miniron-v committed Mar 1, 2024
1 parent 8cb9a79 commit 6ba0cec
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 1 deletion.
3 changes: 2 additions & 1 deletion miniron-v/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,5 +21,6 @@
| 16μ°¨μ‹œ | 2024.02.18 | μˆ˜ν•™ | [ν•©](https://www.acmicpc.net/problem/1081) | [#61](https://github.com/AlgoLeadMe/AlgoLeadMe-5/pull/61) |
| 17μ°¨μ‹œ | 2024.02.21 | DP | [제곱수의 ν•©](https://www.acmicpc.net/problem/1699) | [#64](https://github.com/AlgoLeadMe/AlgoLeadMe-5/pull/64) |
| 18μ°¨μ‹œ | 2024.02.24 | 이뢄 탐색 | [K번째 수](https://www.acmicpc.net/problem/1300) | [#66](https://github.com/AlgoLeadMe/AlgoLeadMe-5/pull/66) |
| 19μ°¨μ‹œ | 2024.02.27 | λ‹€μ΅μŠ€νŠΈλΌ | [μ΅œλ‹¨κ²½λ‘œ](https://www.acmicpc.net/problem/1753) | [#70](https://github.com/AlgoLeadMe/AlgoLeadMe-5/pull/70) |
| 19μ°¨μ‹œ | 2024.02.27 | κ·Έλž˜ν”„, λ‹€μ΅μŠ€νŠΈλΌ | [μ΅œλ‹¨κ²½λ‘œ](https://www.acmicpc.net/problem/1753) | [#70](https://github.com/AlgoLeadMe/AlgoLeadMe-5/pull/70) |
| 20μ°¨μ‹œ | 2024.03.01 | κ·Έλž˜ν”„, ν”Œλ‘œμ΄λ“œ-μ›Œμ…œ | [λλ‚˜μ§€ μ•ŠλŠ” νŒŒν‹°](https://www.acmicpc.net/problem/11265) | [#74](https://github.com/AlgoLeadMe/AlgoLeadMe-5/pull/74) |
---
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
#include <iostream>
#include <vector>

int main() {
int n, m;
std::cin >> n >> m;

std::vector<std::vector<int>> graph(n + 1, std::vector<int>(n + 1));

// INF와 자기 μžμ‹ μ„ 0으둜 μ΄ˆκΈ°ν™”ν•˜λŠ” 과정이 μž…λ ₯에 포함됨.
// 즉, λͺ¨λ“  간선이 μ—°κ²°λ˜μ–΄ 있음.
for (int i = 1; i <= n; ++i) {
for (int j = 1; j <= n; ++j) {
std::cin >> graph[i][j];
}
}

for (int k = 1; k <= n; ++k) {
for (int i = 1; i <= n; ++i) {
for (int j = 1; j <= n; ++j) {
graph[i][j] = std::min(graph[i][j], graph[i][k] + graph[k][j]);
}
}
}

while (m--) {
int a, b, c;
std::cin >> a >> b >> c;

std::cout << ((graph[a][b] <= c) ? "Enjoy other party\n" : "Stay here\n");
}
}

0 comments on commit 6ba0cec

Please sign in to comment.