2019.4.14 第1001题:Sum Problem Problem DescriptionHey, welcome to HDOJ(Hangzhou Dianzi University Online Judge). In this problem, your task is to calculate SUM(n) = 1 + 2 + 3 + ... + n.InputThe input will consist of a series of integers n, one integer…
原文:在 WPF 程序中应用 Windows 10 真?亚克力效果 从 Windows 10 (1803) 开始,Win32 应用也可以有 API 来实现原生的亚克力效果了.不过相比于 UWP 来说,可定制性会差很多. 本文介绍如何在 WPF 程序中应用 Windows 10 真•亚克力效果.(而不是一些流行的项目里面自己绘制的亚克力效果.) 本文内容 API 如何使用 注意事项 API 需要使用的 API 是微软的文档中并未公开的 SetWindowCompositionAttribute.…
WPF提供了一个HwndSource可以使你更快的实现处理Windows消息. 通过HwndSource.FromHwnd得到的HwndSource可以添加(AddHook)移除(Remove)Hook 首先注册SourceInitialized事件,在事件中创建一个HwndSource对象, 然后利用其AddHook方法来将所有的windows消息附加到一个现有的事件中,这个就是WpfHandleWinowMsg. 代码如下: public partial class MainWindow :…
传送门 题意简述:给出一棵树,求每个子树的重心. 首先通过画图可以观察出一个性质,我们从叶子结点向根节点递推重心的话重心的位置是不会下降的. 然后由于一个点的重心要么是自己,要么在重儿子子树内,因此如果重心不是自己,我们从重儿子子树的重心向自己爬统计答案就行了,由于重心不会下降因此时间复杂度O(n)O(n)O(n) 代码: #include<bits/stdc++.h> #define ri register int using namespace std; inline int read()…
代码: #include <cstdio> #include <iostream> #include <cstring> #include <algorithm> #include <cmath> #include <cctype> using namespace std; #define LL long long #define res register int +,mod=1e9+; int f[N],n,k; int main(…
代码: #include <cstdio> #include <iostream> #include <cstring> #include <algorithm> #include <cmath> #include <cctype> #include <vector> using namespace std; #define LL long long #define res register long long inlin…