跳到正文

个人记录

全班码风鉴赏

summer0703约 6 分钟
原文
文章信息与版本

文章信息

发布
2026年9月27日
收录
2026年9月28日
更新
2026年11月21日
篇幅
约 6 分钟

版本

  1. v6当前
  2. v5
  3. v4
  4. v3
更早的 2 个版本
  1. v2
  2. v1
dyc

整体码风较为紧凑,连续尖括号中间加空格(如 vector<pair<int,int> >),大括号不换行,用关流cin/cout,用”\n”不用’\n’,vector用push_back

邪恶dyc居然改码风,now: 函数在主函数前面声明而在主函数后面定义,不关流cin/cout,换行用”\n”,码风还是比较紧

dzl

define pre和fpre和ll

喜欢加空格,大括号换行,其余轻微压行。dijkstra用greater,偶尔但还是会用lambda,使用scanf/printf,vector用emplace_back

码风不同函数之间单独换行,喜欢逗号表达式

ggy

22 格缩进,定义STL时类名/尖括号 和 尖括号/尖括号 时会加空格。dijkstra用greater,不关流cin/cout

gwq

多组数据/单组数据均使用 oT_To 和 work 函数,码风较为舒展,关流cin/cout。

C++
#define Hahaha using
#define I namespace
#define AK std
#define IOI ;
#define ll long long
#define N (int)(1e3 + 10)
hhy

标志性的抽象逗号/分号:

C++
int n , m , k , r , q ;
struct node
{
  int v , w ;
};

dij用重载运算符,使用 oT_To 和 solve,关流cin/cout, 定义kMaxN

hr

轻微压行,大括号不换行,单对语句不删大括号,关流cin/cout,没时间时使用rand还不用随机种子(说人话:输出41)

hzx

// code by BlueCode #define int long long+signed main()

是个人物。

使用 T 和 solve,不关流cin/cout

不太压行

llk
C++
using a2 = array<int, 2>;
using la2 = array<long long, 2>;

使用scanf/printf,不定义maxn,vector加边用push_back

oymz
C++
typedef long long ll;
#define file(x) freopen(#x".in","r",stdin),freopen(#x".out","w",stdout)

标志性define,关流cin/cout,vector加边用push_back,整体码风较紧,大括号能不加就不加

plc
C++
#define ll long long
#define ld long double
#define ull unsigned long long
#define sqr(x) ((x) * (x))

关流cin/cout,使用 oT_To 和 solve,vector加边用emplace_back,STL使用较多,dijkstra写作dijk

rmx
C++
#define LL long long
#define UInt unsigned int
#define ULL unsigned long long
#define LD long double
#define pii pair<int,int>
#define pLL pair<LL,LL>
#define pDD pair<LD,LD>
#define fr first
#define se second
#define pb push_back
#define isr insert
#define _i128 __int128
C++
LL read(){
    LL su=0,pp=1;char ch=getchar();
    while(ch<'0'||ch>'9'){if(ch=='-')pp=-1;ch=getchar();}
    while(ch>='0'&&ch<='9'){su=su*10+ch-'0';ch=getchar();}
    return su*pp;
}

代码中大写字母较多,不加空格,LL和su*pp有标志性,使用快读,vector加边用定义pb(push_back)

sjy
C++
#define ll long long
#define ull unsigned long long
using namespace std;
const ll N = 3e5 + 5;
const ll M = 1e5 + 5;
const ll INF = 1e18;
const ll MOD = 1e9 + 7;

关流cin/cout,使用 oT_To 和 work,vector加边用push_back

xrc
C++
#define ll long long
#define ull unsigned long long
#define db double
#define all(x) (x).begin(), (x).end()
#define inf (1 << 30)
#define lnf (1LL << 60)
typedef pair<int, int> PII;
constexpr int N = 200000 + 7;
constexpr int P = 998244353;

使用scanf/printf,vector加边用push_back,dijkstra写作Dijkstra,多组数据使用for(;q--;)

yzm

#define int long long

狠人二号。

关流cin/cout,使用ceil,vector加边用push_back,dijkstra处理小根堆用取负数。

yxc
C++
using ll = long long;
#define f first
#define s second
const int inf = (1 << 30) - 1;
const ll INF = 1ll << 62;
C++
    std::fill(dis+ 1, dis + n + 1, INF);
    std::fill(dis1+ 1, dis1 + n + 1, 0);
    std::fill(dis2+ 1, dis2 + n + 1, 0);

不写std,dijkstra处理小根堆用greater,关流cin/cout,vector加边用push_back,码风偏紧,使用\n

原文