Precreation contest files

This commit is contained in:
2026-02-11 11:28:23 +07:00
parent 0a8ea477bb
commit cb9f7cab30
134 changed files with 1848 additions and 0 deletions

22
misc/hsg-hn-2025/.vscode/launch.json vendored Normal file
View File

@@ -0,0 +1,22 @@
{
"version": "0.2.0",
"configurations": [
{
"name": "Debug C++ (input.inp)",
"type": "cppdbg",
"request": "launch",
"program": "${workspaceFolder}/${fileBasenameNoExtension}",
"args": ["<", "${fileBasenameNoExtension}.inp"],
"cwd": "${workspaceFolder}",
"preLaunchTask": "Build C++",
"MIMode": "gdb",
"externalConsole": false,
"setupCommands": [
{
"description": "Enable pretty printing",
"text": "-enable-pretty-printing"
}
]
}
]
}

22
misc/hsg-hn-2025/.vscode/tasks.json vendored Normal file
View File

@@ -0,0 +1,22 @@
{
"version": "2.0.0",
"tasks": [
{
"label": "Build C++",
"type": "shell",
"command": "g++",
"args": [
"-std=gnu++17",
"-O2",
"-g",
"${file}",
"-o",
"${fileBasenameNoExtension}"
],
"group": {
"kind": "build",
"isDefault": true
}
}
]
}

BIN
misc/hsg-hn-2025/a.out Executable file

Binary file not shown.

BIN
misc/hsg-hn-2025/denlong Executable file

Binary file not shown.

View File

@@ -0,0 +1,17 @@
#include <bits/stdc++.h>
using namespace std;
int main() {
int n, k, x;
cin >> n >> k >> x;
vector<vector<int>> hash(9, vector<int>(n, 0));
for (int i = 0; i < n; i++) {
int a;
cin >> a;
if (i == 0)
hash[a][i] = 1;
else
hash[a][i] = hash[a][i - 1] + 1;
}
}

View File

@@ -0,0 +1,2 @@
6 2 2
1 9 3 2 3 5

View File

View File

@@ -0,0 +1,35 @@
#include <bits/stdc++.h>
using namespace std;
const int MAX_N = 1e6;
int a[MAX_N];
int main() {
freopen("muasam.inp", "r", stdin);
freopen("muasam.out", "w", stdout);
ios::sync_with_stdio(false);
cin.tie(nullptr);
int n, l, r;
cin >> n >> l >> r;
for (int i = 0; i < n; i++)
cin >> a[i];
int res = 1e9;
sort(a, a + n);
int L = 0, R = n - 1;
while (L < R) {
int sum = a[L] + a[R];
if (sum > r)
R--;
else if (sum < l)
L++;
else {
res = min(res, sum);
R--;
}
}
cout << res << '\n';
}