diff options
author | Anthony Wang | 2020-07-25 18:07:43 -0500 |
---|---|---|
committer | Anthony Wang | 2020-07-25 18:07:43 -0500 |
commit | 39af2624d53a9aa3682404884629dbd1aee5e712 (patch) | |
tree | fe4e5d0e8abed1000f54271d69e599652e27ef86 | |
parent | 14e6de8bd01b43938dcc791960f710dee93eea54 (diff) |
Clean up repo
-rw-r--r-- | .vscode/settings.json | 77 | ||||
-rw-r--r-- | guess.cpp | 43 | ||||
-rw-r--r-- | gymnastics.java | 0 | ||||
-rw-r--r-- | gymnastics.py | 0 | ||||
-rw-r--r-- | lineup.cpp | 6 | ||||
-rw-r--r-- | lineup.java | 3 | ||||
-rw-r--r-- | lineup.py | 0 | ||||
-rw-r--r-- | shell.cpp | 38 | ||||
-rw-r--r-- | sleepy.cpp | 25 | ||||
-rw-r--r-- | whereami.java | 0 | ||||
-rw-r--r-- | whereami.py | 0 |
11 files changed, 179 insertions, 13 deletions
diff --git a/.vscode/settings.json b/.vscode/settings.json index 91e2cef..6103329 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -1,5 +1,74 @@ -{
- "files.associations": {
- "iosfwd": "cpp"
- }
+{ + "files.associations": { + "iostream": "cpp", + "iomanip": "cpp", + "ostream": "cpp", + "array": "cpp", + "atomic": "cpp", + "*.tcc": "cpp", + "bitset": "cpp", + "cctype": "cpp", + "cfenv": "cpp", + "chrono": "cpp", + "cinttypes": "cpp", + "clocale": "cpp", + "cmath": "cpp", + "codecvt": "cpp", + "complex": "cpp", + "condition_variable": "cpp", + "csetjmp": "cpp", + "csignal": "cpp", + "cstdarg": "cpp", + "cstddef": "cpp", + "cstdint": "cpp", + "cstdio": "cpp", + "cstdlib": "cpp", + "cstring": "cpp", + "ctime": "cpp", + "cuchar": "cpp", + "cwchar": "cpp", + "cwctype": "cpp", + "deque": "cpp", + "forward_list": "cpp", + "list": "cpp", + "unordered_map": "cpp", + "unordered_set": "cpp", + "vector": "cpp", + "exception": "cpp", + "algorithm": "cpp", + "functional": "cpp", + "iterator": "cpp", + "map": "cpp", + "memory": "cpp", + "memory_resource": "cpp", + "numeric": "cpp", + "optional": "cpp", + "random": "cpp", + "ratio": "cpp", + "regex": "cpp", + "set": "cpp", + "string": "cpp", + "string_view": "cpp", + "system_error": "cpp", + "tuple": "cpp", + "type_traits": "cpp", + "utility": "cpp", + "fstream": "cpp", + "future": "cpp", + "initializer_list": "cpp", + "iosfwd": "cpp", + "istream": "cpp", + "limits": "cpp", + "mutex": "cpp", + "new": "cpp", + "scoped_allocator": "cpp", + "shared_mutex": "cpp", + "sstream": "cpp", + "stdexcept": "cpp", + "streambuf": "cpp", + "thread": "cpp", + "typeindex": "cpp", + "typeinfo": "cpp", + "valarray": "cpp" + } }
\ No newline at end of file diff --git a/guess.cpp b/guess.cpp new file mode 100644 index 0000000..035150d --- /dev/null +++ b/guess.cpp @@ -0,0 +1,43 @@ +#include <bits/stdc++.h> +using namespace std; + +int K[101]; +string charact[101][101]; + +int main() { + ifstream cin("guess.in"); + ofstream cout("guess.out"); + + int N; + cin >> N; + + for (int i = 0; i < N; ++i) { + string name; + cin >> name; + + cin >> K[i]; + for (int j = 0; j < K[i]; ++j) cin >> charact[i][j]; + } + + int ans = 0; + for (int a = 0; a < N; ++a) { + for (int b = a + 1; b < N; ++b) { + int cnt = 0; // a and b are the two animals + + for (int i = 0; i < K[a]; ++i) { + bool found = false; + + // search for a's charact in b's characts + for (int j = 0; j < K[b]; ++j) { + if (charact[a][i] == charact[b][j]) found = true; + } + + if (found == true) ++cnt; + } + + ans = max(cnt + 1, ans); + } + } + + cout << ans; +}
\ No newline at end of file diff --git a/gymnastics.java b/gymnastics.java deleted file mode 100644 index e69de29..0000000 --- a/gymnastics.java +++ /dev/null diff --git a/gymnastics.py b/gymnastics.py deleted file mode 100644 index e69de29..0000000 --- a/gymnastics.py +++ /dev/null diff --git a/lineup.cpp b/lineup.cpp deleted file mode 100644 index 7121a4b..0000000 --- a/lineup.cpp +++ /dev/null @@ -1,6 +0,0 @@ -#include <bits/stdc++.h>
-using namespace std;
-
-int main() {
-
-}
\ No newline at end of file diff --git a/lineup.java b/lineup.java deleted file mode 100644 index a63e60e..0000000 --- a/lineup.java +++ /dev/null @@ -1,3 +0,0 @@ -public class lineup {
-
-}
\ No newline at end of file diff --git a/lineup.py b/lineup.py deleted file mode 100644 index e69de29..0000000 --- a/lineup.py +++ /dev/null diff --git a/shell.cpp b/shell.cpp new file mode 100644 index 0000000..97b641d --- /dev/null +++ b/shell.cpp @@ -0,0 +1,38 @@ +#include <bits/stdc++.h> +using namespace std; + +int main() { + ifstream cin("shell.in"); + ofstream cout("shell.out"); + + int N; + cin >> N; + + int a[101], b[101], g[101]; + for (int i = 0; i < N; ++i) { + cin >> a[i] >> b[i] >> g[i]; + } + + int ans = 0; + + for (int start : { 1, 2, 3 }) { + int pos = start; + int cnt = 0; + for (int i = 0; i < N; ++i) { + if (pos == a[i]) { + pos = b[i]; + } + else if (pos == b[i]) { + pos = a[i]; + } + + if (pos == g[i]) { + ++cnt; + } + } + + ans = max(cnt, ans); + } + + cout << ans; +}
\ No newline at end of file diff --git a/sleepy.cpp b/sleepy.cpp new file mode 100644 index 0000000..145ff3a --- /dev/null +++ b/sleepy.cpp @@ -0,0 +1,25 @@ +#include <bits/stdc++.h> +using namespace std; + +int main() { + ifstream cin("sleepy.in"); + ofstream cout("sleepy.out"); + + int N; + cin >> N; + + int p[101]; + for (int i = 0; i < N; ++i) cin >> p[i]; + + int ans = 1; + for (int i = N - 2; i >= 0; --i) { + if (p[i] < p[i + 1]) { + ++ans; + } + else { + break; + } + } + + cout << N - ans; +}
\ No newline at end of file diff --git a/whereami.java b/whereami.java deleted file mode 100644 index e69de29..0000000 --- a/whereami.java +++ /dev/null diff --git a/whereami.py b/whereami.py deleted file mode 100644 index e69de29..0000000 --- a/whereami.py +++ /dev/null |