diff --git a/.gitignore b/.gitignore index c33802f..77bbc60 100644 --- a/.gitignore +++ b/.gitignore @@ -37,4 +37,6 @@ __pycache__ target state.yml -config.yml \ No newline at end of file +config.yml + +.python-version \ No newline at end of file diff --git a/storage/aloha/cpp/2025hcpc-div1-A.cpp b/storage/aloha/cpp/2025hcpc-div1-A.cpp new file mode 100644 index 0000000..53e97b9 --- /dev/null +++ b/storage/aloha/cpp/2025hcpc-div1-A.cpp @@ -0,0 +1,25 @@ +#include + +#include +#include +#include + +using namespace std; + +int main() { + size_t n; + + cin >> n; + + vector tastes; + uint64_t temp; + for (size_t i = 0; i < n; i++) { + cin >> temp; + tastes.push_back(temp); + } + + // pop_front + // pop_back + // push_back + // push_front +} \ No newline at end of file diff --git a/storage/aloha/cpp/2025hcpc-div1-B.cpp b/storage/aloha/cpp/2025hcpc-div1-B.cpp new file mode 100644 index 0000000..b7f6653 --- /dev/null +++ b/storage/aloha/cpp/2025hcpc-div1-B.cpp @@ -0,0 +1,3 @@ +#include + +using namespace std; \ No newline at end of file diff --git a/storage/aloha/cpp/2025hcpc-div1-C.cpp b/storage/aloha/cpp/2025hcpc-div1-C.cpp new file mode 100644 index 0000000..0dadb13 --- /dev/null +++ b/storage/aloha/cpp/2025hcpc-div1-C.cpp @@ -0,0 +1,39 @@ +#define MAX_N 200'000 +#include + +using namespace std; +using ll = long long; + +ll ans; +int N, M; +ll sum[MAX_N+1][26]; +string S, T; + +void init(); +void solve(); + +int main() { + ios_base::sync_with_stdio(0); + cin.tie(0); cout.tie(0); + + init(); + solve(); + cout << ans << "\n"; +} + +void init() { + cin >> N >> M; + cin >> S >> T; +} +void solve() { + for (int i = 0; i < S.size(); i++) { + char c = S[i]; + for (int j = 0; j < 26; j++) sum[i+1][j] = sum[i][j]; + sum[i+1][c-'a']++; + } + + for (int i = 0; i < T.size(); i++) { + char c = T[i]; + ans += sum[S.size()-T.size()+i + 1][c-'a'] - sum[i][c-'a']; + } +} \ No newline at end of file diff --git a/storage/aloha/cpp/2025hcpc-div1-D.cpp b/storage/aloha/cpp/2025hcpc-div1-D.cpp new file mode 100644 index 0000000..1d1cfb1 --- /dev/null +++ b/storage/aloha/cpp/2025hcpc-div1-D.cpp @@ -0,0 +1,52 @@ +#include + +using namespace std; +using ll = long long; + +ll N; +ll ans; + +void init(); +void solve(); + +int main() { + ios_base::sync_with_stdio(0); + cin.tie(0); cout.tie(0); + + init(); + solve(); + cout << ans << "\n"; +} + +void init() { + cin >> N; +} +void solve() { + ll temp = 0; + + if (N % 6 == 0) { + temp += N*(N-1)*(N-2) / 6; + temp -= N/3; + temp -= ((N-4)/2) * N; + temp /= N; + temp += (N-2)/2; + } else if (N % 3 == 0) { + temp += N*(N-1)*(N-2) / 6; + temp -= N/3; + temp -= ((N-3)/2) * N; + temp /= N; + temp += (N-1)/2; + } else if (N % 2 == 0){ + temp += N*(N-1)*(N-2) / 6; + temp -= ((N-2)/2)*N; + temp /= N; + temp += (N-2)/2; + } else { + temp += N*(N-1)*(N-2) / 6; + temp -= ((N-1)/2) * N; + temp /= N; + temp += (N-1)/2; + } + + ans = temp; +} \ No newline at end of file diff --git a/storage/aloha/cpp/2025hcpc-div1-F.cpp b/storage/aloha/cpp/2025hcpc-div1-F.cpp new file mode 100644 index 0000000..a05cceb --- /dev/null +++ b/storage/aloha/cpp/2025hcpc-div1-F.cpp @@ -0,0 +1,11 @@ +#include +#include +#include + +int main() { + uint64_t n; + + scanf("%d", &n); + double p = (n - 1) * (n) / (double) 4; + printf("%f\n", p); +} \ No newline at end of file diff --git a/storage/aloha/cpp/2025hcpc-div1-G.cpp b/storage/aloha/cpp/2025hcpc-div1-G.cpp new file mode 100644 index 0000000..dad7b22 --- /dev/null +++ b/storage/aloha/cpp/2025hcpc-div1-G.cpp @@ -0,0 +1,43 @@ +#include +#include +#include +#include +#include + +using namespace std; + +typedef struct Node { + int value; + struct Node *left; + struct Node *right; + bool status; +} Node; + +int main() { + cin.tie(NULL); + ios_base::sync_with_stdio(0); + + auto data = new vector; + auto pq = new vector; + + uint64_t n; + int temp; + cin >> n; + cin >> temp; + pq->push_back(temp); + cout << 1 << "\n"; + + Node * node = NULL; + for (size_t i = 1; i < n; i ++) { + cin >> temp; + pq->push_back(temp); + } + + + if (node == NULL) { + cout << 1 << "\n"; + } + + delete pq; + delete data; +} \ No newline at end of file diff --git a/storage/aloha/cpp/2025hcpc-div1-H.cpp b/storage/aloha/cpp/2025hcpc-div1-H.cpp new file mode 100644 index 0000000..0092403 --- /dev/null +++ b/storage/aloha/cpp/2025hcpc-div1-H.cpp @@ -0,0 +1,59 @@ +#include + +using namespace std; + +int N; + +void init(); +void solve(); +void func(int m); + +int main() { + ios_base::sync_with_stdio(0); + cin.tie(0); cout.tie(0); + + init(); + solve(); +} + +void init() { + cin >> N; +} +void solve() { + cout << "Yes" << "\n"; + + if (N % 2 == 0) { + func(N / 2); + + } else if (N % 2 == 1) { + func(N / 2); + cout << 0; + + } +} +void func(int m) { + int k = m / 2; + + if (m % 2 == 0) { + if (k % 2 == 0) { + for (int i = 1; i <= m; i++) { + if (i % 2) cout << i << " " << -i << " "; + else cout << -i << " " << i << " "; + } + } else if (k % 2 == 1) { + + } + + } else if (m % 2 == 1) { + if (k % 2 == 0) { + cout << -2 << " " << 1 << " "; + for (int i = 3; i <= m+1; i++) { + if (i % 2) cout << i << " " << -i << " "; + else cout << -i << " " << i << " "; + } + } else if (k % 2 == 1) { + + + } + } +} \ No newline at end of file