]> Skullheadx's Git Forge - CCC.git/commitdiff
2020 S2
authorSkullheadx <admonty1@gmail.com>
Thu, 26 Jan 2023 15:15:11 +0000 (10:15 -0500)
committerSkullheadx <admonty1@gmail.com>
Thu, 26 Jan 2023 15:15:11 +0000 (10:15 -0500)
.gitignore
Main/C++/2020/S2_2.cpp [new file with mode: 0644]
Main/Python/2010/S3.py [new file with mode: 0644]
Main/Python/2020/S2.py

index 17ada7301218973c6739b1cef4183d5f56c1ab1c..2b06a518d175637405f9c2a16c4267c468ce42d4 100644 (file)
@@ -1,10 +1,11 @@
 *.xml
 *.iml
-
+.vs/
+.idea/
 *.iml
 *.o
 *.exe
 .idea/CCC.iml
 .idea/misc.xml
 *.in
-*.out
\ No newline at end of file
+*.out
diff --git a/Main/C++/2020/S2_2.cpp b/Main/C++/2020/S2_2.cpp
new file mode 100644 (file)
index 0000000..d33fc29
--- /dev/null
@@ -0,0 +1,35 @@
+#include <bits/stdc++.h>
+
+using namespace std;
+
+int M, N;
+vector<int> todo[1000005];
+bool done[1000005];
+
+void dfs(int x) {
+       if (done[x]) {
+               return;
+       }
+       if (x == N * M) {
+               cout << "yes" << endl;
+               exit(0);
+       }
+       done[x] = 1;
+       for (int& t : todo[x]) {
+               dfs(t);
+       }
+}
+
+int main() {
+       cin.tie(0)->sync_with_stdio(0);
+       cin >> M >> N;
+       for (int i = 1; i <= M; i++) {
+               for (int j = 1; j <= N; j++) {
+                       int x;
+                       cin >> x;
+                       todo[i * j].push_back(x);
+               }
+       }
+       dfs(1);
+       cout << "no" << endl;
+}
\ No newline at end of file
diff --git a/Main/Python/2010/S3.py b/Main/Python/2010/S3.py
new file mode 100644 (file)
index 0000000..7c1bcab
--- /dev/null
@@ -0,0 +1,7 @@
+C = 1000000
+
+
+H = int(input())
+for i in range(H):
+    address = int(input())
+k = int(input())
\ No newline at end of file
index 83c852dafecd23777baec0a122e9c2da1e184959..34a3cae93991193d022ac4995ab0a88aba484c92 100644 (file)
@@ -1,4 +1,4 @@
-from queue import Queue
+from queue import LifoQueue
 from math import sqrt
 # from functools import lru_cache
 
@@ -20,7 +20,7 @@ room = []
 for i in range(M):
     room.append(tuple(map(int, input().split())))
 
-q = Queue()
+q = LifoQueue()
 
 q.put((0, 0))