add aloha/2025hcpc
This commit is contained in:
2
.gitignore
vendored
2
.gitignore
vendored
@@ -38,3 +38,5 @@ target
|
||||
|
||||
state.yml
|
||||
config.yml
|
||||
|
||||
.python-version
|
||||
25
storage/aloha/cpp/2025hcpc-div1-A.cpp
Normal file
25
storage/aloha/cpp/2025hcpc-div1-A.cpp
Normal file
@@ -0,0 +1,25 @@
|
||||
#include <iostream>
|
||||
|
||||
#include <stddef.h>
|
||||
#include <stdint.h>
|
||||
#include <vector>
|
||||
|
||||
using namespace std;
|
||||
|
||||
int main() {
|
||||
size_t n;
|
||||
|
||||
cin >> n;
|
||||
|
||||
vector<uint64_t> 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
|
||||
}
|
||||
3
storage/aloha/cpp/2025hcpc-div1-B.cpp
Normal file
3
storage/aloha/cpp/2025hcpc-div1-B.cpp
Normal file
@@ -0,0 +1,3 @@
|
||||
#include <iostream>
|
||||
|
||||
using namespace std;
|
||||
39
storage/aloha/cpp/2025hcpc-div1-C.cpp
Normal file
39
storage/aloha/cpp/2025hcpc-div1-C.cpp
Normal file
@@ -0,0 +1,39 @@
|
||||
#define MAX_N 200'000
|
||||
#include <iostream>
|
||||
|
||||
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'];
|
||||
}
|
||||
}
|
||||
52
storage/aloha/cpp/2025hcpc-div1-D.cpp
Normal file
52
storage/aloha/cpp/2025hcpc-div1-D.cpp
Normal file
@@ -0,0 +1,52 @@
|
||||
#include <iostream>
|
||||
|
||||
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;
|
||||
}
|
||||
11
storage/aloha/cpp/2025hcpc-div1-F.cpp
Normal file
11
storage/aloha/cpp/2025hcpc-div1-F.cpp
Normal file
@@ -0,0 +1,11 @@
|
||||
#include <malloc.h>
|
||||
#include <stdint.h>
|
||||
#include <stdio.h>
|
||||
|
||||
int main() {
|
||||
uint64_t n;
|
||||
|
||||
scanf("%d", &n);
|
||||
double p = (n - 1) * (n) / (double) 4;
|
||||
printf("%f\n", p);
|
||||
}
|
||||
43
storage/aloha/cpp/2025hcpc-div1-G.cpp
Normal file
43
storage/aloha/cpp/2025hcpc-div1-G.cpp
Normal file
@@ -0,0 +1,43 @@
|
||||
#include <algorithm>
|
||||
#include <iostream>
|
||||
#include <queue>
|
||||
#include <stdint.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
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<int>;
|
||||
auto pq = new vector<int>;
|
||||
|
||||
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;
|
||||
}
|
||||
59
storage/aloha/cpp/2025hcpc-div1-H.cpp
Normal file
59
storage/aloha/cpp/2025hcpc-div1-H.cpp
Normal file
@@ -0,0 +1,59 @@
|
||||
#include <iostream>
|
||||
|
||||
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) {
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user