diff options
author | Ta180m | 2020-07-11 18:09:51 -0500 |
---|---|---|
committer | Ta180m | 2020-07-11 18:09:51 -0500 |
commit | a9a4d119c4890c3627f014f0ff91628230d8493d (patch) | |
tree | 195cc87cf2d1c8586c450ec10e1d84630fb43424 | |
parent | 837914112f9910acfb0c51590d5954c6638deafa (diff) |
rip java and python
-rw-r--r-- | .vscode/settings.json | 5 | ||||
-rw-r--r-- | gymnastics.cpp | 34 | ||||
-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-- | lineup.txt | 14 | ||||
-rw-r--r-- | whereami.cpp | 34 | ||||
-rw-r--r-- | whereami.java | 0 | ||||
-rw-r--r-- | whereami.py | 0 |
11 files changed, 96 insertions, 0 deletions
diff --git a/.vscode/settings.json b/.vscode/settings.json new file mode 100644 index 0000000..bab68c5 --- /dev/null +++ b/.vscode/settings.json @@ -0,0 +1,5 @@ +{ + "files.associations": { + "iosfwd": "cpp" + } +}
\ No newline at end of file diff --git a/gymnastics.cpp b/gymnastics.cpp new file mode 100644 index 0000000..7789ded --- /dev/null +++ b/gymnastics.cpp @@ -0,0 +1,34 @@ +#include <bits/stdc++.h> +using namespace std; + +int main() { + ifstream cin("gymnastics.in"); + ofstream cout("gymnastics.out"); + + int K, N; + cin >> K >> N; + + int rnk[11][22]; + for (int i = 1; i <= K; ++i) { + for (int j = 1; j <= N; ++j) { + int cow; + cin >> cow; + rnk[i][cow] = j; + } + } + + int ans = 0; + for (int a = 1; a <= N; ++a) { + for (int b = 1; b <= N; ++b) { + if (a == b) continue; + + bool better = true; + for (int i = 1; i <= K; ++i) { + if (rnk[i][a] > rnk[i][b]) better = false; + } + + if (better) ++ans; + } + } + cout << ans; +}
\ No newline at end of file diff --git a/gymnastics.java b/gymnastics.java new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/gymnastics.java diff --git a/gymnastics.py b/gymnastics.py new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/gymnastics.py diff --git a/lineup.cpp b/lineup.cpp new file mode 100644 index 0000000..a5dc4a2 --- /dev/null +++ b/lineup.cpp @@ -0,0 +1,6 @@ +#include <bits/stdc++.h> +using namespace std; + +int main() { + +}
\ No newline at end of file diff --git a/lineup.java b/lineup.java new file mode 100644 index 0000000..bc279d8 --- /dev/null +++ b/lineup.java @@ -0,0 +1,3 @@ +public class lineup { + +}
\ No newline at end of file diff --git a/lineup.py b/lineup.py new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/lineup.py diff --git a/lineup.txt b/lineup.txt new file mode 100644 index 0000000..efc74b8 --- /dev/null +++ b/lineup.txt @@ -0,0 +1,14 @@ +read in N + +constraints[N][2] +for i from 1 to N: + read in constraints[i][1] and constraints[i][2] + +for every permutation P of [ Bessie, Buttercup, Belinda, Beatrice, Bella, Blue, Betsy, Sue ]: + for i from 1 to N: + bad = false + if the position of constraints[i][1] is NOT next to position of constraints[i][2] + then set bad to true + + if NOT bad + then output P
\ No newline at end of file diff --git a/whereami.cpp b/whereami.cpp new file mode 100644 index 0000000..3237838 --- /dev/null +++ b/whereami.cpp @@ -0,0 +1,34 @@ +#include <bits/stdc++.h> +using namespace std; + +int main() { + ifstream cin("whereami.in"); + ofstream cout("whereami.out"); + + int N; + cin >> N; + string S; + cin >> S; + + for (int K = 1; K <= N; ++K) { + bool good = true; + + for (int a = 0; a <= N - K; ++a) { + for (int b = 0; b <= N - K; ++b) { + if (a == b) continue; + + bool string_equal = true; + for (int i = 0; i <= K - 1; ++i) { + if (S[a + i] != S[b + i]) string_equal = false; + } + + if (string_equal) good = false; + } + } + + if (good) { + cout << K; + return 0; + } + } +}
\ No newline at end of file diff --git a/whereami.java b/whereami.java new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/whereami.java diff --git a/whereami.py b/whereami.py new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/whereami.py |