全班码风鉴赏
summer0703
·
·
个人记录
::::info[dyc]
整体码风较为紧凑,连续尖括号中间加空格(如 vector<pair<int,int> >),大括号不换行,用关流cin/cout,用"\n"不用'\n',vector用push_back
邪恶dyc居然改码风,now:
函数在主函数前面声明而在主函数后面定义,不关流cin/cout,换行用"\n",码风还是比较紧
::::
::::info[dzl]
define pre和fpre和ll
喜欢加空格,大括号换行,其余轻微压行。dijkstra用greater,偶尔但还是会用lambda,使用scanf/printf,vector用emplace_back
::::info[ggy]
::::
::::info[gwq]
多组数据/单组数据均使用 `oT_To` 和 `work` 函数,码风较为舒展,关流`cin/cout`。
```cpp
#define Hahaha using
#define I namespace
#define AK std
#define IOI ;
#define ll long long
#define N (int)(1e3 + 10)
```
::::
::::info[hhy]
标志性的抽象逗号/分号:
```cpp
int n , m , k , r , q ;
struct node
{
int v , w ;
};
```
dij用重载运算符,使用 `oT_To` 和 `solve`,关流cin/cout, 定义`kMaxN`
::::
::::info[hr]
轻微压行,大括号不换行,单对语句不删大括号,关流cin/cout,没时间时使用rand还不用随机种子(说人话:输出41)
::::
::::info[hzx]
`// code by BlueCode`
`#define int long long+signed main()`
是个人物。
使用 `T` 和 `solve`,**不关流**cin/cout
不太压行
::::
::::info[llk]
```cpp
using a2 = array<int, 2>;
using la2 = array<long long, 2>;
```
使用scanf/printf,不定义maxn,vector加边用push_back
::::
::::info[oymz]
```cpp
typedef long long ll;
#define file(x) freopen(#x".in","r",stdin),freopen(#x".out","w",stdout)
```
标志性define,关流cin/cout,vector加边用push_back,整体码风较紧,大括号能不加就不加
::::
::::info[plc]
```cpp
#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
::::
::::info[rmx]
```cpp
#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
```
```cpp
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)
::::
::::info[sjy]
```cpp
#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
::::
::::info[xrc]
```cpp
#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--;)`
::::
::::info[yzm]
`#define int long long`
狠人二号。
关流cin/cout,使用`ceil`,vector加边用push_back,dijkstra处理小根堆用取负数。
::::
::::info[yxc]
```cpp
using ll = long long;
#define f first
#define s second
const int inf = (1 << 30) - 1;
const ll INF = 1ll << 62;
```
```cpp
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`
::::