随笔分类 -  Competitive Programming / 小技巧

摘要:二维坐标下的运算在二维图中,常常遇到一些需要大量坐标运算的题目,这时可以封装一个Point类,实现坐标高效运算。 // #define LOCAL #include<iostream> #include<queue> #include<map> using namespace std; #define _for(i 阅读全文
posted @ 2025-09-25 20:49 雾岛春颂 阅读(12) 评论(0) 推荐(0)
摘要:编程技巧#include<iostream> #include<vector> #include<set> #include<cstdint> using namespace std; // 封装泛型函数使用c++的IO流对集合进行输出 template<class T> ostream& operator 阅读全文
posted @ 2025-08-22 11:13 雾岛春颂 阅读(14) 评论(0) 推荐(0)
摘要:常用输入输出小技巧1: scanf(), sscanf(), fscanf() 三姐妹 这是c语言的"输入三姐妹",她们定义在<stdio.h>中,分别掌管从标准输入读,从字符串读,和从文件读的功能。具体点说,她们是从一个数据源,根据一个格式字符串,读取数据并存入指定的变量中,返回类型是读入的变量的数量。 #incl 阅读全文
posted @ 2025-08-07 23:06 雾岛春颂 阅读(20) 评论(0) 推荐(0)