# acmer-qualification-code
### Programming Contest Archive
Some coding contest solutions are achieved and grouping by hosted platform like [*Codeforces*](https://codeforces.com/).
| :warning: Caution |
|:---------------------------|
| Unaccepted answers are included, be carefull :exclamation::exclamation::exclamation:|
```shell
# find solutions in Rust
find . -name "*.rs"
# find solutions in C
find . -name "*.c"
```
### Handy templates in Rust
```rust
#[allow(unused_imports)]
use std::cmp::max;
#[allow(unused_imports)]
use std::cmp::min;
#[allow(unused_imports)]
use std::collections::HashMap;
#[allow(unused_imports)]
use std::collections::HashSet;
use std::io;
// input macros
#[allow(unused_macros)]
// rustc +nightly -Zunpretty=expanded your.rs
macro_rules! read {
// eg.
// let s = read!();
() => {{
let mut line: String = String::new();
io::stdin().read_line(&mut line).unwrap();
line.trim().to_string()
}};
// eg.
// let v = read!(Vec<i32>)
// let v = read!(Vec<char>)
(Vec<$t:ty>) => ({
let mut line: String = String::new();
io::stdin().read_line(&mut line).unwrap();
line.split_whitespace()
.map(|x| x.parse::<$t>().unwrap())
.collect()
});
// eg.
// let v = read!(i32);
// let v = read!(i64);
// let (i, j, k) = read!(i32, i32, i32);
($($t:ty),*) => {{
let mut line = String::new();
io::stdin().read_line(&mut line).unwrap();
let mut iter = line.split_whitespace();
($(iter.next().unwrap().parse::<$t>().unwrap()),*)
}};
}
fn solve() {
}
fn main() {
let mut t = read!(i32);
while t > 0 {
t -= 1;
solve();
print!("\n");
}
}
```
### Handy templates in C
#### 1. printf
###### 1.1 符号说明
```pla
%a(%A) 浮点数、十六进制数字和p-(P-)记数法(C99)
%c 字符
%d 有符号十进制整数
%f 浮点数(包括float和double)
%e(%E) 浮点数指数输出[e-(E-)记数法]
%g(%G) 浮点数不显无意义的零"0"
%i 有符号十进制整数(与%d相同)
%u 无符号十进制整数
%o 八进制整数 e.g. 0123
%x(%X) 十六进制整数0f(0F) e.g. 0x1234
%p 指针
%s 字符串
%% "%"
```
###### 1.2 对齐
```
左对齐:"-" e.g. "%-20s"
右对齐:"+" e.g. "%+20s"
空格:若符号为正,则显示空格,负则显示"-" e.g. "% 6.2f"
#:对c,s,d,u类无影响;对o类,在输出时加前缀o;对x类,在输出时加前缀0x;对e,g,f 类当结果有小数时才给出小数点
```
###### 1.3 格式化输出
```
[标志][输出最少宽度][.精度][长度]类型
"%-md" :左对齐,若m比实际少时,按实际输出。
"%m.ns":输出m位,取字符串(左起)n位,左补空格,当n>m or m省略时m=n.
e.g. "%7.2s" 输入CHINA
输出" CH"
"%m.nf":输出浮点数,m为宽度,n为小数点右边数位
e.g. "%3.1f" 输入3852.99
输出3853.0
```
#### 2. 符号的英文读法
```
+ plus 加号;正号
- minus 减号;负号
± plus or minus 正负号
× is multiplied by 乘号
÷ is divided by 除号
= is equal to 等于号
≠ is not equal to 不等于号
≡ is equivalent to 全等于号
≌ is equal to or approximately equal to 等于或约等于号
≈ is approximately equal to 约等于号
< is less than 小于号
> is greater than 大于号
≮ is not less than 不小于号
≯ is not more than 不大于号
≤ is less than or equal to 小于或等于号
≥ is more than or equal to 大于或等于号
% per cent 百分之…
‰ per mill 千分之…
∞ infinity 无限大号
∝ varies as 与…成比例
√ (square) root 平方根
∵ since; because 因为
∴ hence 所以
∷ equals, as (proportion) 等于,成比例
∠ angle 角
⌒ semicircle 半圆
⊙ circle 圆
○ circumference 圆周
π pi 圆周率
△ triangle 三角形
⊥ perpendicular to 垂直于
∪ union of 并,合集
∩ intersection of 交,通集
∫ the integral of …的积分
∑ (sigma) summation of 总和
° degree 度
′ minute 分
″ second 秒
℃ Celsius system 摄氏度
{ open brace, open curly 左花括号
} close brace, close curly 右花括号
( open parenthesis, open paren 左圆括号
) close parenthesis, close paren 右圆括号
() brakets/ parentheses 括号
[ open bracket 左方括号
] close bracket 右方括号
[] square brackets 方括号
. period, dot 句号,点
| vertical bar, vertical virgule 竖线
& ampersand, and, reference, ref 和,引用
* asterisk, multiply, star, pointer 星号,乘号,星,指针
/ slash, divide, oblique 斜线,斜杠,除号
// slash-slash, comment 双斜线,注释符
# pound 井 号
\ backslash, sometimes escape 反斜线转义符,有时表示转义符或续行符
~ tilde 波浪符
. full stop 句号
, comma 逗号
: colon 冒号
; semicolon 分号
? question mark 问号
! exclamation mark (英式英语) exclamation point (美式英语)
‘ apostrophe 撇号
- hyphen 连字号
– dash 破折号
… dots/ ellipsis 省略号
" single quotation marks 单引号
"" double quotation marks 双引号
‖ parallel 双线号
& ampersand = and
~ swung dash 代字号
§ section; division 分节号
→ arrow 箭号;参见号
```
#### 3. C/C++头文件
```c++
///C
#include <assert.h> //断言
#include <ctype.h> //字符处理
#include <errno.h> //定义错误码
#include <float.h> //浮点数处理
#include <limits.h> //定义各种数据类型最值常量
#include <locale.h> //定义本地化函数
#include <math.h> //定义数学函数
#include <setjmp.h> //非局部跳转
#include <signal.h> //信号处理
#include <stdarg.h> //变长变元表
#include <stddef.h>
#include <stdio.h> //定义输入/输出函数
#include <stdlib.h> //定义杂项函数及内存分配函数
#include <string.h> //字符串处理
#include <time.h> //定义关于时间的函数
///////////////////////////////////////////////////////////////////////////////
///标准 C++
///C语言部分略
#include <algorithm> //STL 通用算法
#include <bitset> //STL 位集容器
#include <complex> //复数类
#include <deque> //STL 双端队列容器
#include <exception> //异常处理类
#include <fstream> //文件输入/输出
#include <functional> //STL 定义运算函数(代替运算符)
#include <limits>
#include <list> //STL 线性列表容器
#include <map> //STL 映射容器
#include <iomanip>
#include <ios> //基本输入/输出支持
#include <iosfwd> //输入/输出系统使用的前置声明
#include <iostream>
#include <istream> //基本输入流
#include <ostream> //基本输出流
#include <queue> //STL 队列容器
#include <set> //STL 集合容器
#include <sstream> //基于字符串的流
#include <stack> //STL 堆栈容器
#include <stdexcept> //标准异常类
#include <streambuf> //底层输入/输出支持
#include <string> //字符串类
#include <utility> //STL 通用模板类
#include <vector> //STL 动态数组容器
#include <cwchar>
#include <cwctype>
using namespace std;
//////////////////////////////////////
没有合适的资源?快使用搜索试试~ 我知道了~
ACMer 入门级算法模板.zip
共48个文件
rs:19个
c:12个
b-test:4个
需积分: 5 0 下载量 188 浏览量
2024-02-04
10:59:23
上传
评论
收藏 261KB ZIP 举报
温馨提示
ACMer 入门级算法模板
资源推荐
资源详情
资源评论
收起资源包目录
ACMer 入门级算法模板.zip (48个子文件)
ahao2
.vscode
settings.json 594B
.github
FUNDING.yml 721B
LICENSE 1KB
leetcode-cn
problem-set
15.rs 3KB
weekly-contest-302
6164.rs 1KB
6120.rs 511B
.gitignore 10B
README.md 65KB
codeforces
1701
cf-contest-1701-B.c 1KB
cf-contest-1701-A.c 496B
1705
C.rs 2KB
B.rs 2KB
A.rs 2KB
C-test 67B
B-test 63B
1703
cf-contest-1703-A.c 602B
cf-contest-1703-B.c 805B
cf-contest-1703-C.c 1KB
cf-contest-1703-D-hack-gen.c 245B
E.rs 2KB
cf-contest-1703-D.rs 2KB
F.rs 2KB
cf-contest-1703-D 562KB
1702
cf-contest-1702-C.c 5KB
cf-contest-1702-B.c 795B
cf-contest-1702-A.c 604B
cf-contest-1702-D.rs 2KB
1704
A-test 169B
C.rs 2KB
A-test-own 43B
B.rs 2KB
A.rs 2KB
C-test 129B
B-test 184B
1708
A-test 48B
B.rs 2KB
A.rs 2KB
B-test 53B
1699
cf-contest-1699-A.c 916B
1706
A-test 60B
C.rs 2KB
B.rs 2KB
A.rs 2KB
C-test 116B
B-test 80B
1698
cf-contest-1698-A.c 427B
cf-contest-1698-B.c 528B
cf-contest-1698-C.rs 2KB
共 48 条
- 1
资源评论
码农阿豪
- 粉丝: 1w+
- 资源: 1750
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功