From: Skullheadx Date: Thu, 26 Jan 2023 15:15:11 +0000 (-0500) Subject: 2020 S2 X-Git-Url: http://git.skullheadx.com/index.js?a=commitdiff_plain;h=97e0b80e5ca590b2228f92fd2731eff0c9d93abc;p=CCC.git 2020 S2 --- diff --git a/.gitignore b/.gitignore index 17ada73..2b06a51 100644 --- a/.gitignore +++ b/.gitignore @@ -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 index 0000000..d33fc29 --- /dev/null +++ b/Main/C++/2020/S2_2.cpp @@ -0,0 +1,35 @@ +#include + +using namespace std; + +int M, N; +vector 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 index 0000000..7c1bcab --- /dev/null +++ b/Main/Python/2010/S3.py @@ -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 diff --git a/Main/Python/2020/S2.py b/Main/Python/2020/S2.py index 83c852d..34a3cae 100644 --- a/Main/Python/2020/S2.py +++ b/Main/Python/2020/S2.py @@ -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))