diff --git a/cses/increasing-array/solution.cc b/cses/increasing-array.cc similarity index 100% rename from cses/increasing-array/solution.cc rename to cses/increasing-array.cc diff --git a/cses/increasing-array/solution.in b/cses/increasing-array.in similarity index 100% rename from cses/increasing-array/solution.in rename to cses/increasing-array.in diff --git a/cses/increasing-array/solution.out b/cses/increasing-array.out similarity index 100% rename from cses/increasing-array/solution.out rename to cses/increasing-array.out diff --git a/cses/increasing-array/compile_flags.txt b/cses/increasing-array.txt similarity index 100% rename from cses/increasing-array/compile_flags.txt rename to cses/increasing-array.txt diff --git a/cses/increasing-array/.clang-format b/cses/increasing-array/.clang-format deleted file mode 100644 index e7350c4..0000000 --- a/cses/increasing-array/.clang-format +++ /dev/null @@ -1,9 +0,0 @@ -BasedOnStyle: Google -AllowShortBlocksOnASingleLine: false -AllowShortCaseLabelsOnASingleLine: false -AllowShortCompoundRequirementOnASingleLine: false -AllowShortEnumsOnASingleLine: false -AllowShortFunctionsOnASingleLine: false -AllowShortIfStatementsOnASingleLine: false -AllowShortLambdasOnASingleLine: false -AllowShortLoopsOnASingleLine: false diff --git a/cses/increasing-array/.clangd b/cses/increasing-array/.clangd deleted file mode 100644 index 4f8ead9..0000000 --- a/cses/increasing-array/.clangd +++ /dev/null @@ -1,8 +0,0 @@ -CompileFlags: - Add: - - -Wall - - -Wextra - - -Wpedantic - - -Wshadow - - -DLOCAL - - -Wno-unknown-pragmas \ No newline at end of file diff --git a/cses/missing-number/solution.cc b/cses/missing-number.cc similarity index 100% rename from cses/missing-number/solution.cc rename to cses/missing-number.cc diff --git a/cses/missing-number/solution.in b/cses/missing-number.in similarity index 100% rename from cses/missing-number/solution.in rename to cses/missing-number.in diff --git a/cses/missing-number/solution.out b/cses/missing-number.out similarity index 100% rename from cses/missing-number/solution.out rename to cses/missing-number.out diff --git a/cses/missing-number/compile_flags.txt b/cses/missing-number.txt similarity index 100% rename from cses/missing-number/compile_flags.txt rename to cses/missing-number.txt diff --git a/cses/missing-number/.clang-format b/cses/missing-number/.clang-format deleted file mode 100644 index e7350c4..0000000 --- a/cses/missing-number/.clang-format +++ /dev/null @@ -1,9 +0,0 @@ -BasedOnStyle: Google -AllowShortBlocksOnASingleLine: false -AllowShortCaseLabelsOnASingleLine: false -AllowShortCompoundRequirementOnASingleLine: false -AllowShortEnumsOnASingleLine: false -AllowShortFunctionsOnASingleLine: false -AllowShortIfStatementsOnASingleLine: false -AllowShortLambdasOnASingleLine: false -AllowShortLoopsOnASingleLine: false diff --git a/cses/missing-number/.clangd b/cses/missing-number/.clangd deleted file mode 100644 index 4f8ead9..0000000 --- a/cses/missing-number/.clangd +++ /dev/null @@ -1,8 +0,0 @@ -CompileFlags: - Add: - - -Wall - - -Wextra - - -Wpedantic - - -Wshadow - - -DLOCAL - - -Wno-unknown-pragmas \ No newline at end of file diff --git a/cses/number-spiral/solution.cc b/cses/number-spiral.cc similarity index 100% rename from cses/number-spiral/solution.cc rename to cses/number-spiral.cc diff --git a/cses/number-spiral/solution.in b/cses/number-spiral.in similarity index 100% rename from cses/number-spiral/solution.in rename to cses/number-spiral.in diff --git a/cses/number-spiral/solution.out b/cses/number-spiral.out similarity index 100% rename from cses/number-spiral/solution.out rename to cses/number-spiral.out diff --git a/cses/number-spiral/compile_flags.txt b/cses/number-spiral.txt similarity index 100% rename from cses/number-spiral/compile_flags.txt rename to cses/number-spiral.txt diff --git a/cses/number-spiral/.clang-format b/cses/number-spiral/.clang-format deleted file mode 100644 index e7350c4..0000000 --- a/cses/number-spiral/.clang-format +++ /dev/null @@ -1,9 +0,0 @@ -BasedOnStyle: Google -AllowShortBlocksOnASingleLine: false -AllowShortCaseLabelsOnASingleLine: false -AllowShortCompoundRequirementOnASingleLine: false -AllowShortEnumsOnASingleLine: false -AllowShortFunctionsOnASingleLine: false -AllowShortIfStatementsOnASingleLine: false -AllowShortLambdasOnASingleLine: false -AllowShortLoopsOnASingleLine: false diff --git a/cses/number-spiral/.clangd b/cses/number-spiral/.clangd deleted file mode 100644 index 4f8ead9..0000000 --- a/cses/number-spiral/.clangd +++ /dev/null @@ -1,8 +0,0 @@ -CompileFlags: - Add: - - -Wall - - -Wextra - - -Wpedantic - - -Wshadow - - -DLOCAL - - -Wno-unknown-pragmas \ No newline at end of file diff --git a/cses/permutations/solution.cc b/cses/permutations.cc similarity index 100% rename from cses/permutations/solution.cc rename to cses/permutations.cc diff --git a/cses/permutations/solution.in b/cses/permutations.in similarity index 100% rename from cses/permutations/solution.in rename to cses/permutations.in diff --git a/cses/permutations/solution.out b/cses/permutations.out similarity index 100% rename from cses/permutations/solution.out rename to cses/permutations.out diff --git a/cses/permutations/compile_flags.txt b/cses/permutations.txt similarity index 100% rename from cses/permutations/compile_flags.txt rename to cses/permutations.txt diff --git a/cses/permutations/.clang-format b/cses/permutations/.clang-format deleted file mode 100644 index e7350c4..0000000 --- a/cses/permutations/.clang-format +++ /dev/null @@ -1,9 +0,0 @@ -BasedOnStyle: Google -AllowShortBlocksOnASingleLine: false -AllowShortCaseLabelsOnASingleLine: false -AllowShortCompoundRequirementOnASingleLine: false -AllowShortEnumsOnASingleLine: false -AllowShortFunctionsOnASingleLine: false -AllowShortIfStatementsOnASingleLine: false -AllowShortLambdasOnASingleLine: false -AllowShortLoopsOnASingleLine: false diff --git a/cses/permutations/.clangd b/cses/permutations/.clangd deleted file mode 100644 index 4f8ead9..0000000 --- a/cses/permutations/.clangd +++ /dev/null @@ -1,8 +0,0 @@ -CompileFlags: - Add: - - -Wall - - -Wextra - - -Wpedantic - - -Wshadow - - -DLOCAL - - -Wno-unknown-pragmas \ No newline at end of file diff --git a/cses/repetitions/solution.cc b/cses/repetitions.cc similarity index 100% rename from cses/repetitions/solution.cc rename to cses/repetitions.cc diff --git a/cses/repetitions/solution.in b/cses/repetitions.in similarity index 100% rename from cses/repetitions/solution.in rename to cses/repetitions.in diff --git a/cses/repetitions/solution.out b/cses/repetitions.out similarity index 100% rename from cses/repetitions/solution.out rename to cses/repetitions.out diff --git a/cses/repetitions/compile_flags.txt b/cses/repetitions.txt similarity index 100% rename from cses/repetitions/compile_flags.txt rename to cses/repetitions.txt diff --git a/cses/repetitions/.clang-format b/cses/repetitions/.clang-format deleted file mode 100644 index e7350c4..0000000 --- a/cses/repetitions/.clang-format +++ /dev/null @@ -1,9 +0,0 @@ -BasedOnStyle: Google -AllowShortBlocksOnASingleLine: false -AllowShortCaseLabelsOnASingleLine: false -AllowShortCompoundRequirementOnASingleLine: false -AllowShortEnumsOnASingleLine: false -AllowShortFunctionsOnASingleLine: false -AllowShortIfStatementsOnASingleLine: false -AllowShortLambdasOnASingleLine: false -AllowShortLoopsOnASingleLine: false diff --git a/cses/repetitions/.clangd b/cses/repetitions/.clangd deleted file mode 100644 index 4f8ead9..0000000 --- a/cses/repetitions/.clangd +++ /dev/null @@ -1,8 +0,0 @@ -CompileFlags: - Add: - - -Wall - - -Wextra - - -Wpedantic - - -Wshadow - - -DLOCAL - - -Wno-unknown-pragmas \ No newline at end of file diff --git a/cses/script.bash b/cses/script.bash new file mode 100644 index 0000000..ea723e0 --- /dev/null +++ b/cses/script.bash @@ -0,0 +1,11 @@ +#!/bin/bash + +for dir in */; do + dir_name="${dir%/}" # Remove trailing slash + + for file in "$dir"*.*; do + ext="${file##*.}" # Extract extension + mv "$file" "./${dir_name}.$ext" + done + +done diff --git a/cses/two-knights/.clang-format b/cses/two-knights/.clang-format deleted file mode 100644 index e7350c4..0000000 --- a/cses/two-knights/.clang-format +++ /dev/null @@ -1,9 +0,0 @@ -BasedOnStyle: Google -AllowShortBlocksOnASingleLine: false -AllowShortCaseLabelsOnASingleLine: false -AllowShortCompoundRequirementOnASingleLine: false -AllowShortEnumsOnASingleLine: false -AllowShortFunctionsOnASingleLine: false -AllowShortIfStatementsOnASingleLine: false -AllowShortLambdasOnASingleLine: false -AllowShortLoopsOnASingleLine: false diff --git a/cses/two-knights/.clangd b/cses/two-knights/.clangd deleted file mode 100644 index 4f8ead9..0000000 --- a/cses/two-knights/.clangd +++ /dev/null @@ -1,8 +0,0 @@ -CompileFlags: - Add: - - -Wall - - -Wextra - - -Wpedantic - - -Wshadow - - -DLOCAL - - -Wno-unknown-pragmas \ No newline at end of file diff --git a/cses/two-knights/compile_flags.txt b/cses/two-knights/compile_flags.txt deleted file mode 100644 index a3d54a8..0000000 --- a/cses/two-knights/compile_flags.txt +++ /dev/null @@ -1,5 +0,0 @@ --Wall --Wextra --Wpedantic --Wshadow --DLOCAL diff --git a/cses/two-knights/solution.cc b/cses/two-knights/solution.cc deleted file mode 100644 index 3fbbf79..0000000 --- a/cses/two-knights/solution.cc +++ /dev/null @@ -1,58 +0,0 @@ -#include // {{{ - -// https://codeforces.com/blog/entry/96344 - -#pragma GCC optimize("O2,unroll-loops") -#pragma GCC target("avx2,bmi,bmi2,lzcnt,popcnt") - -using namespace std; - -template -constexpr T MIN = std::numeric_limits::min(); - -template -constexpr T MAX = std::numeric_limits::max(); - -template -[[nodiscard]] static T sc(auto &&x) { - return static_cast(x); -} - -template -[[nodiscard]] static T sz(auto &&x) { - return static_cast(x.size()); -} - -using ll = long long; -using ld = long double; -template -using vec = std::vector; -template -using arr = std::array; - -#define ff first -#define ss second -#define eb emplace_back -#define pb push_back -#define all(x) (x).begin(), (x).end() -#define rall(x) (x).rbegin(), (x).rend() -// }}} - -void solve() { - int n; - cin >> n; - for (ll i = 1; i <= n; ++i) { - ll ans = (i * i) * (i * i - 1) / 2; - ans -= 2 * 2 * (i - 1) * (i - 2); - cout << ans << endl; - } -} - -int main() { // {{{ - cin.tie(nullptr)->sync_with_stdio(false); - - solve(); - - return 0; -} -// }}} diff --git a/cses/two-knights/solution.in b/cses/two-knights/solution.in deleted file mode 100644 index 45a4fb7..0000000 --- a/cses/two-knights/solution.in +++ /dev/null @@ -1 +0,0 @@ -8 diff --git a/cses/two-knights/solution.out b/cses/two-knights/solution.out deleted file mode 100644 index d6de519..0000000 --- a/cses/two-knights/solution.out +++ /dev/null @@ -1,11 +0,0 @@ -0 -6 -28 -96 -252 -550 -1056 -1848 - -[code]: 0 -[time]: 4.07505 ms \ No newline at end of file diff --git a/cses/two-sets/.clang-format b/cses/two-sets/.clang-format deleted file mode 100644 index e7350c4..0000000 --- a/cses/two-sets/.clang-format +++ /dev/null @@ -1,9 +0,0 @@ -BasedOnStyle: Google -AllowShortBlocksOnASingleLine: false -AllowShortCaseLabelsOnASingleLine: false -AllowShortCompoundRequirementOnASingleLine: false -AllowShortEnumsOnASingleLine: false -AllowShortFunctionsOnASingleLine: false -AllowShortIfStatementsOnASingleLine: false -AllowShortLambdasOnASingleLine: false -AllowShortLoopsOnASingleLine: false diff --git a/cses/two-sets/.clangd b/cses/two-sets/.clangd deleted file mode 100644 index 4f8ead9..0000000 --- a/cses/two-sets/.clangd +++ /dev/null @@ -1,8 +0,0 @@ -CompileFlags: - Add: - - -Wall - - -Wextra - - -Wpedantic - - -Wshadow - - -DLOCAL - - -Wno-unknown-pragmas \ No newline at end of file diff --git a/cses/two-sets/compile_flags.txt b/cses/two-sets/compile_flags.txt deleted file mode 100644 index 573a6b6..0000000 --- a/cses/two-sets/compile_flags.txt +++ /dev/null @@ -1,6 +0,0 @@ --Wall --Wextra --Wpedantic --Wshadow --DLOCAL --std=c++20 diff --git a/cses/two-sets/solution.cc b/cses/two-sets/solution.cc deleted file mode 100644 index 8dee3f8..0000000 --- a/cses/two-sets/solution.cc +++ /dev/null @@ -1,89 +0,0 @@ -#include // {{{ - -// https://codeforces.com/blog/entry/96344 - -#pragma GCC optimize("O2,unroll-loops") -#pragma GCC target("avx2,bmi,bmi2,lzcnt,popcnt") - -using namespace std; - -template -constexpr T MIN = std::numeric_limits::min(); - -template -constexpr T MAX = std::numeric_limits::max(); - -template -[[nodiscard]] static T sc(auto &&x) { - return static_cast(x); -} - -template -[[nodiscard]] static T sz(auto &&x) { - return static_cast(x.size()); -} - -using ll = long long; -using ld = long double; -template -using vec = std::vector; -template -using arr = std::array; - -#define ff first -#define ss second -#define eb emplace_back -#define pb push_back -#define all(x) (x).begin(), (x).end() -#define rall(x) (x).rbegin(), (x).rend() -// }}} - -struct hash_pair { - size_t operator()(const pair &p) const { - return hash()(p.first) ^ (hash()(p.second) << 1); - } -}; - -void solve() { - ll n; - cin >> n; - - ll full = n * (n + 1) / 2; - if (full & 1) { - cout << "NO\n"; - return; - } - ll half = full / 2; - - vec ans1, ans2; - ll total1 = 0; - - for (int i = n; i >= 1; --i) { - if (total1 + i <= half) { - ans1.eb(i); - total1 += i; - } else { - ans2.eb(i); - } - } - - cout << ans1.size() << endl; - for (auto e : ans1) - cout << e << ' '; - cout << endl; - cout << ans2.size() << endl; - for (auto e : ans2) - cout << e << ' '; - cout << endl; - - cout << endl; -} - -int main() { // {{{ - cin.tie(nullptr)->sync_with_stdio(false); - - solve(); - - return 0; -} -// }}} diff --git a/cses/two-sets/solution.in b/cses/two-sets/solution.in deleted file mode 100644 index 7f8f011..0000000 --- a/cses/two-sets/solution.in +++ /dev/null @@ -1 +0,0 @@ -7 diff --git a/cses/two-sets/solution.out b/cses/two-sets/solution.out deleted file mode 100644 index f6b5c3e..0000000 --- a/cses/two-sets/solution.out +++ /dev/null @@ -1,8 +0,0 @@ -3 -7 6 1 -4 -5 4 3 2 - - -[code]: 0 -[time]: 11.0717 ms \ No newline at end of file diff --git a/cses/weird-algorithm/solution.cc b/cses/weird-algorithm.cc similarity index 100% rename from cses/weird-algorithm/solution.cc rename to cses/weird-algorithm.cc diff --git a/cses/weird-algorithm/solution.in b/cses/weird-algorithm.in similarity index 100% rename from cses/weird-algorithm/solution.in rename to cses/weird-algorithm.in diff --git a/cses/weird-algorithm/solution.out b/cses/weird-algorithm.out similarity index 100% rename from cses/weird-algorithm/solution.out rename to cses/weird-algorithm.out diff --git a/cses/weird-algorithm/compile_flags.txt b/cses/weird-algorithm.txt similarity index 100% rename from cses/weird-algorithm/compile_flags.txt rename to cses/weird-algorithm.txt diff --git a/cses/weird-algorithm/.clang-format b/cses/weird-algorithm/.clang-format deleted file mode 100644 index e7350c4..0000000 --- a/cses/weird-algorithm/.clang-format +++ /dev/null @@ -1,9 +0,0 @@ -BasedOnStyle: Google -AllowShortBlocksOnASingleLine: false -AllowShortCaseLabelsOnASingleLine: false -AllowShortCompoundRequirementOnASingleLine: false -AllowShortEnumsOnASingleLine: false -AllowShortFunctionsOnASingleLine: false -AllowShortIfStatementsOnASingleLine: false -AllowShortLambdasOnASingleLine: false -AllowShortLoopsOnASingleLine: false diff --git a/cses/weird-algorithm/.clangd b/cses/weird-algorithm/.clangd deleted file mode 100644 index 81ec699..0000000 --- a/cses/weird-algorithm/.clangd +++ /dev/null @@ -1,9 +0,0 @@ -CompileFlags: - Add: - - -std=c++23 - - -Wall - - -Wextra - - -Wpedantic - - -Wshadow - - -DLOCAL - - -Wno-unknown-pragmas \ No newline at end of file