摘要: Step1: Choose your font and download it as *.ttfStep2: Use 'Fontmin'(http://ecomfe.github.io/) to compress your fontStep3: Use (https://transfonter.or 阅读全文
posted @ 2022-06-02 21:54 Duyy 阅读(323) 评论(0) 推荐(0) 编辑
摘要: Ctype为我们提供了一种在python中调用c的方法: Step1:编写C代码:(testoutput.c) #include <stdlib.h> #include <stdio.h> #include <malloc.h> void print(); void print() {printf( 阅读全文
posted @ 2022-05-09 21:43 Duyy 阅读(245) 评论(0) 推荐(0) 编辑
摘要: 问题: 在vscode(装python扩展)下,import torch出现报错 解决方案:在环境变量中添加下列项 其中第一项是conda中env的路径(这里就是pytorch,和vscode的python扩展的配置路径相同),而且只添加第一项是不够的,要三项都添加才不会报错。 参考: http:/ 阅读全文
posted @ 2022-05-08 23:29 Duyy 阅读(192) 评论(0) 推荐(0) 编辑
摘要: class Father { public: Father(int x) {do sth.} ... }; 对于这样的父类,下面一种子类的构造函数时错误的: class Son : public Father { public: Son() {do sth...} ... }; 会提示你没给Fath 阅读全文
posted @ 2022-02-26 17:23 Duyy 阅读(80) 评论(0) 推荐(0) 编辑
摘要: #pragma once 是写在头文件开头的编译指令,使得编译器能够自动帮我们实现“只编译一次该头文件”,从而避免了多次include该头文件导致的重复定义/声明问题。 在没有#pragma once 之前,我们常用的方法是为这个头文件制定一个独一无二的宏名(比如说叫__Car__),然后使用#if 阅读全文
posted @ 2022-02-26 17:16 Duyy 阅读(998) 评论(0) 推荐(0) 编辑
摘要: 在launch.json中: "externalConsole": true, 将这一项的false改为true即可 p.s. 如何打开launch.json: 阅读全文
posted @ 2021-07-20 13:50 Duyy 阅读(453) 评论(0) 推荐(0) 编辑
摘要: ld: warning: ignoring file c, building for macOS-x86_64 but attempting to link with file built for unknown-unsupported file format ( 0x23 0x69 0x6E 0x 阅读全文
posted @ 2021-07-20 13:42 Duyy 阅读(1110) 评论(0) 推荐(0) 编辑
摘要: 就是比二叉查找树多了几个点 1.左旋右旋的时候记得更新子树节点个数,外面如果不旋转要直接++cnt 2.之前遇到相等的值向右插的方法能够保证查找“值为x”的最小节点下标时,搜到的第一个点下标最小。然而,在←→旋之后这一性质可能被破坏(比如{data=3,r=1},{data=1,r=4},{data 阅读全文
posted @ 2019-05-16 23:37 Duyy 阅读(127) 评论(0) 推荐(0) 编辑
摘要: 证明什么的已经有很多了,就是蒟蒻打个板子看看有什么容易写错的。。。 当然,用bound记反向边显得有点蠢,所以我们为什们不用一些简单的方式呢?比如说,既然一组反向边的下标是相邻的,那么从2开始编号然后xor1即可 这样定义的话就要 ne=1 了,(加边函数就能省好多行啊),以及95行 ^1 是不是比 阅读全文
posted @ 2019-05-02 23:08 Duyy 阅读(113) 评论(0) 推荐(0) 编辑
摘要: 原题:https://codeforces.com/contest/1119/problem/D 题意大概是一个n行1e18列的矩阵,其中每行第一个数为s[i],剩下的数每行依次以1的速度递增。就是说,矩阵元素 a[i][j] = s[i] + j 。有q个询问,每个询问有两个参数l,r,求矩阵第l 阅读全文
posted @ 2019-04-07 14:09 Duyy 阅读(261) 评论(0) 推荐(0) 编辑