diff options
| -rw-r--r-- | .gitignore | 2 | ||||
| -rwxr-xr-x | MirrorGrid/main | bin | 0 -> 30448 bytes | |||
| -rw-r--r-- | MirrorGrid/main.cpp | 30 | ||||
| -rw-r--r-- | MirrorGrid/main_input0.txt | 25 | ||||
| -rw-r--r-- | MirrorGrid/main_output0.txt | 5 | ||||
| -rwxr-xr-x | doubleStrings/main | bin | 0 -> 64192 bytes | |||
| -rw-r--r-- | doubleStrings/main.cpp | 32 | ||||
| -rw-r--r-- | doubleStrings/main_input0.txt | 20 | ||||
| -rw-r--r-- | doubleStrings/main_output0.txt | 3 | ||||
| -rwxr-xr-x | icpcBallons/main | bin | 0 -> 48656 bytes | |||
| -rw-r--r-- | icpcBallons/main.cpp | 28 | ||||
| -rw-r--r-- | icpcBallons/main_input0.txt | 13 | ||||
| -rw-r--r-- | icpcBallons/main_output0.txt | 6 | ||||
| -rwxr-xr-x | yesOrYes/main | bin | 0 -> 24208 bytes | |||
| -rw-r--r-- | yesOrYes/main.cpp | 22 | ||||
| -rw-r--r-- | yesOrYes/main_input0.txt | 11 | ||||
| -rw-r--r-- | yesOrYes/main_output0.txt | 10 |
17 files changed, 207 insertions, 0 deletions
@@ -1,3 +1,5 @@ binaries .ccls-cache *.o + +Cypher
\ No newline at end of file diff --git a/MirrorGrid/main b/MirrorGrid/main Binary files differnew file mode 100755 index 0000000..e41e986 --- /dev/null +++ b/MirrorGrid/main diff --git a/MirrorGrid/main.cpp b/MirrorGrid/main.cpp new file mode 100644 index 0000000..e72b5a4 --- /dev/null +++ b/MirrorGrid/main.cpp @@ -0,0 +1,30 @@ +#include <bits/stdc++.h> + +using namespace std; + +int main() { + ios_base::sync_with_stdio(false); + cin.tie(NULL); + int tt; + cin >> tt; + while (tt--) { + int n; + cin >> n; + vector<string> arr(n); + for (auto &x : arr) { + cin >> x; + } + int count = 0; + for (int i = 0; i < n / 2; i++) { + for (int j = 0; j < (n + 1) / 2; j++) { + int ch1 = arr[i][j] - '0'; + int ch2 = arr[n - 1 - j][i] - '0'; + int ch3 = arr[n - i - 1][n - 1 - j] - '0'; + int ch4 = arr[j][n - 1 -i] - '0'; + int sum = ch1 + ch2 + ch3 + ch4; + count += min(4 - sum, sum); + } + } + cout << count << endl; + } +} diff --git a/MirrorGrid/main_input0.txt b/MirrorGrid/main_input0.txt new file mode 100644 index 0000000..019af89 --- /dev/null +++ b/MirrorGrid/main_input0.txt @@ -0,0 +1,25 @@ +5 +3 +010 +110 +010 +1 +0 +5 +11100 +11011 +01011 +10011 +11000 +5 +01000 +10101 +01010 +00010 +01001 +5 +11001 +00000 +11111 +10110 +01111 diff --git a/MirrorGrid/main_output0.txt b/MirrorGrid/main_output0.txt new file mode 100644 index 0000000..9944ffa --- /dev/null +++ b/MirrorGrid/main_output0.txt @@ -0,0 +1,5 @@ +1 +0 +9 +7 +6 diff --git a/doubleStrings/main b/doubleStrings/main Binary files differnew file mode 100755 index 0000000..c2ecd0d --- /dev/null +++ b/doubleStrings/main diff --git a/doubleStrings/main.cpp b/doubleStrings/main.cpp new file mode 100644 index 0000000..532a4c5 --- /dev/null +++ b/doubleStrings/main.cpp @@ -0,0 +1,32 @@ +#include <bits/stdc++.h> + +using namespace std; + +int main() { + ios_base::sync_with_stdio(false); + cin.tie(NULL); + int tt; + cin >> tt; + while (tt--) { + int n; + cin >> n; + vector<string> v(n); + for (auto &x : v) + cin >> x; + set<string> st(v.begin(), v.end()); + string ans = ""; + for (int i = 0; i < n; i++) { + int len = v[i].size(); + bool ok = false; + for (int j = 0; j < len; j++) { + string prefix = v[i].substr(0, j + 1); + if (st.find(prefix) != st.end()) { + string suff = v[i].substr(j + 1); + ok = ok || st.find(suff) != st.end(); + } + } + ans += ('0' + ok); + } + cout << ans << endl; + } +} diff --git a/doubleStrings/main_input0.txt b/doubleStrings/main_input0.txt new file mode 100644 index 0000000..d988bc1 --- /dev/null +++ b/doubleStrings/main_input0.txt @@ -0,0 +1,20 @@ +3 +5 +abab +ab +abc +abacb +c +3 +x +xx +xxx +8 +codeforc +es +codes +cod +forc +forces +e +code diff --git a/doubleStrings/main_output0.txt b/doubleStrings/main_output0.txt new file mode 100644 index 0000000..450a42b --- /dev/null +++ b/doubleStrings/main_output0.txt @@ -0,0 +1,3 @@ +10100 +011 +10100101 diff --git a/icpcBallons/main b/icpcBallons/main Binary files differnew file mode 100755 index 0000000..cde2feb --- /dev/null +++ b/icpcBallons/main diff --git a/icpcBallons/main.cpp b/icpcBallons/main.cpp new file mode 100644 index 0000000..082df7c --- /dev/null +++ b/icpcBallons/main.cpp @@ -0,0 +1,28 @@ +#include<bits/stdc++.h> + +using namespace std; + +int main () { + ios_base::sync_with_stdio(false); + cin.tie(NULL); + int tt; + cin >> tt; + while(tt--){ + int n; + cin >> n; + string s; + cin >> s; + map<char, int> mp; + for(auto ch : s) { + mp[ch]++; + } + int ans = 0; + for(auto p : mp) { + if(p.second >= 2) { + ans += p.second - 1; + } + } + ans += mp.size() * 2; + cout << ans << endl; + } +} diff --git a/icpcBallons/main_input0.txt b/icpcBallons/main_input0.txt new file mode 100644 index 0000000..c1839b2 --- /dev/null +++ b/icpcBallons/main_input0.txt @@ -0,0 +1,13 @@ +6 +3 +ABA +1 +A +3 +ORZ +5 +BAAAA +4 +BKPT +10 +CODEFORCES diff --git a/icpcBallons/main_output0.txt b/icpcBallons/main_output0.txt new file mode 100644 index 0000000..b040190 --- /dev/null +++ b/icpcBallons/main_output0.txt @@ -0,0 +1,6 @@ +5 +2 +6 +7 +8 +17 diff --git a/yesOrYes/main b/yesOrYes/main Binary files differnew file mode 100755 index 0000000..77ce258 --- /dev/null +++ b/yesOrYes/main diff --git a/yesOrYes/main.cpp b/yesOrYes/main.cpp new file mode 100644 index 0000000..04c4fd5 --- /dev/null +++ b/yesOrYes/main.cpp @@ -0,0 +1,22 @@ +#include<bits/stdc++.h> + +using namespace std; + +int main () { + ios_base::sync_with_stdio(false); + cin.tie(NULL); + int tt; + cin >> tt; + while(tt--){ + string s; + cin >> s; + for(auto &c : s){ + c = tolower(c); + } + if(s == "yes") { + cout << "YES" << endl; + } else { + cout << "NO" << endl; + } + } +} diff --git a/yesOrYes/main_input0.txt b/yesOrYes/main_input0.txt new file mode 100644 index 0000000..b6e9152 --- /dev/null +++ b/yesOrYes/main_input0.txt @@ -0,0 +1,11 @@ +10 +YES +yES +yes +Yes +YeS +Noo +orZ +yEz +Yas +XES diff --git a/yesOrYes/main_output0.txt b/yesOrYes/main_output0.txt new file mode 100644 index 0000000..1f336ce --- /dev/null +++ b/yesOrYes/main_output0.txt @@ -0,0 +1,10 @@ +YES +YES +YES +YES +YES +NO +NO +NO +NO +NO |
