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 +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 diff --git a/gymnastics.py b/gymnastics.py new file mode 100644 index 0000000..e69de29 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 +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 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 +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 diff --git a/whereami.py b/whereami.py new file mode 100644 index 0000000..e69de29