Logo huzhenyuan的博客

博客

新博客

2026-07-03 15:59:00 By huzhenyuan

神秘

#include <cstdio>
#include <vector>
#include <algorithm>
#include <queue>

using std::printf;
using std::scanf;
using std::vector;
using std::pair;

int main()
{
    int t, n;
    long long ans;
    vector<pair<pair<int, int>, int>> a;
    vector<std::priority_queue<int, vector<int>, std::greater<int>>> pq;
    scanf("%d", &t);
    while (t-- > 0)
    {
        ans = 0;
        scanf("%d", &n);
        //a.clear();
        //pq.clear();
        a.resize(n);
        pq.resize(3, std::priority_queue<int, vector<int>, std::greater<int>>());
        for (int i = 0; i < n; i++)
        {
            int a1, a2, a3;
            scanf("%d %d %d", &a1, &a2, &a3);
            if (a1 > a2)
                if (a1 > a3)
                {
                    a[i].first.first = 0;
                    a[i].first.second = a1;
                    a[i].second = a2 > a3 ? a2 : a3;
                }
                else
                {
                    a[i].first.first = 2;
                    a[i].first.second = a3;
                    a[i].second = a1;
                }
            else
                if (a2 > a3)
                {
                    a[i].first.first = 1;
                    a[i].first.second = a2;
                    a[i].second = a1 > a3 ? a1 : a3;
                }
                else
                {
                    a[i].first.first = 2;
                    a[i].first.second = a3;
                    a[i].second = a2;
                }
            ans += a[i].first.second;
            pq[a[i].first.first].push(a[i].first.second - a[i].second);
        }
        for (int i = 0; i < 3; i++)
            for (int j = n >> 1; j < pq[i].size(); j++)
            {
                ans -= pq[i].top();
                pq[i].pop();
            }
        printf("%lld\n", ans);
    }
    return 0;
}

Tree.hpp V2.2

2026-01-25 18:30:44 By huzhenyuan

Tree.hpp V2.2

Q: 为什么更这么慢啊?

A: 不到啊

不管了,反正能用

(其实std::Tree用不了)

把Tree_node修了一下,自己试试

阅读更多……

Thanks to GCC

2026-01-10 10:43:37 By huzhenyuan

What's this?

(root_dir = file_dir)

g++.exe -c (file_name) -std=c++11 -I".\MinGW64\include" -I".\MinGW64\x86_64-w64-mingw32\include" -I".\MinGW64\lib\gcc\x86_64-w64-mingw32\4.8.1\include" -L".\MinGW64\lib" -L".\MinGW64\x86_64-w64-mingw32\lib"

链接这一块

Tree.hpp V2.1

2025-11-22 12:59:55 By huzhenyuan

Tree.hpp--V2.0!!!

2025-10-16 00:06:34 By huzhenyuan

Tree.hpp V2.0!!!

连夜|加工……

不解释,自己看吧……

(告诉你们把,就是可以使用自定义数据类型来保存子节点了)

阅读更多……

*蓝桥

2025-08-10 16:06:48 By huzhenyuan

蓝桥杯

今天不是打蓝桥杯吗,我打完后才发现比赛须知里说在比赛前会跳出一个“分享”的窗口,但是我没跳!!

还有最后忘点“提交该子卷”了,不会算没提交0分吧……(350分,我总分好像是277,因为最后的出栈方法数没写AC,只有27分……)

(其实我并没有把比赛须知读完,后悔了q_q)

编程6道题,但只记得后3:

阅读更多……

wtf?!

2025-08-04 21:35:50 By huzhenyuan

Look this:

javax.script.ScriptException: eval :13:22 Expected ) but found "if (SOC.call(this);"

这是我的世界block干出来的事?!

怎么能少打一个括号???

又来(??).hpp?!

2025-07-25 22:01:36 By huzhenyuan

没错,新的.hpp又来了……

(不是哥们,又干啥了?)

点我看Tree~~.hpp: 关于我自己写的Tree.hpp

String_number.hpp

顾名思义,把number(就是int, long long一类的)string保存。

why要写这个看起来就(没)(啥)(用)的.hpp呢?

什么???你不知道???

高精度啊!!bro!!~

You:那高精度又有……

拱出去,谢谢awa~

下面是代码时间~:

阅读更多……

552插排过了?!

2025-07-05 19:59:23 By huzhenyuan

真的

不信自己试试

关于我自己写的Tree.hpp

2025-07-04 20:29:37 By huzhenyuan

实现了tree数据结构

但半成品(悲

(空行)

(空行)

'\n'

V1.0

只实现了一点吧,然后tree<(自己看)>::find()没完全写好,也测试

(谁要是帮我测试了并告诉我,我会很开心的qwq)

对了,那个memory(头文件)中的allocator总感觉不对呢……?

悄悄地告诉你:析构函数绝对有问题,好像内存泄漏了(但找不到问题啊啊啊!!)

好了,下面是源代码:

//(代码丢失了555……)

.

.

.

.

.

其实注释不太好

V1.2(V1.1势了)

阅读更多……

共 11 篇博客